f2fs: add feature facility in superblock
authorJaegeuk Kim <jaegeuk@kernel.org>
Mon, 13 Apr 2015 22:10:36 +0000 (15:10 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 28 May 2015 22:41:28 +0000 (15:41 -0700)
This patch introduces a feature in superblock, which will indicate any new
features for f2fs.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
include/linux/f2fs_fs.h

index cd9748af1b6386905be506b1855a1ac04c944552..e1dd986262cb373c92a959ee80e7aacf81f231a0 100644 (file)
@@ -70,6 +70,13 @@ struct f2fs_mount_info {
        unsigned int    opt;
 };
 
+#define F2FS_HAS_FEATURE(sb, mask)                                     \
+       ((F2FS_SB(sb)->raw_super->feature & cpu_to_le32(mask)) != 0)
+#define F2FS_SET_FEATURE(sb, mask)                                     \
+       F2FS_SB(sb)->raw_super->feature |= cpu_to_le32(mask)
+#define F2FS_CLEAR_FEATURE(sb, mask)                                   \
+       F2FS_SB(sb)->raw_super->feature &= ~cpu_to_le32(mask)
+
 #define CRCPOLY_LE 0xedb88320
 
 static inline __u32 f2fs_crc32(void *buf, size_t len)
index 8d345c24bcf7e3a459bb5319f3e9e67bf4417b05..d44e97f2b98ee89f86add9b61067c2a6d67c7d47 100644 (file)
@@ -90,7 +90,8 @@ struct f2fs_super_block {
        __le32 cp_payload;
        __u8 version[VERSION_LEN];      /* the kernel version */
        __u8 init_version[VERSION_LEN]; /* the initial kernel version */
-       __u8 reserved[892];             /* valid reserved region */
+       __le32 feature;                 /* defined features */
+       __u8 reserved[888];             /* valid reserved region */
 } __packed;
 
 /*