Commit f14bcf71 authored by Sean Finney's avatar Sean Finney Committed by Steve French

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: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSean Finney <seanius@seanius.net>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 5167f11e
...@@ -58,9 +58,7 @@ struct cifs_sb_info { ...@@ -58,9 +58,7 @@ struct cifs_sb_info {
unsigned int mnt_cifs_flags; unsigned int mnt_cifs_flags;
int prepathlen; int prepathlen;
char *prepath; /* relative path under the share to mount to */ char *prepath; /* relative path under the share to mount to */
#ifdef CONFIG_CIFS_DFS_UPCALL char *mountdata; /* options received at mount time or via DFS refs */
char *mountdata; /* mount options received at mount time */
#endif
struct backing_dev_info bdi; struct backing_dev_info bdi;
struct delayed_work prune_tlinks; struct delayed_work prune_tlinks;
}; };
......
...@@ -128,7 +128,6 @@ cifs_read_super(struct super_block *sb, void *data, ...@@ -128,7 +128,6 @@ cifs_read_super(struct super_block *sb, void *data,
} }
cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages; cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages;
#ifdef CONFIG_CIFS_DFS_UPCALL
/* /*
* Copy mount params to sb for use in submounts. Better to do * Copy mount params to sb for use in submounts. Better to do
* the copy here and deal with the error before cleanup gets * 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,9 +142,8 @@ cifs_read_super(struct super_block *sb, void *data,
return -ENOMEM; return -ENOMEM;
} }
} }
#endif
rc = cifs_mount(sb, cifs_sb, data, devname); rc = cifs_mount(sb, cifs_sb, devname);
if (rc) { if (rc) {
if (!silent) if (!silent)
...@@ -197,12 +195,10 @@ cifs_read_super(struct super_block *sb, void *data, ...@@ -197,12 +195,10 @@ cifs_read_super(struct super_block *sb, void *data,
out_mount_failed: out_mount_failed:
if (cifs_sb) { if (cifs_sb) {
#ifdef CONFIG_CIFS_DFS_UPCALL
if (cifs_sb->mountdata) { if (cifs_sb->mountdata) {
kfree(cifs_sb->mountdata); kfree(cifs_sb->mountdata);
cifs_sb->mountdata = NULL; cifs_sb->mountdata = NULL;
} }
#endif
unload_nls(cifs_sb->local_nls); unload_nls(cifs_sb->local_nls);
bdi_destroy(&cifs_sb->bdi); bdi_destroy(&cifs_sb->bdi);
kfree(cifs_sb); kfree(cifs_sb);
...@@ -226,12 +222,10 @@ cifs_put_super(struct super_block *sb) ...@@ -226,12 +222,10 @@ cifs_put_super(struct super_block *sb)
rc = cifs_umount(sb, cifs_sb); rc = cifs_umount(sb, cifs_sb);
if (rc) if (rc)
cERROR(1, "cifs_umount failed with return code %d", rc); cERROR(1, "cifs_umount failed with return code %d", rc);
#ifdef CONFIG_CIFS_DFS_UPCALL
if (cifs_sb->mountdata) { if (cifs_sb->mountdata) {
kfree(cifs_sb->mountdata); kfree(cifs_sb->mountdata);
cifs_sb->mountdata = NULL; cifs_sb->mountdata = NULL;
} }
#endif
unload_nls(cifs_sb->local_nls); unload_nls(cifs_sb->local_nls);
bdi_destroy(&cifs_sb->bdi); bdi_destroy(&cifs_sb->bdi);
......
...@@ -148,7 +148,7 @@ extern struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *, struct inode *, ...@@ -148,7 +148,7 @@ extern struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *, struct inode *,
extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *, extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *,
const char *); const char *);
extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, extern int cifs_mount(struct super_block *, struct cifs_sb_info *,
const char *); const char *);
extern int cifs_umount(struct super_block *, struct cifs_sb_info *); extern int cifs_umount(struct super_block *, struct cifs_sb_info *);
extern void cifs_dfs_release_automount_timer(void); extern void cifs_dfs_release_automount_timer(void);
......
...@@ -2842,7 +2842,7 @@ expand_dfs_referral(int xid, struct cifsSesInfo *pSesInfo, ...@@ -2842,7 +2842,7 @@ expand_dfs_referral(int xid, struct cifsSesInfo *pSesInfo,
int int
cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
char *mount_data_global, const char *devname) const char *devname)
{ {
int rc; int rc;
int xid; int xid;
...@@ -2851,13 +2851,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, ...@@ -2851,13 +2851,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
struct cifsTconInfo *tcon; struct cifsTconInfo *tcon;
struct TCP_Server_Info *srvTcp; struct TCP_Server_Info *srvTcp;
char *full_path; char *full_path;
char *mount_data = mount_data_global;
struct tcon_link *tlink; struct tcon_link *tlink;
#ifdef CONFIG_CIFS_DFS_UPCALL #ifdef CONFIG_CIFS_DFS_UPCALL
int referral_walks_count = 0; int referral_walks_count = 0;
try_mount_again: try_mount_again:
mount_data = cifs_sb->mountdata;
/* cleanup activities if we're chasing a referral */ /* cleanup activities if we're chasing a referral */
if (referral_walks_count) { if (referral_walks_count) {
if (tcon) if (tcon)
...@@ -2884,7 +2881,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, ...@@ -2884,7 +2881,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
goto out; goto out;
} }
if (cifs_parse_mount_options(mount_data, devname, volume_info)) { if (cifs_parse_mount_options(cifs_sb->mountdata, devname,
volume_info)) {
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
} }
......
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