diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-05-10 16:47:19 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-14 20:42:22 -0400 |
commit | 2ba68002a74fb167b68844077d36e5ccfc87f323 (patch) | |
tree | 9a84b5849145275bda0ba74aa24b4354299bdf0e /fs/nfs/client.c | |
parent | 5e7e5a0da28216fb9d0a49e93ee27668ef4f04f7 (diff) |
NFS: Make v2 configurable
With this patch NFS v2 can be disabled during Kconfig. I default the
option to "y" to match the current behavior.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index a8f8de618d73..8f1c65210afb 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -90,7 +90,9 @@ static bool nfs4_disable_idmapping = true; | |||
90 | * RPC cruft for NFS | 90 | * RPC cruft for NFS |
91 | */ | 91 | */ |
92 | static const struct rpc_version *nfs_version[5] = { | 92 | static const struct rpc_version *nfs_version[5] = { |
93 | #ifdef CONFIG_NFS_V2 | ||
93 | [2] = &nfs_version2, | 94 | [2] = &nfs_version2, |
95 | #endif | ||
94 | #ifdef CONFIG_NFS_V3 | 96 | #ifdef CONFIG_NFS_V3 |
95 | [3] = &nfs_version3, | 97 | [3] = &nfs_version3, |
96 | #endif | 98 | #endif |
@@ -847,7 +849,7 @@ static int nfs_init_server(struct nfs_server *server, | |||
847 | .hostname = data->nfs_server.hostname, | 849 | .hostname = data->nfs_server.hostname, |
848 | .addr = (const struct sockaddr *)&data->nfs_server.address, | 850 | .addr = (const struct sockaddr *)&data->nfs_server.address, |
849 | .addrlen = data->nfs_server.addrlen, | 851 | .addrlen = data->nfs_server.addrlen, |
850 | .rpc_ops = &nfs_v2_clientops, | 852 | .rpc_ops = NULL, |
851 | .proto = data->nfs_server.protocol, | 853 | .proto = data->nfs_server.protocol, |
852 | .net = data->net, | 854 | .net = data->net, |
853 | }; | 855 | }; |
@@ -857,10 +859,20 @@ static int nfs_init_server(struct nfs_server *server, | |||
857 | 859 | ||
858 | dprintk("--> nfs_init_server()\n"); | 860 | dprintk("--> nfs_init_server()\n"); |
859 | 861 | ||
862 | switch (data->version) { | ||
863 | #ifdef CONFIG_NFS_V2 | ||
864 | case 2: | ||
865 | cl_init.rpc_ops = &nfs_v2_clientops; | ||
866 | break; | ||
867 | #endif | ||
860 | #ifdef CONFIG_NFS_V3 | 868 | #ifdef CONFIG_NFS_V3 |
861 | if (data->version == 3) | 869 | case 3: |
862 | cl_init.rpc_ops = &nfs_v3_clientops; | 870 | cl_init.rpc_ops = &nfs_v3_clientops; |
871 | break; | ||
863 | #endif | 872 | #endif |
873 | default: | ||
874 | return -EPROTONOSUPPORT; | ||
875 | } | ||
864 | 876 | ||
865 | nfs_init_timeout_values(&timeparms, data->nfs_server.protocol, | 877 | nfs_init_timeout_values(&timeparms, data->nfs_server.protocol, |
866 | data->timeo, data->retrans); | 878 | data->timeo, data->retrans); |