diff options
author | \"Talpey, Thomas\ <Thomas.Talpey@netapp.com> | 2007-09-10 13:48:23 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 17:17:53 -0400 |
commit | 0896a725a1c5fdc8773a4d1ab0b73059507f5925 (patch) | |
tree | e8a44eecc411f0d117358752d8a2b80895d81bc0 /fs/nfs/super.c | |
parent | 4fa016eb248cac875541fa199af550a8aefa0e90 (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/super.c')
-rw-r--r-- | fs/nfs/super.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 3804aadc18c4..b47e87e6c406 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/sunrpc/clnt.h> | 33 | #include <linux/sunrpc/clnt.h> |
34 | #include <linux/sunrpc/stats.h> | 34 | #include <linux/sunrpc/stats.h> |
35 | #include <linux/sunrpc/metrics.h> | 35 | #include <linux/sunrpc/metrics.h> |
36 | #include <linux/sunrpc/xprtsock.h> | ||
36 | #include <linux/nfs_fs.h> | 37 | #include <linux/nfs_fs.h> |
37 | #include <linux/nfs_mount.h> | 38 | #include <linux/nfs_mount.h> |
38 | #include <linux/nfs4_mount.h> | 39 | #include <linux/nfs4_mount.h> |
@@ -669,13 +670,13 @@ static int nfs_parse_mount_options(char *raw, | |||
669 | break; | 670 | break; |
670 | case Opt_udp: | 671 | case Opt_udp: |
671 | mnt->flags &= ~NFS_MOUNT_TCP; | 672 | mnt->flags &= ~NFS_MOUNT_TCP; |
672 | mnt->nfs_server.protocol = IPPROTO_UDP; | 673 | mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP; |
673 | mnt->timeo = 7; | 674 | mnt->timeo = 7; |
674 | mnt->retrans = 5; | 675 | mnt->retrans = 5; |
675 | break; | 676 | break; |
676 | case Opt_tcp: | 677 | case Opt_tcp: |
677 | mnt->flags |= NFS_MOUNT_TCP; | 678 | mnt->flags |= NFS_MOUNT_TCP; |
678 | mnt->nfs_server.protocol = IPPROTO_TCP; | 679 | mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP; |
679 | mnt->timeo = 600; | 680 | mnt->timeo = 600; |
680 | mnt->retrans = 2; | 681 | mnt->retrans = 2; |
681 | break; | 682 | break; |
@@ -884,13 +885,13 @@ static int nfs_parse_mount_options(char *raw, | |||
884 | switch (token) { | 885 | switch (token) { |
885 | case Opt_xprt_udp: | 886 | case Opt_xprt_udp: |
886 | mnt->flags &= ~NFS_MOUNT_TCP; | 887 | mnt->flags &= ~NFS_MOUNT_TCP; |
887 | mnt->nfs_server.protocol = IPPROTO_UDP; | 888 | mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP; |
888 | mnt->timeo = 7; | 889 | mnt->timeo = 7; |
889 | mnt->retrans = 5; | 890 | mnt->retrans = 5; |
890 | break; | 891 | break; |
891 | case Opt_xprt_tcp: | 892 | case Opt_xprt_tcp: |
892 | mnt->flags |= NFS_MOUNT_TCP; | 893 | mnt->flags |= NFS_MOUNT_TCP; |
893 | mnt->nfs_server.protocol = IPPROTO_TCP; | 894 | mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP; |
894 | mnt->timeo = 600; | 895 | mnt->timeo = 600; |
895 | mnt->retrans = 2; | 896 | mnt->retrans = 2; |
896 | break; | 897 | break; |
@@ -908,10 +909,10 @@ static int nfs_parse_mount_options(char *raw, | |||
908 | 909 | ||
909 | switch (token) { | 910 | switch (token) { |
910 | case Opt_xprt_udp: | 911 | case Opt_xprt_udp: |
911 | mnt->mount_server.protocol = IPPROTO_UDP; | 912 | mnt->mount_server.protocol = XPRT_TRANSPORT_UDP; |
912 | break; | 913 | break; |
913 | case Opt_xprt_tcp: | 914 | case Opt_xprt_tcp: |
914 | mnt->mount_server.protocol = IPPROTO_TCP; | 915 | mnt->mount_server.protocol = XPRT_TRANSPORT_TCP; |
915 | break; | 916 | break; |
916 | default: | 917 | default: |
917 | goto out_unrec_xprt; | 918 | goto out_unrec_xprt; |
@@ -1061,9 +1062,9 @@ static int nfs_validate_mount_data(void *options, | |||
1061 | args->acregmax = 60; | 1062 | args->acregmax = 60; |
1062 | args->acdirmin = 30; | 1063 | args->acdirmin = 30; |
1063 | args->acdirmax = 60; | 1064 | args->acdirmax = 60; |
1064 | args->mount_server.protocol = IPPROTO_UDP; | 1065 | args->mount_server.protocol = XPRT_TRANSPORT_UDP; |
1065 | args->mount_server.program = NFS_MNT_PROGRAM; | 1066 | args->mount_server.program = NFS_MNT_PROGRAM; |
1066 | args->nfs_server.protocol = IPPROTO_TCP; | 1067 | args->nfs_server.protocol = XPRT_TRANSPORT_TCP; |
1067 | args->nfs_server.program = NFS_PROGRAM; | 1068 | args->nfs_server.program = NFS_PROGRAM; |
1068 | 1069 | ||
1069 | switch (data->version) { | 1070 | switch (data->version) { |
@@ -1110,7 +1111,7 @@ static int nfs_validate_mount_data(void *options, | |||
1110 | args->acdirmax = data->acdirmax; | 1111 | args->acdirmax = data->acdirmax; |
1111 | args->nfs_server.address = data->addr; | 1112 | args->nfs_server.address = data->addr; |
1112 | if (!(data->flags & NFS_MOUNT_TCP)) | 1113 | if (!(data->flags & NFS_MOUNT_TCP)) |
1113 | args->nfs_server.protocol = IPPROTO_UDP; | 1114 | args->nfs_server.protocol = XPRT_TRANSPORT_UDP; |
1114 | /* N.B. caller will free nfs_server.hostname in all cases */ | 1115 | /* N.B. caller will free nfs_server.hostname in all cases */ |
1115 | args->nfs_server.hostname = kstrdup(data->hostname, GFP_KERNEL); | 1116 | args->nfs_server.hostname = kstrdup(data->hostname, GFP_KERNEL); |
1116 | args->namlen = data->namlen; | 1117 | args->namlen = data->namlen; |
@@ -1533,7 +1534,7 @@ static int nfs4_validate_mount_data(void *options, | |||
1533 | args->acregmax = 60; | 1534 | args->acregmax = 60; |
1534 | args->acdirmin = 30; | 1535 | args->acdirmin = 30; |
1535 | args->acdirmax = 60; | 1536 | args->acdirmax = 60; |
1536 | args->nfs_server.protocol = IPPROTO_TCP; | 1537 | args->nfs_server.protocol = XPRT_TRANSPORT_TCP; |
1537 | 1538 | ||
1538 | switch (data->version) { | 1539 | switch (data->version) { |
1539 | case 1: | 1540 | case 1: |