aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc_xprt.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-01-20 07:50:53 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-31 19:28:19 -0500
commit4cb54ca2069903121e4c03ec427147c47bed5755 (patch)
tree2d156d3d9f37a385a27f444f315c0498f0e9475f /net/sunrpc/svc_xprt.c
parentbabea479b75a9ea3d84ace6d880513e18397a8bb (diff)
SUNRPC: search for service transports in network namespace context
Service transports are parametrized by network namespace. And thus lookup of transport instance have to take network namespace into account. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r--net/sunrpc/svc_xprt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 74cb0d8e9ca1..de1e1a8b526b 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -1089,6 +1089,7 @@ static struct svc_deferred_req *svc_deferred_dequeue(struct svc_xprt *xprt)
1089 * svc_find_xprt - find an RPC transport instance 1089 * svc_find_xprt - find an RPC transport instance
1090 * @serv: pointer to svc_serv to search 1090 * @serv: pointer to svc_serv to search
1091 * @xcl_name: C string containing transport's class name 1091 * @xcl_name: C string containing transport's class name
1092 * @net: owner net pointer
1092 * @af: Address family of transport's local address 1093 * @af: Address family of transport's local address
1093 * @port: transport's IP port number 1094 * @port: transport's IP port number
1094 * 1095 *
@@ -1101,7 +1102,8 @@ static struct svc_deferred_req *svc_deferred_dequeue(struct svc_xprt *xprt)
1101 * service's list that has a matching class name. 1102 * service's list that has a matching class name.
1102 */ 1103 */
1103struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, 1104struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
1104 const sa_family_t af, const unsigned short port) 1105 struct net *net, const sa_family_t af,
1106 const unsigned short port)
1105{ 1107{
1106 struct svc_xprt *xprt; 1108 struct svc_xprt *xprt;
1107 struct svc_xprt *found = NULL; 1109 struct svc_xprt *found = NULL;
@@ -1112,6 +1114,8 @@ struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
1112 1114
1113 spin_lock_bh(&serv->sv_lock); 1115 spin_lock_bh(&serv->sv_lock);
1114 list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list) { 1116 list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list) {
1117 if (xprt->xpt_net != net)
1118 continue;
1115 if (strcmp(xprt->xpt_class->xcl_name, xcl_name)) 1119 if (strcmp(xprt->xpt_class->xcl_name, xcl_name))
1116 continue; 1120 continue;
1117 if (af != AF_UNSPEC && af != xprt->xpt_local.ss_family) 1121 if (af != AF_UNSPEC && af != xprt->xpt_local.ss_family)