diff options
author | Trond Myklebust <trondmy@gmail.com> | 2018-10-01 16:41:44 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2018-10-03 17:32:59 +0200 |
commit | 608a0ab2f54ab0e301ad76a41aad979ea0d02670 (patch) | |
tree | 26382fa9fd57a2f549fb991c067c72257a2b2b61 /net/sunrpc/svcauth_unix.c | |
parent | SUNRPC: Remove the server 'authtab_lock' and just use RCU (diff) | |
download | linux-608a0ab2f54ab0e301ad76a41aad979ea0d02670.tar.xz 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/svcauth_unix.c')
-rw-r--r-- | net/sunrpc/svcauth_unix.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index af7f28fb8102..84cf39021a03 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -37,20 +37,26 @@ struct unix_domain { extern struct auth_ops svcauth_null; extern struct auth_ops svcauth_unix; -static void svcauth_unix_domain_release(struct auth_domain *dom) +static void svcauth_unix_domain_release_rcu(struct rcu_head *head) { + struct auth_domain *dom = container_of(head, struct auth_domain, rcu_head); struct unix_domain *ud = container_of(dom, struct unix_domain, h); kfree(dom->name); kfree(ud); } +static void svcauth_unix_domain_release(struct auth_domain *dom) +{ + call_rcu(&dom->rcu_head, svcauth_unix_domain_release_rcu); +} + struct auth_domain *unix_domain_find(char *name) { struct auth_domain *rv; struct unix_domain *new = NULL; - rv = auth_domain_lookup(name, NULL); + rv = auth_domain_find(name); while(1) { if (rv) { if (new && rv != &new->h) |