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

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
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -188,8 +188,8 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
	{}
};

int
cifs_parse_security_flavors(char *value, struct smb3_fs_context *ctx)
static int
cifs_parse_security_flavors(struct fs_context *fc, char *value, struct smb3_fs_context *ctx)
{

	substring_t args[MAX_OPT_ARGS];
@@ -254,8 +254,8 @@ static const match_table_t cifs_cacheflavor_tokens = {
	{ Opt_cache_err, NULL }
};

int
cifs_parse_cache_flavor(char *value, struct smb3_fs_context *ctx)
static int
cifs_parse_cache_flavor(struct fs_context *fc, char *value, struct smb3_fs_context *ctx)
{
	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
}

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];

@@ -684,7 +684,8 @@ static void smb3_fs_context_free(struct fs_context *fc)
 * Compare the old and new proposed context during reconfigure
 * 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)
{
	if (new_ctx->posix_paths != old_ctx->posix_paths) {
@@ -747,7 +748,7 @@ static int smb3_reconfigure(struct fs_context *fc)
	struct cifs_sb_info *cifs_sb = CIFS_SB(root->d_sb);
	int rc;

	rc = smb3_verify_reconfigure_ctx(ctx, cifs_sb->ctx);
	rc = smb3_verify_reconfigure_ctx(fc, ctx, cifs_sb->ctx);
	if (rc)
		return rc;

@@ -1175,16 +1176,16 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
		goto cifs_parse_mount_err;
	case Opt_vers:
		/* 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;
		ctx->got_version = true;
		break;
	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;
		break;
	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;
		break;
	case Opt_witness:
+0 −4
Original line number Diff line number Diff line
@@ -262,10 +262,6 @@ struct smb3_fs_context {

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 void smb3_cleanup_fs_context_contents(struct smb3_fs_context *ctx);
extern void smb3_cleanup_fs_context(struct smb3_fs_context *ctx);