aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSean Finney <seanius@seanius.net>2011-04-11 09:19:35 -0400
committerSteve French <sfrench@us.ibm.com>2011-05-19 10:10:55 -0400
commitf14bcf71d1b802f6042b6c70a0c37120e47a0876 (patch)
tree9852d20c31ec19caaccec30a0b06b89542681ac7 /fs
parent5167f11ec962690ecf926fab00f1d0524cd78664 (diff)
cifs: Unconditionally copy mount options to superblock info
Previously mount options were copied and updated in the cifs_sb_info struct only when CONFIG_CIFS_DFS_UPCALL was enabled. Making this information generally available allows us to remove a number of ifdefs, extra function params, and temporary variables. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Sean Finney <seanius@seanius.net> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifs_fs_sb.h4
-rw-r--r--fs/cifs/cifsfs.c8
-rw-r--r--fs/cifs/cifsproto.h2
-rw-r--r--fs/cifs/connect.c8
4 files changed, 6 insertions, 16 deletions
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index ac51cd2d33ae..a9d5692e0c20 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -58,9 +58,7 @@ struct cifs_sb_info {
58 unsigned int mnt_cifs_flags; 58 unsigned int mnt_cifs_flags;
59 int prepathlen; 59 int prepathlen;
60 char *prepath; /* relative path under the share to mount to */ 60 char *prepath; /* relative path under the share to mount to */
61#ifdef CONFIG_CIFS_DFS_UPCALL 61 char *mountdata; /* options received at mount time or via DFS refs */
62 char *mountdata; /* mount options received at mount time */
63#endif
64 struct backing_dev_info bdi; 62 struct backing_dev_info bdi;
65 struct delayed_work prune_tlinks; 63 struct delayed_work prune_tlinks;
66}; 64};
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index bb39afcc6f38..2b8e47e5e533 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -128,7 +128,6 @@ cifs_read_super(struct super_block *sb, void *data,
128 } 128 }
129 cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages; 129 cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages;
130 130
131#ifdef CONFIG_CIFS_DFS_UPCALL
132 /* 131 /*
133 * Copy mount params to sb for use in submounts. Better to do 132 * Copy mount params to sb for use in submounts. Better to do
134 * the copy here and deal with the error before cleanup gets 133 * the copy here and deal with the error before cleanup gets
@@ -143,9 +142,8 @@ cifs_read_super(struct super_block *sb, void *data,
143 return -ENOMEM; 142 return -ENOMEM;
144 } 143 }
145 } 144 }
146#endif
147 145
148 rc = cifs_mount(sb, cifs_sb, data, devname); 146 rc = cifs_mount(sb, cifs_sb, devname);
149 147
150 if (rc) { 148 if (rc) {
151 if (!silent) 149 if (!silent)
@@ -197,12 +195,10 @@ out_no_root:
197 195
198out_mount_failed: 196out_mount_failed:
199 if (cifs_sb) { 197 if (cifs_sb) {
200#ifdef CONFIG_CIFS_DFS_UPCALL
201 if (cifs_sb->mountdata) { 198 if (cifs_sb->mountdata) {
202 kfree(cifs_sb->mountdata); 199 kfree(cifs_sb->mountdata);
203 cifs_sb->mountdata = NULL; 200 cifs_sb->mountdata = NULL;
204 } 201 }
205#endif
206 unload_nls(cifs_sb->local_nls); 202 unload_nls(cifs_sb->local_nls);
207 bdi_destroy(&cifs_sb->bdi); 203 bdi_destroy(&cifs_sb->bdi);
208 kfree(cifs_sb); 204 kfree(cifs_sb);
@@ -226,12 +222,10 @@ cifs_put_super(struct super_block *sb)
226 rc = cifs_umount(sb, cifs_sb); 222 rc = cifs_umount(sb, cifs_sb);
227 if (rc) 223 if (rc)
228 cERROR(1, "cifs_umount failed with return code %d", rc); 224 cERROR(1, "cifs_umount failed with return code %d", rc);
229#ifdef CONFIG_CIFS_DFS_UPCALL
230 if (cifs_sb->mountdata) { 225 if (cifs_sb->mountdata) {
231 kfree(cifs_sb->mountdata); 226 kfree(cifs_sb->mountdata);
232 cifs_sb->mountdata = NULL; 227 cifs_sb->mountdata = NULL;
233 } 228 }
234#endif
235 229
236 unload_nls(cifs_sb->local_nls); 230 unload_nls(cifs_sb->local_nls);
237 bdi_destroy(&cifs_sb->bdi); 231 bdi_destroy(&cifs_sb->bdi);
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 136d2f2febcc..a1c94d396afe 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -148,7 +148,7 @@ extern struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *, struct inode *,
148extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *, 148extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *,
149 const char *); 149 const char *);
150 150
151extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, 151extern int cifs_mount(struct super_block *, struct cifs_sb_info *,
152 const char *); 152 const char *);
153extern int cifs_umount(struct super_block *, struct cifs_sb_info *); 153extern int cifs_umount(struct super_block *, struct cifs_sb_info *);
154extern void cifs_dfs_release_automount_timer(void); 154extern void cifs_dfs_release_automount_timer(void);
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 3e20831119a9..da284e3cb653 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2842,7 +2842,7 @@ expand_dfs_referral(int xid, struct cifsSesInfo *pSesInfo,
2842 2842
2843int 2843int
2844cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, 2844cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2845 char *mount_data_global, const char *devname) 2845 const char *devname)
2846{ 2846{
2847 int rc; 2847 int rc;
2848 int xid; 2848 int xid;
@@ -2851,13 +2851,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2851 struct cifsTconInfo *tcon; 2851 struct cifsTconInfo *tcon;
2852 struct TCP_Server_Info *srvTcp; 2852 struct TCP_Server_Info *srvTcp;
2853 char *full_path; 2853 char *full_path;
2854 char *mount_data = mount_data_global;
2855 struct tcon_link *tlink; 2854 struct tcon_link *tlink;
2856#ifdef CONFIG_CIFS_DFS_UPCALL 2855#ifdef CONFIG_CIFS_DFS_UPCALL
2857 int referral_walks_count = 0; 2856 int referral_walks_count = 0;
2858try_mount_again: 2857try_mount_again:
2859 mount_data = cifs_sb->mountdata;
2860
2861 /* cleanup activities if we're chasing a referral */ 2858 /* cleanup activities if we're chasing a referral */
2862 if (referral_walks_count) { 2859 if (referral_walks_count) {
2863 if (tcon) 2860 if (tcon)
@@ -2884,7 +2881,8 @@ try_mount_again:
2884 goto out; 2881 goto out;
2885 } 2882 }
2886 2883
2887 if (cifs_parse_mount_options(mount_data, devname, volume_info)) { 2884 if (cifs_parse_mount_options(cifs_sb->mountdata, devname,
2885 volume_info)) {
2888 rc = -EINVAL; 2886 rc = -EINVAL;
2889 goto out; 2887 goto out;
2890 } 2888 }