[PATCH 4/6] fsconfig: parse "subtype" param for old internal API
From: Miklos Szeredi
Date: Thu Sep 20 2018 - 11:12:32 EST
This subtype thing is specific to "fuse" and "fuseblk" filesystems. When these
are switched over to the new context API, the handling of this parameter can be
moved from legacy_parse_param() into fuse.
Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx>
---
fs/fs_context.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/fs_context.c b/fs/fs_context.c
index c0ecbb1ecdfe..0192456712d2 100644
--- a/fs/fs_context.c
+++ b/fs/fs_context.c
@@ -574,6 +574,16 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param)
param->string = NULL;
return 0;
}
+ if ((fc->fs_type->fs_flags & FS_HAS_SUBTYPE) &&
+ strcmp(param->key, "subtype") == 0) {
+ if (param->type != fs_value_is_string)
+ return invalf(fc, "VFS: Legacy: Non-string subtype");
+ if (fc->subtype)
+ return invalf(fc, "VFS: Legacy: Multiple subtype");
+ fc->subtype = param->string;
+ param->string= NULL;
+ return 0;
+ }
if (ctx->param_type != LEGACY_FS_UNSET_PARAMS &&
ctx->param_type != LEGACY_FS_INDIVIDUAL_PARAMS)
--
2.14.3