summaryrefslogtreecommitdiff
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-24 23:55:26 +0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-11 07:40:36 +0400
commit31be5bf15f3dafffce110eb1afadccbf2e3067b4 (patch)
tree6e680e926d79a1c5fe6a5a726c3f16cb3b86adfa /net/sunrpc/auth_gss
parente092bdcd939416ef911090890096fe07d0281a5e (diff)
downloadlinux-31be5bf15f3dafffce110eb1afadccbf2e3067b4.tar.xz
SUNRPC: Convert the credcache lookup code to use RCU
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 55c47ae0a258..068fa6dfb64e 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -694,15 +694,25 @@ gss_destroy_ctx(struct gss_cl_ctx *ctx)
}
static void
-gss_destroy_cred(struct rpc_cred *rc)
+gss_free_cred(struct gss_cred *gss_cred)
{
- struct gss_cred *cred = container_of(rc, struct gss_cred, gc_base);
+ dprintk("RPC: gss_free_cred %p\n", gss_cred);
+ if (gss_cred->gc_ctx)
+ gss_put_ctx(gss_cred->gc_ctx);
+ kfree(gss_cred);
+}
- dprintk("RPC: gss_destroy_cred \n");
+static void
+gss_free_cred_callback(struct rcu_head *head)
+{
+ struct gss_cred *gss_cred = container_of(head, struct gss_cred, gc_base.cr_rcu);
+ gss_free_cred(gss_cred);
+}
- if (cred->gc_ctx)
- gss_put_ctx(cred->gc_ctx);
- kfree(cred);
+static void
+gss_destroy_cred(struct rpc_cred *cred)
+{
+ call_rcu(&cred->cr_rcu, gss_free_cred_callback);
}
/*