Commit d9a86922 authored by Aurelien Aptel's avatar Aurelien Aptel Committed by Steve French

cifs: add fs_context param to parsing helpers

Add fs_context param to parsing helpers to be able to log into it in
next patch.

Make some helper static as they are not used outside of fs_context.c
Signed-off-by: default avatarAurelien Aptel <aaptel@suse.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 9d4ac8b6
...@@ -188,8 +188,8 @@ const struct fs_parameter_spec smb3_fs_parameters[] = { ...@@ -188,8 +188,8 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
{} {}
}; };
int static int
cifs_parse_security_flavors(char *value, struct smb3_fs_context *ctx) cifs_parse_security_flavors(struct fs_context *fc, char *value, struct smb3_fs_context *ctx)
{ {
substring_t args[MAX_OPT_ARGS]; substring_t args[MAX_OPT_ARGS];
...@@ -254,8 +254,8 @@ static const match_table_t cifs_cacheflavor_tokens = { ...@@ -254,8 +254,8 @@ static const match_table_t cifs_cacheflavor_tokens = {
{ Opt_cache_err, NULL } { Opt_cache_err, NULL }
}; };
int static int
cifs_parse_cache_flavor(char *value, struct smb3_fs_context *ctx) cifs_parse_cache_flavor(struct fs_context *fc, char *value, struct smb3_fs_context *ctx)
{ {
substring_t args[MAX_OPT_ARGS]; substring_t args[MAX_OPT_ARGS];
...@@ -339,7 +339,7 @@ smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx ...@@ -339,7 +339,7 @@ smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx
} }
static int static int
cifs_parse_smb_version(char *value, struct smb3_fs_context *ctx, bool is_smb3) cifs_parse_smb_version(struct fs_context *fc, char *value, struct smb3_fs_context *ctx, bool is_smb3)
{ {
substring_t args[MAX_OPT_ARGS]; substring_t args[MAX_OPT_ARGS];
...@@ -684,7 +684,8 @@ static void smb3_fs_context_free(struct fs_context *fc) ...@@ -684,7 +684,8 @@ static void smb3_fs_context_free(struct fs_context *fc)
* Compare the old and new proposed context during reconfigure * Compare the old and new proposed context during reconfigure
* and check if the changes are compatible. * and check if the changes are compatible.
*/ */
static int smb3_verify_reconfigure_ctx(struct smb3_fs_context *new_ctx, static int smb3_verify_reconfigure_ctx(struct fs_context *fc,
struct smb3_fs_context *new_ctx,
struct smb3_fs_context *old_ctx) struct smb3_fs_context *old_ctx)
{ {
if (new_ctx->posix_paths != old_ctx->posix_paths) { if (new_ctx->posix_paths != old_ctx->posix_paths) {
...@@ -747,7 +748,7 @@ static int smb3_reconfigure(struct fs_context *fc) ...@@ -747,7 +748,7 @@ static int smb3_reconfigure(struct fs_context *fc)
struct cifs_sb_info *cifs_sb = CIFS_SB(root->d_sb); struct cifs_sb_info *cifs_sb = CIFS_SB(root->d_sb);
int rc; int rc;
rc = smb3_verify_reconfigure_ctx(ctx, cifs_sb->ctx); rc = smb3_verify_reconfigure_ctx(fc, ctx, cifs_sb->ctx);
if (rc) if (rc)
return rc; return rc;
...@@ -1175,16 +1176,16 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, ...@@ -1175,16 +1176,16 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
case Opt_vers: case Opt_vers:
/* protocol version (dialect) */ /* protocol version (dialect) */
if (cifs_parse_smb_version(param->string, ctx, is_smb3) != 0) if (cifs_parse_smb_version(fc, param->string, ctx, is_smb3) != 0)
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
ctx->got_version = true; ctx->got_version = true;
break; break;
case Opt_sec: case Opt_sec:
if (cifs_parse_security_flavors(param->string, ctx) != 0) if (cifs_parse_security_flavors(fc, param->string, ctx) != 0)
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
break; break;
case Opt_cache: case Opt_cache:
if (cifs_parse_cache_flavor(param->string, ctx) != 0) if (cifs_parse_cache_flavor(fc, param->string, ctx) != 0)
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
break; break;
case Opt_witness: case Opt_witness:
......
...@@ -262,10 +262,6 @@ struct smb3_fs_context { ...@@ -262,10 +262,6 @@ struct smb3_fs_context {
extern const struct fs_parameter_spec smb3_fs_parameters[]; extern const struct fs_parameter_spec smb3_fs_parameters[];
extern int cifs_parse_cache_flavor(char *value,
struct smb3_fs_context *ctx);
extern int cifs_parse_security_flavors(char *value,
struct smb3_fs_context *ctx);
extern int smb3_init_fs_context(struct fs_context *fc); extern int smb3_init_fs_context(struct fs_context *fc);
extern void smb3_cleanup_fs_context_contents(struct smb3_fs_context *ctx); extern void smb3_cleanup_fs_context_contents(struct smb3_fs_context *ctx);
extern void smb3_cleanup_fs_context(struct smb3_fs_context *ctx); extern void smb3_cleanup_fs_context(struct smb3_fs_context *ctx);
......
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