Skip to content

Commit 1ab88ca

Browse files
authored
Add support for mkfs.xfs v6.14. (#261)
1 parent 5dd598a commit 1ab88ca

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

toolkit/tools/imagegen/diskutils/filesystem.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,14 @@ var (
111111
"crc": {3, 2, 0},
112112
"finobt": {3, 2, 1},
113113
"inobtcount": {5, 10},
114+
"metadir": {6, 13},
114115
"reflink": {4, 10},
115116
"rmapbt": {4, 10},
117+
"autofsck": {6, 10},
116118
"sparse": {4, 10},
117119
"nrext64": {5, 19},
120+
"exchange": {6, 10},
121+
"parent": {6, 10},
118122
}
119123

120124
// The mkfs.xfs flag each feature sits under.
@@ -123,15 +127,19 @@ var (
123127
"crc": "metadata",
124128
"finobt": "metadata",
125129
"inobtcount": "metadata",
130+
"metadir": "metadata",
126131
"reflink": "metadata",
127132
"rmapbt": "metadata",
133+
"autofsck": "metadata",
128134
"sparse": "inode",
129135
"nrext64": "inode",
136+
"exchange": "inode",
137+
"parent": "naming",
130138
}
131139

132140
// The maximum version of mkfs.xfs that is currently supported.
133141
// This is used to prevent issues with newer versions of mkfs.xfs default enabling new features.
134-
maxMkfsXfsVersion = version.Version{6, 9}
142+
maxMkfsXfsVersion = version.Version{6, 14}
135143

136144
// The minimum supported kernel version. This helps avoid versions complexity for features that are old and therefore
137145
// basically universal.
@@ -234,6 +242,7 @@ func getXfsFileSystemOptions(hostKernelVersion version.Version, options fileSyst
234242

235243
metadataArgs := []string(nil)
236244
inodeArgs := []string(nil)
245+
namingArgs := []string(nil)
237246

238247
// Unlike mkfs.ext4, mkfs.xfs doesn't have a mechanism to disable all features.
239248
// So, explictly set every feature flag.
@@ -271,13 +280,17 @@ func getXfsFileSystemOptions(hostKernelVersion version.Version, options fileSyst
271280

272281
case "inode":
273282
inodeArgs = append(inodeArgs, featureArg)
283+
284+
case "naming":
285+
namingArgs = append(namingArgs, featureArg)
274286
}
275287
}
276288

277289
metadataArgValue := strings.Join(metadataArgs, ",")
278290
inodeArgValue := strings.Join(inodeArgs, ",")
291+
namingArgValue := strings.Join(namingArgs, ",")
279292

280-
args := []string{"-m", metadataArgValue, "-i", inodeArgValue}
293+
args := []string{"-m", metadataArgValue, "-i", inodeArgValue, "-n", namingArgValue}
281294
return args, nil
282295
}
283296

0 commit comments

Comments
 (0)