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>
This commit is contained in:

committed by
Trond Myklebust

parent
babea479b7
commit
4cb54ca206
@@ -1089,6 +1089,7 @@ static struct svc_deferred_req *svc_deferred_dequeue(struct svc_xprt *xprt)
|
||||
* svc_find_xprt - find an RPC transport instance
|
||||
* @serv: pointer to svc_serv to search
|
||||
* @xcl_name: C string containing transport's class name
|
||||
* @net: owner net pointer
|
||||
* @af: Address family of transport's local address
|
||||
* @port: transport's IP port number
|
||||
*
|
||||
@@ -1101,7 +1102,8 @@ static struct svc_deferred_req *svc_deferred_dequeue(struct svc_xprt *xprt)
|
||||
* service's list that has a matching class name.
|
||||
*/
|
||||
struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
|
||||
const sa_family_t af, const unsigned short port)
|
||||
struct net *net, const sa_family_t af,
|
||||
const unsigned short port)
|
||||
{
|
||||
struct svc_xprt *xprt;
|
||||
struct svc_xprt *found = NULL;
|
||||
@@ -1112,6 +1114,8 @@ struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
|
||||
|
||||
spin_lock_bh(&serv->sv_lock);
|
||||
list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list) {
|
||||
if (xprt->xpt_net != net)
|
||||
continue;
|
||||
if (strcmp(xprt->xpt_class->xcl_name, xcl_name))
|
||||
continue;
|
||||
if (af != AF_UNSPEC && af != xprt->xpt_local.ss_family)
|
||||
|
Reference in New Issue
Block a user