1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2020, Microsoft Corporation.
5 * Author(s): Steve French <stfrench@microsoft.com>
6 * David Howells <dhowells@redhat.com>
13 #include <linux/parser.h>
14 #include <linux/fs_parser.h>
16 #define cifs_invalf(fc, fmt, ...) invalf(fc, fmt, ## __VA_ARGS__)
56 /* Mount options that take no arguments */
77 Opt_forcemandatorylock,
107 /* Mount options which take numeric value */
127 /* Mount options which take string value */
142 /* Mount options to be ignored */
148 struct smb3_fs_context {
164 char *iocharset; /* local code page for mapping to and from Unicode */
165 char source_rfc1001_name[RFC1001_NAME_LEN_WITH_NULL]; /* clnt nb name */
166 char target_rfc1001_name[RFC1001_NAME_LEN_WITH_NULL]; /* srvr nb name */
174 enum securityEnum sectype; /* sectype requested via mnt opts */
175 bool sign; /* was signing requested via mnt opts? */
176 bool ignore_signature:1;
180 bool setuidfromacl:1;
187 bool no_psx_acl:1; /* set if posix acl support should be disabled */
189 bool backupuid_specified; /* mount option backupuid is specified */
190 bool backupgid_specified; /* mount option backupgid is specified */
191 bool no_xattr:1; /* set if xattr (EA) support should be disabled*/
192 bool server_ino:1; /* use inode numbers from server ie UniqueId */
194 bool strict_io:1; /* strict cache behavior */
197 bool remap:1; /* set to remap seven reserved chars in filenames */
198 bool sfu_remap:1; /* remap seven reserved chars ala SFU */
199 bool posix_paths:1; /* unset to not ask for posix pathnames. */
203 bool nullauth:1; /* attempt to authenticate with null user */
204 bool nocase:1; /* request case insensitive filenames */
205 bool nobrl:1; /* disable sending byte range locks to srv */
206 bool nohandlecache:1; /* disable caching dir handles if srvr probs */
207 bool mand_lock:1; /* send mandatory not posix byte range lock reqs */
208 bool seal:1; /* request transport encryption on share */
209 bool nodfs:1; /* Do not request DFS, even if available */
210 bool local_lease:1; /* check leases only on local system, not remote */
213 bool nostrictsync:1; /* do not force expensive SMBflush on every sync */
214 bool no_lease:1; /* disable requesting leases */
215 bool fsc:1; /* enable fscache */
216 bool mfsymlinks:1; /* use Minshall+French Symlinks */
218 bool rwpidforward:1; /* pid forward for read/write operations */
222 bool resilient:1; /* noresilient not required since not fored for CA */
226 bool use_client_guid:1;
227 /* reuse existing guid for multichannel */
228 u8 client_guid[SMB2_CLIENT_GUID_SIZE];
232 unsigned int min_offload;
233 bool sockopt_tcp_nodelay:1;
234 unsigned long actimeo; /* attribute cache timeout (jiffies) */
235 struct smb_version_operations *ops;
236 struct smb_version_values *vals;
238 struct sockaddr_storage dstaddr; /* destination address */
239 struct sockaddr_storage srcaddr; /* allow binding to a local IP */
240 struct nls_table *local_nls; /* This is a copy of the pointer in cifs_sb */
241 unsigned int echo_interval; /* echo interval in secs */
242 __u64 snapshot_time; /* needed for timewarp tokens */
243 __u32 handle_timeout; /* persistent and durable handle timeout in ms */
244 unsigned int max_credits; /* smb3 max_credits 10 < credits < 60000 */
245 unsigned int max_channels;
246 __u16 compression; /* compression algorithm 0xFFFF default 0=disabled */
247 bool rootfs:1; /* if it's a SMB root file system */
248 bool witness:1; /* use witness protocol */
253 extern const struct fs_parameter_spec smb3_fs_parameters[];
255 extern int cifs_parse_cache_flavor(char *value,
256 struct smb3_fs_context *ctx);
257 extern int cifs_parse_security_flavors(char *value,
258 struct smb3_fs_context *ctx);
259 extern int smb3_init_fs_context(struct fs_context *fc);
260 extern void smb3_cleanup_fs_context_contents(struct smb3_fs_context *ctx);
261 extern void smb3_cleanup_fs_context(struct smb3_fs_context *ctx);
263 static inline struct smb3_fs_context *smb3_fc2context(const struct fs_context *fc)
265 return fc->fs_private;
268 extern int smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx);
269 extern void smb3_update_mnt_flags(struct cifs_sb_info *cifs_sb);