Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/ext2fs/ext2_vfsops.c
Context not available. | |||||
static int | static int | ||||
ext2_check_sb_compat(struct ext2fs *es, struct cdev *dev, int ronly) | ext2_check_sb_compat(struct ext2fs *es, struct cdev *dev, int ronly) | ||||
{ | { | ||||
uint32_t i, mask; | |||||
if (es->e2fs_magic != E2FS_MAGIC) { | if (es->e2fs_magic != E2FS_MAGIC) { | ||||
printf("ext2fs: %s: wrong magic number %#x (expected %#x)\n", | printf("ext2fs: %s: wrong magic number %#x (expected %#x)\n", | ||||
Context not available. | |||||
return (1); | return (1); | ||||
} | } | ||||
if (es->e2fs_rev > E2FS_REV0) { | if (es->e2fs_rev > E2FS_REV0) { | ||||
if (es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP | | mask = es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP | | ||||
EXT4F_RO_INCOMPAT_SUPP)) { | EXT4F_RO_INCOMPAT_SUPP); | ||||
printf( | if (mask) { | ||||
"WARNING: mount of %s denied due to unsupported optional features\n", | printf("WARNING: mount of %s denied due to " | ||||
devtoname(dev)); | "unsupported optional features:\n", devtoname(dev)); | ||||
for (i = 0; i < nitems(incompat_names); i++) | |||||
if (mask & incompat_names[i].mask) | |||||
pfg: This had some similarity with our nitems() macro (sys/param.h) | |||||
printf("%s ", incompat_names[i].name); | |||||
printf("\n"); | |||||
return (1); | return (1); | ||||
} | } | ||||
if (!ronly && | mask = es->e2fs_features_rocompat & ~EXT2F_ROCOMPAT_SUPP; | ||||
(es->e2fs_features_rocompat & ~EXT2F_ROCOMPAT_SUPP)) { | if (!ronly && mask) { | ||||
printf("WARNING: R/W mount of %s denied due to " | printf("WARNING: R/W mount of %s denied due to " | ||||
"unsupported optional features\n", devtoname(dev)); | "unsupported optional features:\n", devtoname(dev)); | ||||
for (i = 0; i < nitems(ro_compat_names); i++) | |||||
if (mask & ro_compat_names[i].mask) | |||||
printf("%s ", ro_compat_names[i].name); | |||||
printf("\n"); | |||||
return (1); | return (1); | ||||
pfgUnsubmitted Not Done Inline ActionsWondering what happens if the number is not on the list: ext4 has been adding more features and it is likely we cannot keep the list up to date with new things coming. pfg: Wondering what happens if the number is not on the list: ext4 has been adding more features and… | |||||
} | } | ||||
} | } | ||||
Context not available. |
This had some similarity with our nitems() macro (sys/param.h)