Skip to content

Commit 4c94bff

Browse files
Lukas Czernertytso
authored andcommitted
ext4: move option validation to a separate function
Move option validation out of parse_options() into a separate function ext4_validate_options(). Signed-off-by: Lukas Czerner <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent e5a185c commit 4c94bff

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

fs/ext4/super.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static void ext4_unregister_li_request(struct super_block *sb);
8888
static void ext4_clear_request_list(void);
8989
static struct inode *ext4_get_journal_inode(struct super_block *sb,
9090
unsigned int journal_inum);
91+
static int ext4_validate_options(struct super_block *sb);
9192

9293
/*
9394
* Lock ordering
@@ -2582,10 +2583,9 @@ static int parse_options(char *options, struct super_block *sb,
25822583
struct ext4_parsed_options *ret_opts,
25832584
int is_remount)
25842585
{
2585-
struct ext4_sb_info __maybe_unused *sbi = EXT4_SB(sb);
2586-
char *p, __maybe_unused *usr_qf_name, __maybe_unused *grp_qf_name;
25872586
substring_t args[MAX_OPT_ARGS];
25882587
int token;
2588+
char *p;
25892589

25902590
if (!options)
25912591
return 1;
@@ -2603,7 +2603,14 @@ static int parse_options(char *options, struct super_block *sb,
26032603
is_remount) < 0)
26042604
return 0;
26052605
}
2606+
return ext4_validate_options(sb);
2607+
}
2608+
2609+
static int ext4_validate_options(struct super_block *sb)
2610+
{
2611+
struct ext4_sb_info *sbi = EXT4_SB(sb);
26062612
#ifdef CONFIG_QUOTA
2613+
char *usr_qf_name, *grp_qf_name;
26072614
/*
26082615
* We do the test below only for project quotas. 'usrquota' and
26092616
* 'grpquota' mount options are allowed even without quota feature

0 commit comments

Comments
 (0)