summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2020-12-09 23:07:12 -0600
committerSteve French <stfrench@microsoft.com>2020-12-13 19:12:07 -0600
commit3fa1c6d1b8f5c3d9be9e8047ad894ab3de67dc6e (patch)
tree006d36acb9e3e759c9d6323769e486da106dc8f6
parent7955f105afb6034af344038d663bc98809483cdd (diff)
downloadlinux-3fa1c6d1b8f5c3d9be9e8047ad894ab3de67dc6e.tar.gz
linux-3fa1c6d1b8f5c3d9be9e8047ad894ab3de67dc6e.tar.bz2
linux-3fa1c6d1b8f5c3d9be9e8047ad894ab3de67dc6e.zip
cifs: rename smb_vol as smb3_fs_context and move it to fs_context.h
Harmonize and change all such variables to 'ctx', where possible. No changes to actual logic. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/cifs/cifsfs.c25
-rw-r--r--fs/cifs/cifsglob.h99
-rw-r--r--fs/cifs/cifsproto.h24
-rw-r--r--fs/cifs/connect.c960
-rw-r--r--fs/cifs/dfs_cache.c83
-rw-r--r--fs/cifs/dfs_cache.h2
-rw-r--r--fs/cifs/dir.c7
-rw-r--r--fs/cifs/fs_context.c102
-rw-r--r--fs/cifs/fs_context.h105
-rw-r--r--fs/cifs/sess.c51
-rw-r--r--fs/cifs/smb1ops.c11
-rw-r--r--fs/cifs/smb2ops.c17
12 files changed, 750 insertions, 736 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 472cb7777e3e..9fb85fcff6ae 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -55,6 +55,7 @@
#ifdef CONFIG_CIFS_DFS_UPCALL
#include "dfs_cache.h"
#endif
+#include "fs_context.h"
/*
* DOS dates from 1980/1/1 through 2107/12/31
@@ -720,7 +721,7 @@ static const struct super_operations cifs_super_ops = {
* Return dentry with refcount + 1 on success and NULL otherwise.
*/
static struct dentry *
-cifs_get_root(struct smb_vol *vol, struct super_block *sb)
+cifs_get_root(struct smb3_fs_context *ctx, struct super_block *sb)
{
struct dentry *dentry;
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
@@ -731,7 +732,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH)
return dget(sb->s_root);
- full_path = cifs_build_path_to_root(vol, cifs_sb,
+ full_path = cifs_build_path_to_root(ctx, cifs_sb,
cifs_sb_master_tcon(cifs_sb), 0);
if (full_path == NULL)
return ERR_PTR(-ENOMEM);
@@ -784,7 +785,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
int rc;
struct super_block *sb;
struct cifs_sb_info *cifs_sb;
- struct smb_vol *volume_info;
+ struct smb3_fs_context *ctx;
struct cifs_mnt_data mnt_data;
struct dentry *root;
@@ -797,9 +798,9 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
else
cifs_info("Attempting to mount %s\n", dev_name);
- volume_info = cifs_get_volume_info((char *)data, dev_name, is_smb3);
- if (IS_ERR(volume_info))
- return ERR_CAST(volume_info);
+ ctx = cifs_get_volume_info((char *)data, dev_name, is_smb3);
+ if (IS_ERR(ctx))
+ return ERR_CAST(ctx);
cifs_sb = kzalloc(sizeof(struct cifs_sb_info), GFP_KERNEL);
if (cifs_sb == NULL) {
@@ -813,13 +814,13 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
goto out_free;
}
- rc = cifs_setup_cifs_sb(volume_info, cifs_sb);
+ rc = cifs_setup_cifs_sb(ctx, cifs_sb);
if (rc) {
root = ERR_PTR(rc);
goto out_free;
}
- rc = cifs_mount(cifs_sb, volume_info);
+ rc = cifs_mount(cifs_sb, ctx);
if (rc) {
if (!(flags & SB_SILENT))
cifs_dbg(VFS, "cifs_mount failed w/return code = %d\n",
@@ -828,7 +829,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
goto out_free;
}
- mnt_data.vol = volume_info;
+ mnt_data.ctx = ctx;
mnt_data.cifs_sb = cifs_sb;
mnt_data.flags = flags;
@@ -855,7 +856,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
sb->s_flags |= SB_ACTIVE;
}
- root = cifs_get_root(volume_info, sb);
+ root = cifs_get_root(ctx, sb);
if (IS_ERR(root))
goto out_super;
@@ -865,7 +866,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
out_super:
deactivate_locked_super(sb);
out:
- cifs_cleanup_volume_info(volume_info);
+ cifs_cleanup_volume_info(ctx);
return root;
out_free:
@@ -873,7 +874,7 @@ out_free:
kfree(cifs_sb->mountdata);
kfree(cifs_sb);
out_nls:
- unload_nls(volume_info->local_nls);
+ unload_nls(ctx->local_nls);
goto out;
}
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 484ec2d8c5c9..b46809260e79 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -202,7 +202,7 @@ struct cifs_ses;
struct cifs_tcon;
struct dfs_info3_param;
struct cifs_fattr;
-struct smb_vol;
+struct smb3_fs_context;
struct cifs_fid;
struct cifs_readdata;
struct cifs_writedata;
@@ -268,9 +268,9 @@ struct smb_version_operations {
/* negotiate to the server */
int (*negotiate)(const unsigned int, struct cifs_ses *);
/* set negotiated write size */
- unsigned int (*negotiate_wsize)(struct cifs_tcon *, struct smb_vol *);
+ unsigned int (*negotiate_wsize)(struct cifs_tcon *tcon, struct smb3_fs_context *ctx);
/* set negotiated read size */
- unsigned int (*negotiate_rsize)(struct cifs_tcon *, struct smb_vol *);
+ unsigned int (*negotiate_rsize)(struct cifs_tcon *tcon, struct smb3_fs_context *ctx);
/* setup smb sessionn */
int (*sess_setup)(const unsigned int, struct cifs_ses *,
const struct nls_table *);
@@ -530,97 +530,6 @@ struct smb_version_values {
#define HEADER_SIZE(server) (server->vals->header_size)
#define MAX_HEADER_SIZE(server) (server->vals->max_header_size)
-struct smb_vol {
- char *username;
- char *password;
- char *domainname;
- char *UNC;
- char *iocharset; /* local code page for mapping to and from Unicode */
- char source_rfc1001_name[RFC1001_NAME_LEN_WITH_NULL]; /* clnt nb name */
- char target_rfc1001_name[RFC1001_NAME_LEN_WITH_NULL]; /* srvr nb name */
- kuid_t cred_uid;
- kuid_t linux_uid;
- kgid_t linux_gid;
- kuid_t backupuid;
- kgid_t backupgid;
- umode_t file_mode;
- umode_t dir_mode;
- enum securityEnum sectype; /* sectype requested via mnt opts */
- bool sign; /* was signing requested via mnt opts? */
- bool ignore_signature:1;
- bool retry:1;
- bool intr:1;
- bool setuids:1;
- bool setuidfromacl:1;
- bool override_uid:1;
- bool override_gid:1;
- bool dynperm:1;
- bool noperm:1;
- bool nodelete:1;
- bool mode_ace:1;
- bool no_psx_acl:1; /* set if posix acl support should be disabled */
- bool cifs_acl:1;
- bool backupuid_specified; /* mount option backupuid is specified */
- bool backupgid_specified; /* mount option backupgid is specified */
- bool no_xattr:1; /* set if xattr (EA) support should be disabled*/
- bool server_ino:1; /* use inode numbers from server ie UniqueId */
- bool direct_io:1;
- bool strict_io:1; /* strict cache behavior */
- bool cache_ro:1;
- bool cache_rw:1;
- bool remap:1; /* set to remap seven reserved chars in filenames */
- bool sfu_remap:1; /* remap seven reserved chars ala SFU */
- bool posix_paths:1; /* unset to not ask for posix pathnames. */
- bool no_linux_ext:1;
- bool linux_ext:1;
- bool sfu_emul:1;
- bool nullauth:1; /* attempt to authenticate with null user */
- bool nocase:1; /* request case insensitive filenames */
- bool nobrl:1; /* disable sending byte range locks to srv */
- bool nohandlecache:1; /* disable caching dir handles if srvr probs */
- bool mand_lock:1; /* send mandatory not posix byte range lock reqs */
- bool seal:1; /* request transport encryption on share */
- bool nodfs:1; /* Do not request DFS, even if available */
- bool local_lease:1; /* check leases only on local system, not remote */
- bool noblocksnd:1;
- bool noautotune:1;
- bool nostrictsync:1; /* do not force expensive SMBflush on every sync */
- bool no_lease:1; /* disable requesting leases */
- bool fsc:1; /* enable fscache */
- bool mfsymlinks:1; /* use Minshall+French Symlinks */
- bool multiuser:1;
- bool rwpidforward:1; /* pid forward for read/write operations */
- bool nosharesock:1;
- bool persistent:1;
- bool nopersistent:1;
- bool resilient:1; /* noresilient not required since not fored for CA */
- bool domainauto:1;
- bool rdma:1;
- bool multichannel:1;
- bool use_client_guid:1;
- /* reuse existing guid for multichannel */
- u8 client_guid[SMB2_CLIENT_GUID_SIZE];
- unsigned int bsize;
- unsigned int rsize;
- unsigned int wsize;
- unsigned int min_offload;
- bool sockopt_tcp_nodelay:1;
- unsigned long actimeo; /* attribute cache timeout (jiffies) */
- struct smb_version_operations *ops;
- struct smb_version_values *vals;
- char *prepath;
- struct sockaddr_storage dstaddr; /* destination address */
- struct sockaddr_storage srcaddr; /* allow binding to a local IP */
- struct nls_table *local_nls;
- unsigned int echo_interval; /* echo interval in secs */
- __u64 snapshot_time; /* needed for timewarp tokens */
- __u32 handle_timeout; /* persistent and durable handle timeout in ms */
- unsigned int max_credits; /* smb3 max_credits 10 < credits < 60000 */
- unsigned int max_channels;
- __u16 compression; /* compression algorithm 0xFFFF default 0=disabled */
- bool rootfs:1; /* if it's a SMB root file system */
-};
-
/**
* CIFS superblock mount flags (mnt_cifs_flags) to consider when
* trying to reuse existing superblock for a new mount
@@ -649,7 +558,7 @@ struct smb_vol {
struct cifs_mnt_data {
struct cifs_sb_info *cifs_sb;
- struct smb_vol *vol;
+ struct smb3_fs_context *ctx;
int flags;
};
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 2ed98d4a30c1..e891a4f421a6 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -27,8 +27,8 @@
#endif
struct statfs;
-struct smb_vol;
struct smb_rqst;
+struct smb3_fs_context;
/*
*****************************************************************
@@ -72,7 +72,7 @@ extern void exit_cifs_spnego(void);
extern char *build_path_from_dentry(struct dentry *);
extern char *build_path_from_dentry_optional_prefix(struct dentry *direntry,
bool prefix);
-extern char *cifs_build_path_to_root(struct smb_vol *vol,
+extern char *cifs_build_path_to_root(struct smb3_fs_context *ctx,
struct cifs_sb_info *cifs_sb,
struct cifs_tcon *tcon,
int add_treename);
@@ -234,13 +234,13 @@ extern int cifs_read_page_from_socket(struct TCP_Server_Info *server,
struct page *page,
unsigned int page_offset,
unsigned int to_read);
-extern int cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
+extern int cifs_setup_cifs_sb(struct smb3_fs_context *ctx,
struct cifs_sb_info *cifs_sb);
extern int cifs_match_super(struct super_block *, void *);
-extern void cifs_cleanup_volume_info(struct smb_vol *pvolume_info);
-extern struct smb_vol *cifs_get_volume_info(char *mount_data,
+extern void cifs_cleanup_volume_info(struct smb3_fs_context *ctx);
+extern struct smb3_fs_context *cifs_get_volume_info(char *mount_data,
const char *devname, bool is_smb3);
-extern int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol);
+extern int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx);
extern void cifs_umount(struct cifs_sb_info *);
extern void cifs_mark_open_files_invalid(struct cifs_tcon *tcon);
extern void cifs_reopen_persistent_handles(struct cifs_tcon *tcon);
@@ -256,7 +256,7 @@ extern void cifs_add_pending_open_locked(struct cifs_fid *fid,
struct tcon_link *tlink,
struct cifs_pending_open *open);
extern void cifs_del_pending_open(struct cifs_pending_open *open);
-extern struct TCP_Server_Info *cifs_get_tcp_session(struct smb_vol *vol);
+extern struct TCP_Server_Info *cifs_get_tcp_session(struct smb3_fs_context *ctx);
extern void cifs_put_tcp_session(struct TCP_Server_Info *server,
int from_reconnect);
extern void cifs_put_tcon(struct cifs_tcon *tcon);
@@ -332,7 +332,7 @@ extern int parse_dfs_referrals(struct get_dfs_referral_rsp *rsp, u32 rsp_size,
const char *searchName, bool is_unicode);
extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
struct cifs_sb_info *cifs_sb,
- struct smb_vol *vol);
+ struct smb3_fs_context *ctx);
extern int CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
struct kstatfs *FSData);
extern int SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
@@ -553,18 +553,18 @@ extern int SMBencrypt(unsigned char *passwd, const unsigned char *c8,
unsigned char *p24);
extern int
-cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
+cifs_setup_volume_info(struct smb3_fs_context *ctx, char *mount_data,
const char *devname, bool is_smb3);
extern void
-cifs_cleanup_volume_info_contents(struct smb_vol *volume_info);
+cifs_cleanup_volume_info_contents(struct smb3_fs_context *ctx);
extern struct TCP_Server_Info *
-cifs_find_tcp_session(struct smb_vol *vol);
+cifs_find_tcp_session(struct smb3_fs_context *ctx);
extern void cifs_put_smb_ses(struct cifs_ses *ses);
extern struct cifs_ses *
-cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info);
+cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx);
void cifs_readdata_release(struct kref *refcount);
int cifs_async_readv(struct cifs_readdata *rdata);
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 44f9cce57099..fedb904b516f 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1320,7 +1320,7 @@ static int get_option_gid(substring_t args[], kgid_t *result)
* fields with the result. Returns 0 on success and an error otherwise.
*/
static int
-cifs_parse_devname(const char *devname, struct smb_vol *vol)
+cifs_parse_devname(const char *devname, struct smb3_fs_context *ctx)
{
char *pos;
const char *delims = "/\\";
@@ -1349,11 +1349,11 @@ cifs_parse_devname(const char *devname, struct smb_vol *vol)
/* move "pos" up to delimiter or NULL */
pos += len;
- vol->UNC = kstrndup(devname, pos - devname, GFP_KERNEL);
- if (!vol->UNC)
+ ctx->UNC = kstrndup(devname, pos - devname, GFP_KERNEL);
+ if (!ctx->UNC)
return -ENOMEM;
- convert_delimiter(vol->UNC, '\\');
+ convert_delimiter(ctx->UNC, '\\');
/* skip any delimiter */
if (*pos == '/' || *pos == '\\')
@@ -1363,8 +1363,8 @@ cifs_parse_devname(const char *devname, struct smb_vol *vol)
if (!*pos)
return 0;
- vol->prepath = kstrdup(pos, GFP_KERNEL);
- if (!vol->prepath)
+ ctx->prepath = kstrdup(pos, GFP_KERNEL);
+ if (!ctx->prepath)
return -ENOMEM;
return 0;
@@ -1372,7 +1372,7 @@ cifs_parse_devname(const char *devname, struct smb_vol *vol)
static int
cifs_parse_mount_options(const char *mountdata, const char *devname,
- struct smb_vol *vol, bool is_smb3)
+ struct smb3_fs_context *ctx, bool is_smb3)
{
char *data, *end;
char *mountdata_copy = NULL, *options;
@@ -1391,66 +1391,66 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
bool got_ip = false;
bool got_version = false;
unsigned short port = 0;
- struct sockaddr *dstaddr = (struct sockaddr *)&vol->dstaddr;
+ struct sockaddr *dstaddr = (struct sockaddr *)&ctx->dstaddr;
separator[0] = ',';
separator[1] = 0;
delim = separator[0];
- /* ensure we always start with zeroed-out smb_vol */
- memset(vol, 0, sizeof(*vol));
+ /* ensure we always start with zeroed-out ctx */
+ memset(ctx, 0, sizeof(*ctx));
/*
* does not have to be perfect mapping since field is
* informational, only used for servers that do not support
* port 445 and it can be overridden at mount time
*/
- memset(vol->source_rfc1001_name, 0x20, RFC1001_NAME_LEN);
+ memset(ctx->source_rfc1001_name, 0x20, RFC1001_NAME_LEN);
for (i = 0; i < strnlen(nodename, RFC1001_NAME_LEN); i++)
- vol->source_rfc1001_name[i] = toupper(nodename[i]);
+ ctx->source_rfc1001_name[i] = toupper(nodename[i]);
- vol->source_rfc1001_name[RFC1001_NAME_LEN] = 0;
+ ctx->source_rfc1001_name[RFC1001_NAME_LEN] = 0;
/* null target name indicates to use *SMBSERVR default called name
if we end up sending RFC1001 session initialize */
- vol->target_rfc1001_name[0] = 0;
- vol->cred_uid = current_uid();
- vol->linux_uid = current_uid();
- vol->linux_gid = current_gid();
- vol->bsize = 1024 * 1024; /* can improve cp performance significantly */
+ ctx->target_rfc1001_name[0] = 0;
+ ctx->cred_uid = current_uid();
+ ctx->linux_uid = current_uid();
+ ctx->linux_gid = current_gid();
+ ctx->bsize = 1024 * 1024; /* can improve cp performance significantly */
/*
* default to SFM style remapping of seven reserved characters
* unless user overrides it or we negotiate CIFS POSIX where
* it is unnecessary. Can not simultaneously use more than one mapping
* since then readdir could list files that open could not open
*/
- vol->remap = true;
+ ctx->remap = true;
/* default to only allowing write access to owner of the mount */
- vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR;
+ ctx->dir_mode = ctx->file_mode = S_IRUGO | S_IXUGO | S_IWUSR;
- /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */
+ /* ctx->retry default is 0 (i.e. "soft" limited retry not hard retry) */
/* default is always to request posix paths. */
- vol->posix_paths = 1;
+ ctx->posix_paths = 1;
/* default to using server inode numbers where available */
- vol->server_ino = 1;
+ ctx->server_ino = 1;
/* default is to use strict cifs caching semantics */
- vol->strict_io = true;
+ ctx->strict_io = true;
- vol->actimeo = CIFS_DEF_ACTIMEO;
+ ctx->actimeo = CIFS_DEF_ACTIMEO;
/* Most clients set timeout to 0, allows server to use its default */
- vol->handle_timeout = 0; /* See MS-SMB2 spec section 2.2.14.2.12 */
+ ctx->handle_timeout = 0; /* See MS-SMB2 spec section 2.2.14.2.12 */
/* offer SMB2.1 and later (SMB3 etc). Secure and widely accepted */
- vol->ops = &smb30_operations;
- vol->vals = &smbdefault_values;
+ ctx->ops = &smb30_operations;
+ ctx->vals = &smbdefault_values;
- vol->echo_interval = SMB_ECHO_INTERVAL_DEFAULT;
+ ctx->echo_interval = SMB_ECHO_INTERVAL_DEFAULT;
/* default to no multichannel (single server connection) */
- vol->multichannel = false;
- vol->max_channels = 1;
+ ctx->multichannel = false;
+ ctx->max_channels = 1;
if (!mountdata)
goto cifs_parse_mount_err;
@@ -1470,10 +1470,10 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
cifs_dbg(FYI, "Null separator not allowed\n");
}
}
- vol->backupuid_specified = false; /* no backup intent for a user */
- vol->backupgid_specified = false; /* no backup intent for a group */
+ ctx->backupuid_specified = false; /* no backup intent for a user */
+ ctx->backupgid_specified = false; /* no backup intent for a group */
- switch (cifs_parse_devname(devname, vol)) {
+ switch (cifs_parse_devname(devname, ctx)) {
case 0:
break;
case -ENOMEM:
@@ -1505,10 +1505,10 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
/* Boolean values */
case Opt_user_xattr:
- vol->no_xattr = 0;
+ ctx->no_xattr = 0;
break;
case Opt_nouser_xattr:
- vol->no_xattr = 1;
+ ctx->no_xattr = 1;
break;
case Opt_forceuid:
override_uid = 1;
@@ -1523,175 +1523,175 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
override_gid = 0;
break;
case Opt_noblocksend:
- vol->noblocksnd = 1;
+ ctx->noblocksnd = 1;
break;
case Opt_noautotune:
- vol->noautotune = 1;
+ ctx->noautotune = 1;
break;
case Opt_nolease:
- vol->no_lease = 1;
+ ctx->no_lease = 1;
break;
case Opt_hard:
- vol->retry = 1;
+ ctx->retry = 1;
break;
case Opt_soft:
- vol->retry = 0;
+ ctx->retry = 0;
break;
case Opt_perm:
- vol->noperm = 0;
+ ctx->noperm = 0;
break;
case Opt_noperm:
- vol->noperm = 1;
+ ctx->noperm = 1;
break;
case Opt_nodelete:
- vol->nodelete = 1;
+ ctx->nodelete = 1;
break;
case Opt_mapchars:
- vol->sfu_remap = true;
- vol->remap = false; /* disable SFM mapping */
+ ctx->sfu_remap = true;
+ ctx->remap = false; /* disable SFM mapping */
break;
case Opt_nomapchars:
- vol->sfu_remap = false;
+ ctx->sfu_remap = false;
break;
case Opt_mapposix:
- vol->remap = true;
- vol->sfu_remap = false; /* disable SFU mapping */
+ ctx->remap = true;
+ ctx->sfu_remap = false; /* disable SFU mapping */
break;
case Opt_nomapposix:
- vol->remap = false;
+ ctx->remap = false;
break;
case Opt_sfu:
- vol->sfu_emul = 1;
+ ctx->sfu_emul = 1;
break;
case Opt_nosfu:
- vol->sfu_emul = 0;
+ ctx->sfu_emul = 0;
break;
case Opt_nodfs:
- vol->nodfs = 1;
+ ctx->nodfs = 1;
break;
case Opt_rootfs:
#ifdef CONFIG_CIFS_ROOT
- vol->rootfs = true;
+ ctx->rootfs = true;
#endif
break;
case Opt_posixpaths:
- vol->posix_paths = 1;
+ ctx->posix_paths = 1;
break;
case Opt_noposixpaths:
- vol->posix_paths = 0;
+ ctx->posix_paths = 0;
break;
case Opt_nounix:
- if (vol->linux_ext)
+ if (ctx->linux_ext)
cifs_dbg(VFS,
"conflicting unix mount options\n");
- vol->no_linux_ext = 1;
+ ctx->no_linux_ext = 1;
break;
case Opt_unix:
- if (vol->no_linux_ext)
+ if (ctx->no_linux_ext)
cifs_dbg(VFS,
"conflicting unix mount options\n");
- vol->linux_ext = 1;
+ ctx->linux_ext = 1;
break;
case Opt_nocase:
- vol->nocase = 1;
+ ctx->nocase = 1;
break;
case Opt_brl:
- vol->nobrl = 0;
+ ctx->nobrl = 0;
break;
case Opt_nobrl:
- vol->nobrl = 1;
+ ctx->nobrl = 1;
/*
* turn off mandatory locking in mode
* if remote locking is turned off since the
* local vfs will do advisory
*/
- if (vol->file_mode ==
+ if (ctx->file_mode ==
(S_IALLUGO & ~(S_ISUID | S_IXGRP)))
- vol->file_mode = S_IALLUGO;
+ ctx->file_mode = S_IALLUGO;
break;
case Opt_nohandlecache:
- vol->nohandlecache = 1;
+ ctx->nohandlecache = 1;
break;
case Opt_handlecache:
- vol->nohandlecache = 0;
+ ctx->nohandlecache = 0;
break;
case Opt_forcemandatorylock:
- vol->mand_lock = 1;
+ ctx->mand_lock = 1;
break;
case Opt_setuids:
- vol->setuids = 1;
+ ctx->setuids = 1;
break;
case Opt_nosetuids:
- vol->setuids = 0;
+ ctx->setuids = 0;
break;
case Opt_setuidfromacl:
- vol->setuidfromacl = 1;
+ ctx->setuidfromacl = 1;
break;
case Opt_dynperm:
- vol->dynperm = true;
+ ctx->dynperm = true;
break;
case Opt_nodynperm:
- vol->dynperm = false;
+ ctx->dynperm = false;
break;
case Opt_nohard:
- vol->retry = 0;
+ ctx->retry = 0;
break;
case Opt_nosoft:
- vol->retry = 1;
+ ctx->retry = 1;
break;
case Opt_nointr:
- vol->intr = 0;
+ ctx->intr = 0;
break;
case Opt_intr:
- vol->intr = 1;
+ ctx->intr = 1;
break;
case Opt_nostrictsync:
- vol->nostrictsync = 1;
+ ctx->nostrictsync = 1;
break;
case Opt_strictsync:
- vol->nostrictsync = 0;
+ ctx->nostrictsync = 0;
break;
case Opt_serverino:
- vol->server_ino = 1;
+ ctx->server_ino = 1;
break;
case Opt_noserverino:
- vol->server_ino = 0;
+ ctx->server_ino = 0;
break;
case Opt_rwpidforward:
- vol->rwpidforward = 1;
+ ctx->rwpidforward = 1;
break;
case Opt_modesid:
- vol->mode_ace = 1;
+ ctx->mode_ace = 1;
break;
case Opt_cifsacl:
- vol->cifs_acl = 1;
+ ctx->cifs_acl = 1;
break;
case Opt_nocifsacl:
- vol->cifs_acl = 0;
+ ctx->cifs_acl = 0;
break;
case Opt_acl:
- vol->no_psx_acl = 0;
+ ctx->no_psx_acl = 0;
break;
case Opt_noacl:
- vol->no_psx_acl = 1;
+ ctx->no_psx_acl = 1;
break;
case Opt_locallease:
- vol->local_lease = 1;
+ ctx->local_lease = 1;
break;
case Opt_sign:
- vol->sign = true;
+ ctx->sign = true;
break;
case Opt_ignore_signature:
- vol->sign = true;
- vol->ignore_signature = true;
+ ctx->sign = true;
+ ctx->ignore_signature = true;
break;
case Opt_seal:
/* we do not do the following in secFlags because seal
* is a per tree connection (mount) not a per socket
* or per-smb connection option in the protocol
- * vol->secFlg |= CIFSSEC_MUST_SEAL;
+ * ctx->secFlg |= CIFSSEC_MUST_SEAL;
*/
- vol->seal = 1;
+ ctx->seal = 1;
break;
case Opt_noac:
pr_warn("Mount option noac not supported. Instead set /proc/fs/cifs/LookupCacheEnabled to 0\n");
@@ -1701,88 +1701,88 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
cifs_dbg(VFS, "FS-Cache support needs CONFIG_CIFS_FSCACHE kernel config option set\n");
goto cifs_parse_mount_err;
#endif
- vol->fsc = true;
+ ctx->fsc = true;
break;
case Opt_mfsymlinks:
- vol->mfsymlinks = true;
+ ctx->mfsymlinks = true;
break;
case Opt_multiuser:
- vol->multiuser = true;
+ ctx->multiuser = true;
break;
case Opt_sloppy:
sloppy = true;
break;
case Opt_nosharesock:
- vol->nosharesock = true;
+ ctx->nosharesock = true;
break;
case Opt_nopersistent:
- vol->nopersistent = true;
- if (vol->persistent) {
+ ctx->nopersistent = true;
+ if (ctx->persistent) {
cifs_dbg(VFS,
"persistenthandles mount options conflict\n");
goto cifs_parse_mount_err;
}
break;
case Opt_persistent:
- vol->persistent = true;
- if ((vol->nopersistent) || (vol->resilient)) {
+ ctx->persistent = true;
+ if ((ctx->nopersistent) || (ctx->resilient)) {
cifs_dbg(VFS,
"persistenthandles mount options conflict\n");
goto cifs_parse_mount_err;
}
break;
case Opt_resilient:
- vol->resilient = true;
- if (vol->persistent) {
+ ctx->resilient = true;
+ if (ctx->persistent) {
cifs_dbg(VFS,
"persistenthandles mount options conflict\n");
goto cifs_parse_mount_err;
}
break;
case Opt_noresilient:
- vol->resilient = false; /* already the default */
+ ctx->resilient = false; /* already the default */
break;
case Opt_domainauto:
- vol->domainauto = true;
+ ctx->domainauto = true;
break;
case Opt_rdma:
- vol->rdma = true;
+ ctx->rdma = true;
break;
case Opt_multichannel:
- vol->multichannel = true;
+ ctx->multichannel = true;
/* if number of channels not specified, default to 2 */
- if (vol->max_channels < 2)
- vol->max_channels = 2;
+ if (ctx->max_channels < 2)
+ ctx->max_channels = 2;
break;
case Opt_nomultichannel:
- vol->multichannel = false;
- vol->max_channels = 1;
+ ctx->multichannel = false;
+ ctx->max_channels = 1;
break;
case Opt_compress:
- vol->compression = UNKNOWN_TYPE;
+ ctx->compression = UNKNOWN_TYPE;
cifs_dbg(VFS,
"SMB3 compression support is experimental\n");
break;
/* Numeric Values */
case Opt_backupuid:
- if (get_option_uid(args, &vol->backupuid)) {
+ if (get_option_uid(args, &ctx->backupuid)) {
cifs_dbg(VFS, "%s: Invalid backupuid value\n",
__func__);
goto cifs_parse_mount_err;
}
- vol->backupuid_specified = true;
+ ctx->backupuid_specified = true;
break;
case Opt_backupgid:
- if (get_option_gid(args, &vol->backupgid)) {
+ if (get_option_gid(args, &ctx->backupgid)) {
cifs_dbg(VFS, "%s: Invalid backupgid value\n",
__func__);
goto cifs_parse_mount_err;
}
- vol->backupgid_specified = true;
+ ctx->backupgid_specified = true;
break;
case Opt_uid:
- if (get_option_uid(args, &vol->linux_uid)) {
+ if (get_option_uid(args, &ctx->linux_uid)) {
cifs_dbg(VFS, "%s: Invalid uid value\n",
__func__);
goto cifs_parse_mount_err;
@@ -1790,14 +1790,14 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
uid_specified = true;
break;
case Opt_cruid:
- if (get_option_uid(args, &vol->cred_uid)) {
+ if (get_option_uid(args, &ctx->cred_uid)) {
cifs_dbg(VFS, "%s: Invalid cruid value\n",
__func__);
goto cifs_parse_mount_err;
}
break;
case Opt_gid:
- if (get_option_gid(args, &vol->linux_gid)) {
+ if (get_option_gid(args, &ctx->linux_gid)) {
cifs_dbg(VFS, "%s: Invalid gid value\n",
__func__);
goto cifs_parse_mount_err;
@@ -1810,7 +1810,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->file_mode = option;
+ ctx->file_mode = option;
break;
case Opt_dirmode:
if (get_option_ul(args, &option)) {
@@ -1818,7 +1818,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->dir_mode = option;
+ ctx->dir_mode = option;
break;
case Opt_port:
if (get_option_ul(args, &option) ||
@@ -1834,7 +1834,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
cifs_dbg(VFS, "Invalid minimum encrypted read offload size (esize)\n");
goto cifs_parse_mount_err;
}
- vol->min_offload = option;
+ ctx->min_offload = option;
break;
case Opt_blocksize:
if (get_option_ul(args, &option)) {
@@ -1854,7 +1854,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->bsize = option;
+ ctx->bsize = option;
break;
case Opt_rsize:
if (get_option_ul(args, &option)) {
@@ -1862,7 +1862,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->rsize = option;
+ ctx->rsize = option;
break;
case Opt_wsize:
if (get_option_ul(args, &option)) {
@@ -1870,7 +1870,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->wsize = option;
+ ctx->wsize = option;
break;
case Opt_actimeo:
if (get_option_ul(args, &option)) {
@@ -1878,8 +1878,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->actimeo = HZ * option;
- if (vol->actimeo > CIFS_MAX_ACTIMEO) {
+ ctx->actimeo = HZ * option;
+ if (ctx->actimeo > CIFS_MAX_ACTIMEO) {
cifs_dbg(VFS, "attribute cache timeout too large\n");
goto cifs_parse_mount_err;
}
@@ -1890,8 +1890,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->handle_timeout = option;
- if (vol->handle_timeout > SMB3_MAX_HANDLE_TIMEOUT) {
+ ctx->handle_timeout = option;
+ if (ctx->handle_timeout > SMB3_MAX_HANDLE_TIMEOUT) {
cifs_dbg(VFS, "Invalid handle cache timeout, longer than 16 minutes\n");
goto cifs_parse_mount_err;
}
@@ -1902,7 +1902,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->echo_interval = option;
+ ctx->echo_interval = option;
break;
case Opt_snapshot:
if (get_option_ul(args, &option)) {
@@ -1910,7 +1910,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->snapshot_time = option;
+ ctx->snapshot_time = option;
break;
case Opt_max_credits:
if (get_option_ul(args, &option) || (option < 20) ||
@@ -1919,7 +1919,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__);
goto cifs_parse_mount_err;
}
- vol->max_credits = option;
+ ctx->max_credits = option;
break;
case Opt_max_channels:
if (get_option_ul(args, &option) || option < 1 ||
@@ -1928,15 +1928,15 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
__func__, CIFS_MAX_CHANNELS);
goto cifs_parse_mount_err;
}
- vol->max_channels = option;
+ ctx->max_channels = option;
break;
/* String Arguments */
case Opt_blank_user:
/* null user, ie. anonymous authentication */
- vol->nullauth = 1;
- vol->username = NULL;
+ ctx->nullauth = 1;
+ ctx->username = NULL;
break;
case Opt_user:
string = match_strdup(args);
@@ -1949,9 +1949,9 @@ cifs_parse_mount_options(const char *mo