From: Stanislav Kinsbursky Date: Tue, 25 Oct 2011 11:16:48 +0000 (+0300) Subject: SUNRPC: use rpcbind reference counting helpers X-Git-Tag: v3.2-rc1~52^2~15 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=253fb070e78db981740b000914b04b9203092925 SUNRPC: use rpcbind reference counting helpers All is simple: we just increase users counter if rpcbind clients has been created already. Otherwise we create them and set users counter to 1. Signed-off-by: Stanislav Kinsbursky Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 78af56579fa1..f5309aba1a14 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -258,9 +258,7 @@ static int rpcb_create_local_unix(void) clnt4 = NULL; } - /* Protected by rpcb_create_local_mutex */ - rpcb_local_clnt = clnt; - rpcb_local_clnt4 = clnt4; + rpcb_set_local(clnt, clnt4); out: return result; @@ -312,9 +310,7 @@ static int rpcb_create_local_net(void) clnt4 = NULL; } - /* Protected by rpcb_create_local_mutex */ - rpcb_local_clnt = clnt; - rpcb_local_clnt4 = clnt4; + rpcb_set_local(clnt, clnt4); out: return result; @@ -329,11 +325,11 @@ static int rpcb_create_local(void) static DEFINE_MUTEX(rpcb_create_local_mutex); int result = 0; - if (rpcb_local_clnt) + if (rpcb_get_local()) return result; mutex_lock(&rpcb_create_local_mutex); - if (rpcb_local_clnt) + if (rpcb_get_local()) goto out; if (rpcb_create_local_unix() != 0)