Skip to content

Commit 3fa1c6d

Browse files
Ronnie SahlbergSteve French
authored andcommitted
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 <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 7955f10 commit 3fa1c6d

File tree

12 files changed

+750
-736
lines changed

12 files changed

+750
-736
lines changed

fs/cifs/cifsfs.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#ifdef CONFIG_CIFS_DFS_UPCALL
5656
#include "dfs_cache.h"
5757
#endif
58+
#include "fs_context.h"
5859

5960
/*
6061
* DOS dates from 1980/1/1 through 2107/12/31
@@ -720,7 +721,7 @@ static const struct super_operations cifs_super_ops = {
720721
* Return dentry with refcount + 1 on success and NULL otherwise.
721722
*/
722723
static struct dentry *
723-
cifs_get_root(struct smb_vol *vol, struct super_block *sb)
724+
cifs_get_root(struct smb3_fs_context *ctx, struct super_block *sb)
724725
{
725726
struct dentry *dentry;
726727
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
@@ -731,7 +732,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
731732
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH)
732733
return dget(sb->s_root);
733734

734-
full_path = cifs_build_path_to_root(vol, cifs_sb,
735+
full_path = cifs_build_path_to_root(ctx, cifs_sb,
735736
cifs_sb_master_tcon(cifs_sb), 0);
736737
if (full_path == NULL)
737738
return ERR_PTR(-ENOMEM);
@@ -784,7 +785,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
784785
int rc;
785786
struct super_block *sb;
786787
struct cifs_sb_info *cifs_sb;
787-
struct smb_vol *volume_info;
788+
struct smb3_fs_context *ctx;
788789
struct cifs_mnt_data mnt_data;
789790
struct dentry *root;
790791

@@ -797,9 +798,9 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
797798
else
798799
cifs_info("Attempting to mount %s\n", dev_name);
799800

800-
volume_info = cifs_get_volume_info((char *)data, dev_name, is_smb3);
801-
if (IS_ERR(volume_info))
802-
return ERR_CAST(volume_info);
801+
ctx = cifs_get_volume_info((char *)data, dev_name, is_smb3);
802+
if (IS_ERR(ctx))
803+
return ERR_CAST(ctx);
803804

804805
cifs_sb = kzalloc(sizeof(struct cifs_sb_info), GFP_KERNEL);
805806
if (cifs_sb == NULL) {
@@ -813,13 +814,13 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
813814
goto out_free;
814815
}
815816

816-
rc = cifs_setup_cifs_sb(volume_info, cifs_sb);
817+
rc = cifs_setup_cifs_sb(ctx, cifs_sb);
817818
if (rc) {
818819
root = ERR_PTR(rc);
819820
goto out_free;
820821
}
821822

822-
rc = cifs_mount(cifs_sb, volume_info);
823+
rc = cifs_mount(cifs_sb, ctx);
823824
if (rc) {
824825
if (!(flags & SB_SILENT))
825826
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,
828829
goto out_free;
829830
}
830831

831-
mnt_data.vol = volume_info;
832+
mnt_data.ctx = ctx;
832833
mnt_data.cifs_sb = cifs_sb;
833834
mnt_data.flags = flags;
834835

@@ -855,7 +856,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
855856
sb->s_flags |= SB_ACTIVE;
856857
}
857858

858-
root = cifs_get_root(volume_info, sb);
859+
root = cifs_get_root(ctx, sb);
859860
if (IS_ERR(root))
860861
goto out_super;
861862

@@ -865,15 +866,15 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
865866
out_super:
866867
deactivate_locked_super(sb);
867868
out:
868-
cifs_cleanup_volume_info(volume_info);
869+
cifs_cleanup_volume_info(ctx);
869870
return root;
870871

871872
out_free:
872873
kfree(cifs_sb->prepath);
873874
kfree(cifs_sb->mountdata);
874875
kfree(cifs_sb);
875876
out_nls:
876-
unload_nls(volume_info->local_nls);
877+
unload_nls(ctx->local_nls);
877878
goto out;
878879
}
879880

fs/cifs/cifsglob.h

Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ struct cifs_ses;
202202
struct cifs_tcon;
203203
struct dfs_info3_param;
204204
struct cifs_fattr;
205-
struct smb_vol;
205+
struct smb3_fs_context;
206206
struct cifs_fid;
207207
struct cifs_readdata;
208208
struct cifs_writedata;
@@ -268,9 +268,9 @@ struct smb_version_operations {
268268
/* negotiate to the server */
269269
int (*negotiate)(const unsigned int, struct cifs_ses *);
270270
/* set negotiated write size */
271-
unsigned int (*negotiate_wsize)(struct cifs_tcon *, struct smb_vol *);
271+
unsigned int (*negotiate_wsize)(struct cifs_tcon *tcon, struct smb3_fs_context *ctx);
272272
/* set negotiated read size */
273-
unsigned int (*negotiate_rsize)(struct cifs_tcon *, struct smb_vol *);
273+
unsigned int (*negotiate_rsize)(struct cifs_tcon *tcon, struct smb3_fs_context *ctx);
274274
/* setup smb sessionn */
275275
int (*sess_setup)(const unsigned int, struct cifs_ses *,
276276
const struct nls_table *);
@@ -530,97 +530,6 @@ struct smb_version_values {
530530
#define HEADER_SIZE(server) (server->vals->header_size)
531531
#define MAX_HEADER_SIZE(server) (server->vals->max_header_size)
532532

533-
struct smb_vol {
534-
char *username;
535-
char *password;
536-
char *domainname;
537-
char *UNC;
538-
char *iocharset; /* local code page for mapping to and from Unicode */
539-
char source_rfc1001_name[RFC1001_NAME_LEN_WITH_NULL]; /* clnt nb name */
540-
char target_rfc1001_name[RFC1001_NAME_LEN_WITH_NULL]; /* srvr nb name */
541-
kuid_t cred_uid;
542-
kuid_t linux_uid;
543-
kgid_t linux_gid;
544-
kuid_t backupuid;
545-
kgid_t backupgid;
546-
umode_t file_mode;
547-
umode_t dir_mode;
548-
enum securityEnum sectype; /* sectype requested via mnt opts */
549-
bool sign; /* was signing requested via mnt opts? */
550-
bool ignore_signature:1;
551-
bool retry:1;
552-
bool intr:1;
553-
bool setuids:1;
554-
bool setuidfromacl:1;
555-
bool override_uid:1;
556-
bool override_gid:1;
557-
bool dynperm:1;
558-
bool noperm:1;
559-
bool nodelete:1;
560-
bool mode_ace:1;
561-
bool no_psx_acl:1; /* set if posix acl support should be disabled */
562-
bool cifs_acl:1;
563-
bool backupuid_specified; /* mount option backupuid is specified */
564-
bool backupgid_specified; /* mount option backupgid is specified */
565-
bool no_xattr:1; /* set if xattr (EA) support should be disabled*/
566-
bool server_ino:1; /* use inode numbers from server ie UniqueId */
567-
bool direct_io:1;
568-
bool strict_io:1; /* strict cache behavior */
569-
bool cache_ro:1;
570-
bool cache_rw:1;
571-
bool remap:1; /* set to remap seven reserved chars in filenames */
572-
bool sfu_remap:1; /* remap seven reserved chars ala SFU */
573-
bool posix_paths:1; /* unset to not ask for posix pathnames. */
574-
bool no_linux_ext:1;
575-
bool linux_ext:1;
576-
bool sfu_emul:1;
577-
bool nullauth:1; /* attempt to authenticate with null user */
578-
bool nocase:1; /* request case insensitive filenames */
579-
bool nobrl:1; /* disable sending byte range locks to srv */
580-
bool nohandlecache:1; /* disable caching dir handles if srvr probs */
581-
bool mand_lock:1; /* send mandatory not posix byte range lock reqs */
582-
bool seal:1; /* request transport encryption on share */
583-
bool nodfs:1; /* Do not request DFS, even if available */
584-
bool local_lease:1; /* check leases only on local system, not remote */
585-
bool noblocksnd:1;
586-
bool noautotune:1;
587-
bool nostrictsync:1; /* do not force expensive SMBflush on every sync */
588-
bool no_lease:1; /* disable requesting leases */
589-
bool fsc:1; /* enable fscache */
590-
bool mfsymlinks:1; /* use Minshall+French Symlinks */
591-
bool multiuser:1;
592-
bool rwpidforward:1; /* pid forward for read/write operations */
593-
bool nosharesock:1;
594-
bool persistent:1;
595-
bool nopersistent:1;
596-
bool resilient:1; /* noresilient not required since not fored for CA */
597-
bool domainauto:1;
598-
bool rdma:1;
599-
bool multichannel:1;
600-
bool use_client_guid:1;
601-
/* reuse existing guid for multichannel */
602-
u8 client_guid[SMB2_CLIENT_GUID_SIZE];
603-
unsigned int bsize;
604-
unsigned int rsize;
605-
unsigned int wsize;
606-
unsigned int min_offload;
607-
bool sockopt_tcp_nodelay:1;
608-
unsigned long actimeo; /* attribute cache timeout (jiffies) */
609-
struct smb_version_operations *ops;
610-
struct smb_version_values *vals;
611-
char *prepath;
612-
struct sockaddr_storage dstaddr; /* destination address */
613-
struct sockaddr_storage srcaddr; /* allow binding to a local IP */
614-
struct nls_table *local_nls;
615-
unsigned int echo_interval; /* echo interval in secs */
616-
__u64 snapshot_time; /* needed for timewarp tokens */
617-
__u32 handle_timeout; /* persistent and durable handle timeout in ms */
618-
unsigned int max_credits; /* smb3 max_credits 10 < credits < 60000 */
619-
unsigned int max_channels;
620-
__u16 compression; /* compression algorithm 0xFFFF default 0=disabled */
621-
bool rootfs:1; /* if it's a SMB root file system */
622-
};
623-
624533
/**
625534
* CIFS superblock mount flags (mnt_cifs_flags) to consider when
626535
* trying to reuse existing superblock for a new mount
@@ -649,7 +558,7 @@ struct smb_vol {
649558

650559
struct cifs_mnt_data {
651560
struct cifs_sb_info *cifs_sb;
652-
struct smb_vol *vol;
561+
struct smb3_fs_context *ctx;
653562
int flags;
654563
};
655564

fs/cifs/cifsproto.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#endif
2828

2929
struct statfs;
30-
struct smb_vol;
3130
struct smb_rqst;
31+
struct smb3_fs_context;
3232

3333
/*
3434
*****************************************************************
@@ -72,7 +72,7 @@ extern void exit_cifs_spnego(void);
7272
extern char *build_path_from_dentry(struct dentry *);
7373
extern char *build_path_from_dentry_optional_prefix(struct dentry *direntry,
7474
bool prefix);
75-
extern char *cifs_build_path_to_root(struct smb_vol *vol,
75+
extern char *cifs_build_path_to_root(struct smb3_fs_context *ctx,
7676
struct cifs_sb_info *cifs_sb,
7777
struct cifs_tcon *tcon,
7878
int add_treename);
@@ -234,13 +234,13 @@ extern int cifs_read_page_from_socket(struct TCP_Server_Info *server,
234234
struct page *page,
235235
unsigned int page_offset,
236236
unsigned int to_read);
237-
extern int cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
237+
extern int cifs_setup_cifs_sb(struct smb3_fs_context *ctx,
238238
struct cifs_sb_info *cifs_sb);
239239
extern int cifs_match_super(struct super_block *, void *);
240-
extern void cifs_cleanup_volume_info(struct smb_vol *pvolume_info);
241-
extern struct smb_vol *cifs_get_volume_info(char *mount_data,
240+
extern void cifs_cleanup_volume_info(struct smb3_fs_context *ctx);
241+
extern struct smb3_fs_context *cifs_get_volume_info(char *mount_data,
242242
const char *devname, bool is_smb3);
243-
extern int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol);
243+
extern int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx);
244244
extern void cifs_umount(struct cifs_sb_info *);
245245
extern void cifs_mark_open_files_invalid(struct cifs_tcon *tcon);
246246
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,
256256
struct tcon_link *tlink,
257257
struct cifs_pending_open *open);
258258
extern void cifs_del_pending_open(struct cifs_pending_open *open);
259-
extern struct TCP_Server_Info *cifs_get_tcp_session(struct smb_vol *vol);
259+
extern struct TCP_Server_Info *cifs_get_tcp_session(struct smb3_fs_context *ctx);
260260
extern void cifs_put_tcp_session(struct TCP_Server_Info *server,
261261
int from_reconnect);
262262
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,
332332
const char *searchName, bool is_unicode);
333333
extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
334334
struct cifs_sb_info *cifs_sb,
335-
struct smb_vol *vol);
335+
struct smb3_fs_context *ctx);
336336
extern int CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
337337
struct kstatfs *FSData);
338338
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,
553553
unsigned char *p24);
554554

555555
extern int
556-
cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
556+
cifs_setup_volume_info(struct smb3_fs_context *ctx, char *mount_data,
557557
const char *devname, bool is_smb3);
558558
extern void
559-
cifs_cleanup_volume_info_contents(struct smb_vol *volume_info);
559+
cifs_cleanup_volume_info_contents(struct smb3_fs_context *ctx);
560560

561561
extern struct TCP_Server_Info *
562-
cifs_find_tcp_session(struct smb_vol *vol);
562+
cifs_find_tcp_session(struct smb3_fs_context *ctx);
563563

564564
extern void cifs_put_smb_ses(struct cifs_ses *ses);
565565

566566
extern struct cifs_ses *
567-
cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info);
567+
cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx);
568568

569569
void cifs_readdata_release(struct kref *refcount);
570570
int cifs_async_readv(struct cifs_readdata *rdata);

0 commit comments

Comments
 (0)