diff options
author | Misono, Tomohiro <misono.tomohiro@jp.fujitsu.com> | 2017-12-14 17:28:00 +0900 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-01-22 16:08:19 +0100 |
commit | e215772cd2abcf33adad8857c0f5a8214a6e7d22 (patch) | |
tree | f37e671a09c5558edff560771c682089cf5f87af /fs/btrfs/super.c | |
parent | 203e02d934ed0570551b87c8d0a0a9cf917487cb (diff) | |
download | linux-e215772cd2abcf33adad8857c0f5a8214a6e7d22.tar.bz2 |
btrfs: cleanup unnecessary string dup in btrfs_parse_options()
Long ago, commit edf24abe51493 ("btrfs: sanity mount option parsing and
early mount code") split the btrfs_parse_options() into two parts
(btrfs_parse_early_options() and btrfs_parse_options()). As a result,
btrfs_parse_optins no longer gets called twice and is the last one to
parse mount option string. Therefore there is no need to dup it.
Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 03367a64b5c1..1d33744a9326 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -414,7 +414,7 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options, unsigned long new_flags) { substring_t args[MAX_OPT_ARGS]; - char *p, *num, *orig = NULL; + char *p, *num; u64 cache_gen; int intarg; int ret = 0; @@ -437,16 +437,6 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options, if (!options) goto check; - /* - * strsep changes the string, duplicate it because parse_options - * gets called twice - */ - options = kstrdup(options, GFP_KERNEL); - if (!options) - return -ENOMEM; - - orig = options; - while ((p = strsep(&options, ",")) != NULL) { int token; if (!*p) @@ -887,7 +877,6 @@ out: btrfs_info(info, "disk space caching is enabled"); if (!ret && btrfs_test_opt(info, FREE_SPACE_TREE)) btrfs_info(info, "using free space tree"); - kfree(orig); return ret; } |