Skip to content

Commit 7d6ee50

Browse files
sandeenJaegeuk Kim
authored andcommitted
f2fs: make INLINECRYPT a mount option flag
Set INLINECRYPT into sbi during parsing, and transfer it to the sb in fill_super, so that an sb is not required during option parsing. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent abd0e04 commit 7d6ee50

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

fs/f2fs/f2fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ extern const char *f2fs_fault_name[FAULT_MAX];
116116
#define F2FS_MOUNT_COMPRESS_CACHE 0x04000000
117117
#define F2FS_MOUNT_AGE_EXTENT_CACHE 0x08000000
118118
#define F2FS_MOUNT_NAT_BITS 0x10000000
119+
#define F2FS_MOUNT_INLINECRYPT 0x20000000
119120

120121
#define F2FS_OPTION(sbi) ((sbi)->mount_opt)
121122
#define clear_opt(sbi, option) (F2FS_OPTION(sbi).opt &= ~F2FS_MOUNT_##option)

fs/f2fs/super.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
10391039
break;
10401040
case Opt_inlinecrypt:
10411041
#ifdef CONFIG_FS_ENCRYPTION_INLINE_CRYPT
1042-
sb->s_flags |= SB_INLINECRYPT;
1042+
set_opt(sbi, INLINECRYPT);
10431043
#else
10441044
f2fs_info(sbi, "inline encryption not supported");
10451045
#endif
@@ -4585,6 +4585,9 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
45854585
sb->s_time_gran = 1;
45864586
sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
45874587
(test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
4588+
if (test_opt(sbi, INLINECRYPT))
4589+
sb->s_flags |= SB_INLINECRYPT;
4590+
45884591
super_set_uuid(sb, (void *) raw_super->uuid, sizeof(raw_super->uuid));
45894592
super_set_sysfs_name_bdev(sb);
45904593
sb->s_iflags |= SB_I_CGROUPWB;

0 commit comments

Comments
 (0)