summaryrefslogtreecommitdiff
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2020-11-10 02:12:31 +0300
committerSteve French <stfrench@microsoft.com>2020-12-14 04:12:07 +0300
commita2a52a8a3601c37a68b31b734f5a06af8a7903f1 (patch)
tree2c4c2a0c0778590f5563076a546dc430df56cfef /fs/cifs/connect.c
parentd17abdf7566566fc402c31899b353044a7ff3cf4 (diff)
downloadlinux-a2a52a8a3601c37a68b31b734f5a06af8a7903f1.tar.xz
cifs: get rid of cifs_sb->mountdata
as we now have a full smb3_fs_context as part of the cifs superblock we no longer need a local copy of the mount options and can just reference the copy in the smb3_fs_context. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 5146c4645537..95b12f148735 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3012,7 +3012,7 @@ build_unc_path_to_root(const struct smb3_fs_context *ctx,
* expand_dfs_referral - Perform a dfs referral query and update the cifs_sb
*
*
- * If a referral is found, cifs_sb->mountdata will be (re-)allocated
+ * If a referral is found, cifs_sb->ctx->mount_options will be (re-)allocated
* to a string containing updated options for the submount. Otherwise it
* will be left untouched.
*
@@ -3038,7 +3038,7 @@ expand_dfs_referral(const unsigned int xid, struct cifs_ses *ses,
rc = dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb),
ref_path, &referral, NULL);
if (!rc) {
- mdata = cifs_compose_mount_options(cifs_sb->mountdata,
+ mdata = cifs_compose_mount_options(cifs_sb->ctx->mount_options,
full_path + 1, &referral);
free_dfs_info_param(&referral);
@@ -3049,8 +3049,8 @@ expand_dfs_referral(const unsigned int xid, struct cifs_ses *ses,
cifs_cleanup_volume_info_contents(ctx);
rc = cifs_setup_volume_info(ctx);
}
- kfree(cifs_sb->mountdata);
- cifs_sb->mountdata = mdata;
+ kfree(cifs_sb->ctx->mount_options);
+ cifs_sb->ctx->mount_options = mdata;
}
kfree(full_path);
return rc;
@@ -3109,7 +3109,8 @@ static int setup_dfs_tgt_conn(const char *path, const char *full_path,
if (rc)
return rc;
- mdata = cifs_compose_mount_options(cifs_sb->mountdata, full_path + 1, &ref);
+ mdata = cifs_compose_mount_options(cifs_sb->ctx->mount_options,
+ full_path + 1, &ref);
free_dfs_info_param(&ref);
if (IS_ERR(mdata)) {
@@ -3438,7 +3439,8 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
goto error;
}
/* Save mount options */
- mntdata = kstrndup(cifs_sb->mountdata, strlen(cifs_sb->mountdata), GFP_KERNEL);
+ mntdata = kstrndup(cifs_sb->ctx->mount_options,
+ strlen(cifs_sb->ctx->mount_options), GFP_KERNEL);
if (!mntdata) {
rc = -ENOMEM;
goto error;
@@ -3462,12 +3464,12 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
break;
}
/* Chase referral */
- oldmnt = cifs_sb->mountdata;
+ oldmnt = cifs_sb->ctx->mount_options;
rc = expand_dfs_referral(xid, root_ses, ctx, cifs_sb, ref_path + 1);
if (rc)
break;
/* Connect to new DFS target only if we were redirected */
- if (oldmnt != cifs_sb->mountdata) {
+ if (oldmnt != cifs_sb->ctx->mount_options) {
mount_put_conns(cifs_sb, xid, server, ses, tcon);
rc = mount_get_conns(ctx, cifs_sb, &xid, &server, &ses, &tcon);
}
@@ -3774,7 +3776,6 @@ cifs_umount(struct cifs_sb_info *cifs_sb)
}
spin_unlock(&cifs_sb->tlink_tree_lock);
- kfree(cifs_sb->mountdata);
kfree(cifs_sb->prepath);
#ifdef CONFIG_CIFS_DFS_UPCALL
dfs_cache_del_vol(cifs_sb->origin_fullpath);