OpenVZ Forum


Home » Mailing lists » Devel » [PATCH v7 0/7] SUNRPC: make rpcbind clients allocated and destroyed dynamically
[PATCH v7 2/7] SUNRPC: use rpcbind reference counting helpers [message #43894 is a reply to message #43892] Fri, 28 October 2011 10:52 Go to previous messageGo to previous message
Stanislav Kinsbursky is currently offline  Stanislav Kinsbursky
Messages: 683
Registered: October 2011
Senior Member
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>

---
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 9830d87..115df11 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)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH v6 0/8] SUNRPC: make rpcbind clients allocated and destroyed dynamically
Next Topic: [PATCH 1/7] SUNRPC: create RPC pipefs superblock per network namespace context
Goto Forum:
  


Current Time: Sun Aug 03 23:10:54 GMT 2025

Total time taken to generate the page: 1.18324 seconds