summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2018-10-01 10:41:44 -0400
committerJ. Bruce Fields <bfields@redhat.com>2018-10-03 11:32:59 -0400
commit608a0ab2f54ab0e301ad76a41aad979ea0d02670 (patch)
tree26382fa9fd57a2f549fb991c067c72257a2b2b61 /net/sunrpc/auth_gss
parent30382d6ce593f863292cd7c026a79077c4e7280f (diff)
downloadlinux-608a0ab2f54ab0e301ad76a41aad979ea0d02670.tar.gz
linux-608a0ab2f54ab0e301ad76a41aad979ea0d02670.tar.bz2
linux-608a0ab2f54ab0e301ad76a41aad979ea0d02670.zip
SUNRPC: Add lockless lookup of the server's auth domain
Avoid taking the global auth_domain_lock in most lookups of the auth domain by adding an RCU protected lookup. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 860f2a1bbb67..87c71fb0f0ea 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1764,14 +1764,21 @@ out_err:
}
static void
-svcauth_gss_domain_release(struct auth_domain *dom)
+svcauth_gss_domain_release_rcu(struct rcu_head *head)
{
+ struct auth_domain *dom = container_of(head, struct auth_domain, rcu_head);
struct gss_domain *gd = container_of(dom, struct gss_domain, h);
kfree(dom->name);
kfree(gd);
}
+static void
+svcauth_gss_domain_release(struct auth_domain *dom)
+{
+ call_rcu(&dom->rcu_head, svcauth_gss_domain_release_rcu);
+}
+
static struct auth_ops svcauthops_gss = {
.name = "rpcsec_gss",
.owner = THIS_MODULE,