Commit 5fb08372 authored by Gu Zheng's avatar Gu Zheng Committed by Jaegeuk Kim

f2fs: set sb->s_fs_info before calling parse_options()

In f2fs_fill_super(), set sb->s_fs_info before calling parse_options(), then we can get
f2fs_sb_info via F2FS_SB(sb) in parse_options().
So that the second argument "sbi" of func parse_options() is no longer needed.
Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 8ae8f162
...@@ -303,9 +303,9 @@ static const struct export_operations f2fs_export_ops = { ...@@ -303,9 +303,9 @@ static const struct export_operations f2fs_export_ops = {
.get_parent = f2fs_get_parent, .get_parent = f2fs_get_parent,
}; };
static int parse_options(struct super_block *sb, struct f2fs_sb_info *sbi, static int parse_options(struct super_block *sb, char *options)
char *options)
{ {
struct f2fs_sb_info *sbi = F2FS_SB(sb);
substring_t args[MAX_OPT_ARGS]; substring_t args[MAX_OPT_ARGS];
char *p; char *p;
int arg = 0; int arg = 0;
...@@ -541,6 +541,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -541,6 +541,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
if (err) if (err)
goto free_sb_buf; goto free_sb_buf;
} }
sb->s_fs_info = sbi;
/* init some FS parameters */ /* init some FS parameters */
sbi->active_logs = NR_CURSEG_TYPE; sbi->active_logs = NR_CURSEG_TYPE;
...@@ -553,7 +554,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -553,7 +554,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
set_opt(sbi, POSIX_ACL); set_opt(sbi, POSIX_ACL);
#endif #endif
/* parse mount options */ /* parse mount options */
err = parse_options(sb, sbi, (char *)data); err = parse_options(sb, (char *)data);
if (err) if (err)
goto free_sb_buf; goto free_sb_buf;
...@@ -565,7 +566,6 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -565,7 +566,6 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
sb->s_xattr = f2fs_xattr_handlers; sb->s_xattr = f2fs_xattr_handlers;
sb->s_export_op = &f2fs_export_ops; sb->s_export_op = &f2fs_export_ops;
sb->s_magic = F2FS_SUPER_MAGIC; sb->s_magic = F2FS_SUPER_MAGIC;
sb->s_fs_info = sbi;
sb->s_time_gran = 1; sb->s_time_gran = 1;
sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
(test_opt(sbi, POSIX_ACL) ? MS_POSIXACL : 0); (test_opt(sbi, POSIX_ACL) ? MS_POSIXACL : 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment