summaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-09-08 19:11:46 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2019-09-12 21:00:26 -0400
commitf6490b7fbb8216e15c0b52409b5fd9d035fe3530 (patch)
tree818af7108f6d205595555e2f0c94b886dbce54e7 /mm/shmem.c
parent0b5071dd323da2e277bce7e68749dc0a5fba4703 (diff)
shmem_parse_options(): don't bother with mpol in separate variable
just use ctx->mpol (note that callers always set ctx->mpol to NULL when calling that). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 98aa066c00f7..8bca06c12b9a 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3366,7 +3366,6 @@ static const struct export_operations shmem_export_ops = {
3366static int shmem_parse_options(char *options, struct shmem_options *ctx) 3366static int shmem_parse_options(char *options, struct shmem_options *ctx)
3367{ 3367{
3368 char *this_char, *value, *rest; 3368 char *this_char, *value, *rest;
3369 struct mempolicy *mpol = NULL;
3370 uid_t uid; 3369 uid_t uid;
3371 gid_t gid; 3370 gid_t gid;
3372 3371
@@ -3452,9 +3451,9 @@ static int shmem_parse_options(char *options, struct shmem_options *ctx)
3452#endif 3451#endif
3453#ifdef CONFIG_NUMA 3452#ifdef CONFIG_NUMA
3454 } else if (!strcmp(this_char,"mpol")) { 3453 } else if (!strcmp(this_char,"mpol")) {
3455 mpol_put(mpol); 3454 mpol_put(ctx->mpol);
3456 mpol = NULL; 3455 ctx->mpol = NULL;
3457 if (mpol_parse_str(value, &mpol)) 3456 if (mpol_parse_str(value, &ctx->mpol))
3458 goto bad_val; 3457 goto bad_val;
3459#endif 3458#endif
3460 } else { 3459 } else {
@@ -3462,14 +3461,14 @@ static int shmem_parse_options(char *options, struct shmem_options *ctx)
3462 goto error; 3461 goto error;
3463 } 3462 }
3464 } 3463 }
3465 ctx->mpol = mpol;
3466 return 0; 3464 return 0;
3467 3465
3468bad_val: 3466bad_val:
3469 pr_err("tmpfs: Bad value '%s' for mount option '%s'\n", 3467 pr_err("tmpfs: Bad value '%s' for mount option '%s'\n",
3470 value, this_char); 3468 value, this_char);
3471error: 3469error:
3472 mpol_put(mpol); 3470 mpol_put(ctx->mpol);
3471 ctx->mpol = NULL;
3473 return 1; 3472 return 1;
3474 3473
3475} 3474}