aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
author\"Talpey, Thomas\ <Thomas.Talpey@netapp.com>2007-09-10 13:48:23 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:17:53 -0400
commit0896a725a1c5fdc8773a4d1ab0b73059507f5925 (patch)
treee8a44eecc411f0d117358752d8a2b80895d81bc0 /fs/nfs
parent4fa016eb248cac875541fa199af550a8aefa0e90 (diff)
NFS/SUNRPC: use transport protocol naming
Instead of an { address family, raw IP protocol number }-tuple, use the newly-defined RPC identifier when creating clients in the upper layers. Signed-off-by: Tom Talpey <tmt@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/client.c5
-rw-r--r--fs/nfs/nfsroot.c3
-rw-r--r--fs/nfs/super.c21
3 files changed, 16 insertions, 13 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 2edcbca1a16..6f675552978 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -23,6 +23,7 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/stats.h>
#include <linux/sunrpc/metrics.h>
+#include <linux/sunrpc/xprtsock.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_mount.h>
#include <linux/nfs4_mount.h>
@@ -340,7 +341,7 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
to->to_retries = 2;
switch (proto) {
- case IPPROTO_TCP:
+ case XPRT_TRANSPORT_TCP:
if (!to->to_initval)
to->to_initval = 60 * HZ;
if (to->to_initval > NFS_MAX_TCP_TIMEOUT)
@@ -349,7 +350,7 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
to->to_maxval = to->to_initval + (to->to_increment * to->to_retries);
to->to_exponential = 0;
break;
- case IPPROTO_UDP:
+ case XPRT_TRANSPORT_UDP:
default:
if (!to->to_initval)
to->to_initval = 11 * HZ / 10;
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index 3490322d114..e87b44ee9ac 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -76,6 +76,7 @@
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/sunrpc/clnt.h>
+#include <linux/sunrpc/xprtsock.h>
#include <linux/nfs.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_mount.h>
@@ -491,7 +492,7 @@ static int __init root_nfs_get_handle(void)
struct sockaddr_in sin;
int status;
int protocol = (nfs_data.flags & NFS_MOUNT_TCP) ?
- IPPROTO_TCP : IPPROTO_UDP;
+ XPRT_TRANSPORT_TCP : XPRT_TRANSPORT_UDP;
int version = (nfs_data.flags & NFS_MOUNT_VER3) ?
NFS_MNT3_VERSION : NFS_MNT_VERSION;
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 3804aadc18c..b47e87e6c40 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -33,6 +33,7 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/stats.h>
#include <linux/sunrpc/metrics.h>
+#include <linux/sunrpc/xprtsock.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_mount.h>
#include <linux/nfs4_mount.h>
@@ -669,13 +670,13 @@ static int nfs_parse_mount_options(char *raw,
break;
case Opt_udp:
mnt->flags &= ~NFS_MOUNT_TCP;
- mnt->nfs_server.protocol = IPPROTO_UDP;
+ mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP;
mnt->timeo = 7;
mnt->retrans = 5;
break;
case Opt_tcp:
mnt->flags |= NFS_MOUNT_TCP;
- mnt->nfs_server.protocol = IPPROTO_TCP;
+ mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
mnt->timeo = 600;
mnt->retrans = 2;
break;
@@ -884,13 +885,13 @@ static int nfs_parse_mount_options(char *raw,
switch (token) {
case Opt_xprt_udp:
mnt->flags &= ~NFS_MOUNT_TCP;
- mnt->nfs_server.protocol = IPPROTO_UDP;
+ mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP;
mnt->timeo = 7;
mnt->retrans = 5;
break;
case Opt_xprt_tcp:
mnt->flags |= NFS_MOUNT_TCP;
- mnt->nfs_server.protocol = IPPROTO_TCP;
+ mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
mnt->timeo = 600;
mnt->retrans = 2;
break;
@@ -908,10 +909,10 @@ static int nfs_parse_mount_options(char *raw,
switch (token) {
case Opt_xprt_udp:
- mnt->mount_server.protocol = IPPROTO_UDP;
+ mnt->mount_server.protocol = XPRT_TRANSPORT_UDP;
break;
case Opt_xprt_tcp:
- mnt->mount_server.protocol = IPPROTO_TCP;
+ mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
break;
default:
goto out_unrec_xprt;
@@ -1061,9 +1062,9 @@ static int nfs_validate_mount_data(void *options,
args->acregmax = 60;
args->acdirmin = 30;
args->acdirmax = 60;
- args->mount_server.protocol = IPPROTO_UDP;
+ args->mount_server.protocol = XPRT_TRANSPORT_UDP;
args->mount_server.program = NFS_MNT_PROGRAM;
- args->nfs_server.protocol = IPPROTO_TCP;
+ args->nfs_server.protocol = XPRT_TRANSPORT_TCP;
args->nfs_server.program = NFS_PROGRAM;
switch (data->version) {
@@ -1110,7 +1111,7 @@ static int nfs_validate_mount_data(void *options,
args->acdirmax = data->acdirmax;
args->nfs_server.address = data->addr;
if (!(data->flags & NFS_MOUNT_TCP))
- args->nfs_server.protocol = IPPROTO_UDP;
+ args->nfs_server.protocol = XPRT_TRANSPORT_UDP;
/* N.B. caller will free nfs_server.hostname in all cases */
args->nfs_server.hostname = kstrdup(data->hostname, GFP_KERNEL);
args->namlen = data->namlen;
@@ -1533,7 +1534,7 @@ static int nfs4_validate_mount_data(void *options,
args->acregmax = 60;
args->acdirmin = 30;
args->acdirmax = 60;
- args->nfs_server.protocol = IPPROTO_TCP;
+ args->nfs_server.protocol = XPRT_TRANSPORT_TCP;
switch (data->version) {
case 1: