mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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 <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
914edb1bb2
commit
253fb070e7
@ -258,9 +258,7 @@ static int rpcb_create_local_unix(void)
|
|||||||
clnt4 = NULL;
|
clnt4 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Protected by rpcb_create_local_mutex */
|
rpcb_set_local(clnt, clnt4);
|
||||||
rpcb_local_clnt = clnt;
|
|
||||||
rpcb_local_clnt4 = clnt4;
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return result;
|
return result;
|
||||||
@ -312,9 +310,7 @@ static int rpcb_create_local_net(void)
|
|||||||
clnt4 = NULL;
|
clnt4 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Protected by rpcb_create_local_mutex */
|
rpcb_set_local(clnt, clnt4);
|
||||||
rpcb_local_clnt = clnt;
|
|
||||||
rpcb_local_clnt4 = clnt4;
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return result;
|
return result;
|
||||||
@ -329,11 +325,11 @@ static int rpcb_create_local(void)
|
|||||||
static DEFINE_MUTEX(rpcb_create_local_mutex);
|
static DEFINE_MUTEX(rpcb_create_local_mutex);
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
if (rpcb_local_clnt)
|
if (rpcb_get_local())
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
mutex_lock(&rpcb_create_local_mutex);
|
mutex_lock(&rpcb_create_local_mutex);
|
||||||
if (rpcb_local_clnt)
|
if (rpcb_get_local())
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (rpcb_create_local_unix() != 0)
|
if (rpcb_create_local_unix() != 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user