diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2011-10-25 07:16:48 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-10-25 07:16:36 -0400 |
commit | 253fb070e78db981740b000914b04b9203092925 (patch) | |
tree | aff50b20e91767f352b973132a8b5335aae3e3ca /net/sunrpc | |
parent | 914edb1bb2abe2ae4775368f2ffb7f41010fb81e (diff) |
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>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 12 |
1 files changed, 4 insertions, 8 deletions
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) | |||
258 | clnt4 = NULL; | 258 | clnt4 = NULL; |
259 | } | 259 | } |
260 | 260 | ||
261 | /* Protected by rpcb_create_local_mutex */ | 261 | rpcb_set_local(clnt, clnt4); |
262 | rpcb_local_clnt = clnt; | ||
263 | rpcb_local_clnt4 = clnt4; | ||
264 | 262 | ||
265 | out: | 263 | out: |
266 | return result; | 264 | return result; |
@@ -312,9 +310,7 @@ static int rpcb_create_local_net(void) | |||
312 | clnt4 = NULL; | 310 | clnt4 = NULL; |
313 | } | 311 | } |
314 | 312 | ||
315 | /* Protected by rpcb_create_local_mutex */ | 313 | rpcb_set_local(clnt, clnt4); |
316 | rpcb_local_clnt = clnt; | ||
317 | rpcb_local_clnt4 = clnt4; | ||
318 | 314 | ||
319 | out: | 315 | out: |
320 | return result; | 316 | return result; |
@@ -329,11 +325,11 @@ static int rpcb_create_local(void) | |||
329 | static DEFINE_MUTEX(rpcb_create_local_mutex); | 325 | static DEFINE_MUTEX(rpcb_create_local_mutex); |
330 | int result = 0; | 326 | int result = 0; |
331 | 327 | ||
332 | if (rpcb_local_clnt) | 328 | if (rpcb_get_local()) |
333 | return result; | 329 | return result; |
334 | 330 | ||
335 | mutex_lock(&rpcb_create_local_mutex); | 331 | mutex_lock(&rpcb_create_local_mutex); |
336 | if (rpcb_local_clnt) | 332 | if (rpcb_get_local()) |
337 | goto out; | 333 | goto out; |
338 | 334 | ||
339 | if (rpcb_create_local_unix() != 0) | 335 | if (rpcb_create_local_unix() != 0) |