+ unsigned int bit = 1 << i;
+
+ if (!(f & bit))
+ continue;
+
+ name = feature_name(feature_table, bit);
+ if (!name)
+ continue;
+
+ MSG(0, " %s", name);
}
+
MSG(0, "\n");
MSG(0, "Info: superblock encrypt level = %d, salt = ",
sb->encryption_level);
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 9d35b42..a97c974 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -1811,35 +1811,45 @@ static inline void f2fs_init_inode(struct
f2fs_super_block *sb,
struct feature {
char *name;
- u32 mask;
+ u32 mask;
+ u32 settable;
};
#define INIT_FEATURE_TABLE \
struct feature feature_table[] = { \
- { "encrypt", F2FS_FEATURE_ENCRYPT }, \
- { "extra_attr", F2FS_FEATURE_EXTRA_ATTR }, \
- { "project_quota", F2FS_FEATURE_PRJQUOTA }, \
- { "inode_checksum", F2FS_FEATURE_INODE_CHKSUM }, \
- { "flexible_inline_xattr", F2FS_FEATURE_FLEXIBLE_INLINE_XATTR },\
- { "quota", F2FS_FEATURE_QUOTA_INO }, \
- { "inode_crtime", F2FS_FEATURE_INODE_CRTIME }, \
- { "lost_found", F2FS_FEATURE_LOST_FOUND }, \
- { "verity", F2FS_FEATURE_VERITY }, /* reserved */ \
- { "sb_checksum", F2FS_FEATURE_SB_CHKSUM }, \
- { "casefold", F2FS_FEATURE_CASEFOLD }, \
- { "compression", F2FS_FEATURE_COMPRESSION }, \
- { "ro", F2FS_FEATURE_RO}, \
- { NULL, 0x0}, \
+ { "encrypt", F2FS_FEATURE_ENCRYPT, 1}, \
+ { "blkzoned", F2FS_FEATURE_BLKZONED, 0}, \
+ { "extra_attr", F2FS_FEATURE_EXTRA_ATTR,
1}, \
+ { "project_quota", F2FS_FEATURE_PRJQUOTA, 1}, \
+ { "inode_checksum", F2FS_FEATURE_INODE_CHKSUM, 1}, \
+ { "flexible_inline_xattr", F2FS_FEATURE_FLEXIBLE_INLINE_XATTR,1}, \
+ { "quota", F2FS_FEATURE_QUOTA_INO, 1}, \
+ { "inode_crtime", F2FS_FEATURE_INODE_CRTIME, 1}, \
+ { "lost_found", F2FS_FEATURE_LOST_FOUND,
1}, \
+ { "verity", F2FS_FEATURE_VERITY, 1}, \
+ { "sb_checksum", F2FS_FEATURE_SB_CHKSUM, 1}, \
+ { "casefold", F2FS_FEATURE_CASEFOLD, 1}, \
+ { "compression", F2FS_FEATURE_COMPRESSION, 1}, \
+ { "ro", F2FS_FEATURE_RO,
1}, \
+ { NULL, 0x0, 0}, \
};
static inline u32 feature_map(struct feature *table, char *feature)
{
struct feature *p;
- for (p = table; p->name && strcmp(p->name, feature); p++)
+ for (p = table; p->name && p->settable && strcmp(p->name, feature); p++)
;
return p->mask;
}
+static inline char *feature_name(struct feature *table, u32 mask)
+{
+ struct feature *p;
+ for (p = table; p->name && p->mask != mask; p++)
+ ;
+ return p->name;
+}
+
static inline int set_feature_bits(struct feature *table, char *features)
{
u32 mask = feature_map(table, features);
--
2.40.1