aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4super.c
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-07-30 16:05:16 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-07-30 19:04:17 -0400
commitab7017a3a0a64b953e091619c30413b3721d925d (patch)
tree1ec947c2794b217d7ead01ee29d8cc5aae4c51f8 /fs/nfs/nfs4super.c
parentNFS: Fix a number of bugs in the idmapper (diff)
downloadlinux-dev-ab7017a3a0a64b953e091619c30413b3721d925d.tar.xz
linux-dev-ab7017a3a0a64b953e091619c30413b3721d925d.zip
NFS: Add version registering framework
This patch adds in the code to track multiple versions of the NFS protocol. I created default structures for v2, v3 and v4 so that each version can continue to work while I convert them into kernel modules. I also removed the const parameter from the rpc_version array so that I can change it at runtime. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4super.c')
-rw-r--r--fs/nfs/nfs4super.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c
index 59264fb335c8..1f3401902c2f 100644
--- a/fs/nfs/nfs4super.c
+++ b/fs/nfs/nfs4super.c
@@ -8,6 +8,7 @@
#include <linux/nfs_fs.h>
#include "internal.h"
#include "nfs4_fs.h"
+#include "nfs.h"
#define NFSDBG_FACILITY NFSDBG_VFS
@@ -75,6 +76,13 @@ static const struct super_operations nfs4_sops = {
.remount_fs = nfs_remount,
};
+struct nfs_subversion nfs_v4 = {
+ .owner = THIS_MODULE,
+ .nfs_fs = &nfs4_fs_type,
+ .rpc_vers = &nfs_version4,
+ .rpc_ops = &nfs_v4_clientops,
+};
+
/*
* Set up an NFS4 superblock
*/
@@ -113,7 +121,7 @@ nfs4_remote_mount(struct file_system_type *fs_type, int flags,
goto out;
}
- mntroot = nfs_fs_mount_common(fs_type, server, flags, dev_name, mount_info);
+ mntroot = nfs_fs_mount_common(server, flags, dev_name, mount_info, &nfs_v4);
out:
return mntroot;
@@ -293,7 +301,7 @@ nfs4_remote_referral_mount(struct file_system_type *fs_type, int flags,
goto out;
}
- mntroot = nfs_fs_mount_common(&nfs4_fs_type, server, flags, dev_name, &mount_info);
+ mntroot = nfs_fs_mount_common(server, flags, dev_name, &mount_info, &nfs_v4);
out:
nfs_free_fhandle(mount_info.mntfh);
return mntroot;
@@ -343,6 +351,7 @@ int __init init_nfs_v4(void)
if (err < 0)
goto out2;
+ register_nfs_version(&nfs_v4);
return 0;
out2:
nfs4_unregister_sysctl();
@@ -354,6 +363,7 @@ out:
void exit_nfs_v4(void)
{
+ unregister_nfs_version(&nfs_v4);
unregister_filesystem(&nfs4_fs_type);
nfs4_unregister_sysctl();
nfs_idmap_quit();