Skip to content

Commit

Permalink
f2fs: add feature facility in superblock
Browse files Browse the repository at this point in the history
This patch introduces a feature in superblock, which will indicate any new
features for f2fs.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Jaegeuk Kim committed May 28, 2015
1 parent b5492af commit 76f105a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions fs/f2fs/f2fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion include/linux/f2fs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 76f105a

Please sign in to comment.