aboutsummaryrefslogtreecommitdiff
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-14 16:40:32 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:29 -0400
commit4c402b40970382ded616eadd544fd63feb76cc79 (patch)
treeddff43479ae51f0ba5af566b09e0188563aab17b /net/sunrpc/clnt.c
parent8ad7c892e18ff8e6df422eb48ca0f73268ffd632 (diff)
SUNRPC: Remove rpc_clnt->cl_count
The kref now does most of what cl_count + cl_user used to do. The only remaining role for cl_count is to tell us if we are in a 'shutdown' phase. We can provide that information using a single bit field instead of a full atomic counter. Also rename rpc_destroy_client() to rpc_close_client(), which reflects better what its role is these days. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 613c10e4ac3..be5524d2082 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -121,7 +121,6 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
clnt = kzalloc(sizeof(*clnt), GFP_KERNEL);
if (!clnt)
goto out_err;
- atomic_set(&clnt->cl_count, 1);
clnt->cl_parent = clnt;
clnt->cl_server = clnt->cl_inline_name;
@@ -270,7 +269,6 @@ rpc_clone_client(struct rpc_clnt *clnt)
new = kmemdup(clnt, sizeof(*new), GFP_KERNEL);
if (!new)
goto out_no_clnt;
- atomic_set(&new->cl_count, 1);
new->cl_metrics = rpc_alloc_iostats(clnt);
if (new->cl_metrics == NULL)
goto out_no_stats;
@@ -303,8 +301,7 @@ out_no_clnt:
* Properly shut down an RPC client, terminating all outstanding
* requests.
*/
-int
-rpc_shutdown_client(struct rpc_clnt *clnt)
+void rpc_shutdown_client(struct rpc_clnt *clnt)
{
dprintk("RPC: shutting down %s client for %s\n",
clnt->cl_protname, clnt->cl_server);
@@ -315,7 +312,7 @@ rpc_shutdown_client(struct rpc_clnt *clnt)
list_empty(&clnt->cl_tasks), 1*HZ);
}
- return rpc_destroy_client(clnt);
+ rpc_release_client(clnt);
}
/*
@@ -363,18 +360,6 @@ rpc_release_client(struct rpc_clnt *clnt)
kref_put(&clnt->cl_kref, rpc_free_client);
}
-/*
- * Delete an RPC client
- */
-int
-rpc_destroy_client(struct rpc_clnt *clnt)
-{
- if (!atomic_dec_and_test(&clnt->cl_count))
- return 1;
- kref_put(&clnt->cl_kref, rpc_free_client);
- return 0;
-}
-
/**
* rpc_bind_new_program - bind a new RPC program to an existing client
* @old - old rpc_client