Commit ff9099f2 authored by Bryan Schumaker's avatar Bryan Schumaker Committed by Trond Myklebust
Browse files

NFS: Create a try_mount rpc op



I'm already looking up the nfs subversion in nfs_fs_mount(), so I have
easy access to rpc_ops that used to be difficult to reach.  This allows
me to set up a different mount path for NFS v2/3 and NFS v4.

Signed-off-by: default avatarBryan Schumaker <bjschuma@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent e8f25e6d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -328,6 +328,8 @@ extern struct file_system_type nfs_xdev_fs_type;
extern struct file_system_type nfs4_xdev_fs_type;
extern struct file_system_type nfs4_referral_fs_type;
#endif
struct dentry *nfs_try_mount(int, const char *, struct nfs_mount_info *,
			struct nfs_subversion *);
void nfs_initialise_sb(struct super_block *);
int nfs_set_sb_security(struct super_block *, struct dentry *, struct nfs_mount_info *);
int nfs_clone_sb_security(struct super_block *, struct dentry *, struct nfs_mount_info *);
+1 −0
Original line number Diff line number Diff line
@@ -925,6 +925,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
	.file_ops	= &nfs_file_operations,
	.getroot	= nfs3_proc_get_root,
	.submount	= nfs_submount,
	.try_mount	= nfs_try_mount,
	.getattr	= nfs3_proc_getattr,
	.setattr	= nfs3_proc_setattr,
	.lookup		= nfs3_proc_lookup,
+1 −1
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ extern const nfs4_stateid zero_stateid;
/* nfs4super.c */
struct nfs_mount_info;
extern struct nfs_subversion nfs_v4;
struct dentry *nfs4_try_mount(int, const char *, struct nfs_mount_info *);
struct dentry *nfs4_try_mount(int, const char *, struct nfs_mount_info *, struct nfs_subversion *);
int init_nfs_v4(void);
void exit_nfs_v4(void);

+1 −0
Original line number Diff line number Diff line
@@ -6870,6 +6870,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
	.file_ops	= &nfs4_file_operations,
	.getroot	= nfs4_proc_get_root,
	.submount	= nfs4_submount,
	.try_mount	= nfs4_try_mount,
	.getattr	= nfs4_proc_getattr,
	.setattr	= nfs4_proc_setattr,
	.lookup		= nfs4_proc_lookup,
+2 −1
Original line number Diff line number Diff line
@@ -226,7 +226,8 @@ static struct dentry *nfs_follow_remote_path(struct vfsmount *root_mnt,
}

struct dentry *nfs4_try_mount(int flags, const char *dev_name,
			 struct nfs_mount_info *mount_info)
			      struct nfs_mount_info *mount_info,
			      struct nfs_subversion *nfs_mod)
{
	char *export_path;
	struct vfsmount *root_mnt;
Loading