Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Ronnie Sahlberg and committed by
Steve French
a2a52a8a d17abdf7

+12 -18
+2 -1
fs/cifs/cifs_dfs_ref.c
··· 23 23 #include "cifs_debug.h" 24 24 #include "cifs_unicode.h" 25 25 #include "dfs_cache.h" 26 + #include "fs_context.h" 26 27 27 28 static LIST_HEAD(cifs_dfs_automount_list); 28 29 ··· 276 275 /* See afs_mntpt_do_automount in fs/afs/mntpt.c for an example */ 277 276 278 277 /* strip first '\' from fullpath */ 279 - mountdata = cifs_compose_mount_options(cifs_sb->mountdata, 278 + mountdata = cifs_compose_mount_options(cifs_sb->ctx->mount_options, 280 279 fullpath + 1, NULL); 281 280 if (IS_ERR(mountdata)) { 282 281 kfree(devname);
-1
fs/cifs/cifs_fs_sb.h
··· 74 74 umode_t mnt_file_mode; 75 75 umode_t mnt_dir_mode; 76 76 unsigned int mnt_cifs_flags; 77 - char *mountdata; /* options received at mount time or via DFS refs */ 78 77 struct delayed_work prune_tlinks; 79 78 struct rcu_head rcu; 80 79
-7
fs/cifs/cifsfs.c
··· 812 812 goto out; 813 813 } 814 814 815 - cifs_sb->mountdata = kstrndup(cifs_sb->ctx->mount_options, PAGE_SIZE, GFP_KERNEL); 816 - if (cifs_sb->mountdata == NULL) { 817 - root = ERR_PTR(-ENOMEM); 818 - goto out; 819 - } 820 - 821 815 rc = cifs_setup_cifs_sb(cifs_sb->ctx, cifs_sb); 822 816 if (rc) { 823 817 root = ERR_PTR(rc); ··· 866 872 out: 867 873 if (cifs_sb) { 868 874 kfree(cifs_sb->prepath); 869 - kfree(cifs_sb->mountdata); 870 875 cifs_cleanup_volume_info(cifs_sb->ctx); 871 876 kfree(cifs_sb); 872 877 }
+10 -9
fs/cifs/connect.c
··· 3012 3012 * expand_dfs_referral - Perform a dfs referral query and update the cifs_sb 3013 3013 * 3014 3014 * 3015 - * If a referral is found, cifs_sb->mountdata will be (re-)allocated 3015 + * If a referral is found, cifs_sb->ctx->mount_options will be (re-)allocated 3016 3016 * to a string containing updated options for the submount. Otherwise it 3017 3017 * will be left untouched. 3018 3018 * ··· 3038 3038 rc = dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb), 3039 3039 ref_path, &referral, NULL); 3040 3040 if (!rc) { 3041 - mdata = cifs_compose_mount_options(cifs_sb->mountdata, 3041 + mdata = cifs_compose_mount_options(cifs_sb->ctx->mount_options, 3042 3042 full_path + 1, &referral); 3043 3043 free_dfs_info_param(&referral); 3044 3044 ··· 3049 3049 cifs_cleanup_volume_info_contents(ctx); 3050 3050 rc = cifs_setup_volume_info(ctx); 3051 3051 } 3052 - kfree(cifs_sb->mountdata); 3053 - cifs_sb->mountdata = mdata; 3052 + kfree(cifs_sb->ctx->mount_options); 3053 + cifs_sb->ctx->mount_options = mdata; 3054 3054 } 3055 3055 kfree(full_path); 3056 3056 return rc; ··· 3109 3109 if (rc) 3110 3110 return rc; 3111 3111 3112 - mdata = cifs_compose_mount_options(cifs_sb->mountdata, full_path + 1, &ref); 3112 + mdata = cifs_compose_mount_options(cifs_sb->ctx->mount_options, 3113 + full_path + 1, &ref); 3113 3114 free_dfs_info_param(&ref); 3114 3115 3115 3116 if (IS_ERR(mdata)) { ··· 3439 3438 goto error; 3440 3439 } 3441 3440 /* Save mount options */ 3442 - mntdata = kstrndup(cifs_sb->mountdata, strlen(cifs_sb->mountdata), GFP_KERNEL); 3441 + mntdata = kstrndup(cifs_sb->ctx->mount_options, 3442 + strlen(cifs_sb->ctx->mount_options), GFP_KERNEL); 3443 3443 if (!mntdata) { 3444 3444 rc = -ENOMEM; 3445 3445 goto error; ··· 3464 3462 break; 3465 3463 } 3466 3464 /* Chase referral */ 3467 - oldmnt = cifs_sb->mountdata; 3465 + oldmnt = cifs_sb->ctx->mount_options; 3468 3466 rc = expand_dfs_referral(xid, root_ses, ctx, cifs_sb, ref_path + 1); 3469 3467 if (rc) 3470 3468 break; 3471 3469 /* Connect to new DFS target only if we were redirected */ 3472 - if (oldmnt != cifs_sb->mountdata) { 3470 + if (oldmnt != cifs_sb->ctx->mount_options) { 3473 3471 mount_put_conns(cifs_sb, xid, server, ses, tcon); 3474 3472 rc = mount_get_conns(ctx, cifs_sb, &xid, &server, &ses, &tcon); 3475 3473 } ··· 3776 3774 } 3777 3775 spin_unlock(&cifs_sb->tlink_tree_lock); 3778 3776 3779 - kfree(cifs_sb->mountdata); 3780 3777 kfree(cifs_sb->prepath); 3781 3778 #ifdef CONFIG_CIFS_DFS_UPCALL 3782 3779 dfs_cache_del_vol(cifs_sb->origin_fullpath);