diff options
author | David Howells <dhowells@redhat.com> | 2019-12-10 07:31:04 -0500 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2020-01-15 10:15:17 -0500 |
commit | 9954bf92c0cddd50a2a470be302e1c1ffdf21d42 (patch) | |
tree | 617ee88362af1623b2e1212f844b586829d33ba9 /fs/nfs/internal.h | |
parent | adf2314fe667565258f304a04990d334defabeaf (diff) | |
download | linux-9954bf92c0cddd50a2a470be302e1c1ffdf21d42.tar.bz2 |
NFS: Move mount parameterisation bits into their own file
Split various bits relating to mount parameterisation out from
fs/nfs/super.c into their own file to form the basis of filesystem context
handling for NFS.
No other changes are made to the code beyond removing 'static' qualifiers.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r-- | fs/nfs/internal.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index a467e43fc682..28ab31fc5aa6 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -7,6 +7,7 @@ #include <linux/mount.h> #include <linux/security.h> #include <linux/crc32.h> +#include <linux/sunrpc/addr.h> #include <linux/nfs_page.h> #include <linux/wait_bit.h> @@ -224,6 +225,22 @@ extern const struct svc_version nfs4_callback_version1; extern const struct svc_version nfs4_callback_version4; struct nfs_pageio_descriptor; + +/* mount.c */ +#define NFS_TEXT_DATA 1 + +extern struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(void); +extern void nfs_free_parsed_mount_data(struct nfs_parsed_mount_data *data); +extern int nfs_parse_mount_options(char *raw, struct nfs_parsed_mount_data *mnt); +extern int nfs_validate_mount_data(struct file_system_type *fs_type, + void *options, + struct nfs_parsed_mount_data *args, + struct nfs_fh *mntfh, + const char *dev_name); +extern int nfs_validate_text_mount_data(void *options, + struct nfs_parsed_mount_data *args, + const char *dev_name); + /* pagelist.c */ extern int __init nfs_init_nfspagecache(void); extern void nfs_destroy_nfspagecache(void); @@ -765,3 +782,16 @@ static inline bool nfs_error_is_fatal_on_server(int err) } return nfs_error_is_fatal(err); } + +/* + * Select between a default port value and a user-specified port value. + * If a zero value is set, then autobind will be used. + */ +static inline void nfs_set_port(struct sockaddr *sap, int *port, + const unsigned short default_port) +{ + if (*port == NFS_UNSPEC_PORT) + *port = default_port; + + rpc_set_port(sap, *port); +} |