diff options
author | \"Talpey, Thomas\ <Thomas.Talpey@netapp.com> | 2007-09-10 13:47:57 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 17:17:50 -0400 |
commit | 4fa016eb248cac875541fa199af550a8aefa0e90 (patch) | |
tree | 2a8aad2ebc1a05174d0eacaceb671bca6b24850c /net/sunrpc/xprt.c | |
parent | 49c36fcc441baf6a4d698e3645d1adf28edaf57b (diff) |
NFS/SUNRPC: support transport protocol naming
To prepare for including non-sockets-based RPC transports, select
RPC transports by an identifier (to be used in following patches).
Signed-off-by: Tom Talpey <tmt@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 473b48ff4523..282a9a2ec90c 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -104,7 +104,7 @@ int xprt_register_transport(struct xprt_class *transport) | |||
104 | spin_lock(&xprt_list_lock); | 104 | spin_lock(&xprt_list_lock); |
105 | list_for_each_entry(t, &xprt_list, list) { | 105 | list_for_each_entry(t, &xprt_list, list) { |
106 | /* don't register the same transport class twice */ | 106 | /* don't register the same transport class twice */ |
107 | if (t == transport) | 107 | if (t->ident == transport->ident) |
108 | goto out; | 108 | goto out; |
109 | } | 109 | } |
110 | 110 | ||
@@ -987,15 +987,13 @@ struct rpc_xprt *xprt_create_transport(struct xprt_create *args) | |||
987 | 987 | ||
988 | spin_lock(&xprt_list_lock); | 988 | spin_lock(&xprt_list_lock); |
989 | list_for_each_entry(t, &xprt_list, list) { | 989 | list_for_each_entry(t, &xprt_list, list) { |
990 | if ((t->family == args->dstaddr->sa_family) && | 990 | if (t->ident == args->ident) { |
991 | (t->protocol == args->proto)) { | ||
992 | spin_unlock(&xprt_list_lock); | 991 | spin_unlock(&xprt_list_lock); |
993 | goto found; | 992 | goto found; |
994 | } | 993 | } |
995 | } | 994 | } |
996 | spin_unlock(&xprt_list_lock); | 995 | spin_unlock(&xprt_list_lock); |
997 | printk(KERN_ERR "RPC: transport (%u/%d) not supported\n", | 996 | printk(KERN_ERR "RPC: transport (%d) not supported\n", args->ident); |
998 | args->dstaddr->sa_family, args->proto); | ||
999 | return ERR_PTR(-EIO); | 997 | return ERR_PTR(-EIO); |
1000 | 998 | ||
1001 | found: | 999 | found: |