-
Notifications
You must be signed in to change notification settings - Fork 11
/
btrfs_h.go
73 lines (57 loc) · 1.81 KB
/
btrfs_h.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package btrfs
import "strings"
const maxUint64 = 1<<64 - 1
const labelSize = 256
type FeatureFlags uint64
const (
FeatureCompatROFreeSpaceTree = FeatureFlags(1 << 0)
)
type IncompatFeatures uint64
func (f IncompatFeatures) String() string {
var s []string
for i, name := range incompatFeatureNames {
if uint64(f)&uint64(i) != 0 {
s = append(s, name)
}
}
return strings.Join(s, ",")
}
var incompatFeatureNames = []string{
"DefaultSubvol",
"MixedGroups",
"CompressLZO",
"CompressLZOv2",
"BigMetadata",
"ExtendedIRef",
"RAID56",
"SkinnyMetadata",
"NoHoles",
}
const (
FeatureIncompatMixedBackRef = IncompatFeatures(1 << 0)
FeatureIncompatDefaultSubvol = IncompatFeatures(1 << 1)
FeatureIncompatMixedGroups = IncompatFeatures(1 << 2)
FeatureIncompatCompressLZO = IncompatFeatures(1 << 3)
// Some patches floated around with a second compression method
// lets save that incompat here for when they do get in.
// Note we don't actually support it, we're just reserving the number.
FeatureIncompatCompressLZOv2 = IncompatFeatures(1 << 4)
// Older kernels tried to do bigger metadata blocks, but the
// code was pretty buggy. Lets not let them try anymore.
FeatureIncompatBigMetadata = IncompatFeatures(1 << 5)
FeatureIncompatExtendedIRef = IncompatFeatures(1 << 6)
FeatureIncompatRAID56 = IncompatFeatures(1 << 7)
FeatureIncompatSkinnyMetadata = IncompatFeatures(1 << 8)
FeatureIncompatNoHoles = IncompatFeatures(1 << 9)
)
// Flags definition for balance.
type BalanceFlags uint64
// Restriper's general type filter.
const (
BalanceData = BalanceFlags(1 << 0)
BalanceSystem = BalanceFlags(1 << 1)
BalanceMetadata = BalanceFlags(1 << 2)
BalanceMask = (BalanceData | BalanceSystem | BalanceMetadata)
BalanceForce = BalanceFlags(1 << 3)
BalanceResume = BalanceFlags(1 << 4)
)