aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svcauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svcauth.c')
-rw-r--r--net/sunrpc/svcauth.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
index e112da8005b5..bb8db3cb8032 100644
--- a/net/sunrpc/svcauth.c
+++ b/net/sunrpc/svcauth.c
@@ -126,13 +126,18 @@ EXPORT_SYMBOL_GPL(svc_auth_unregister);
126static struct hlist_head auth_domain_table[DN_HASHMAX]; 126static struct hlist_head auth_domain_table[DN_HASHMAX];
127static DEFINE_SPINLOCK(auth_domain_lock); 127static DEFINE_SPINLOCK(auth_domain_lock);
128 128
129static void auth_domain_release(struct kref *kref)
130{
131 struct auth_domain *dom = container_of(kref, struct auth_domain, ref);
132
133 hlist_del(&dom->hash);
134 dom->flavour->domain_release(dom);
135 spin_unlock(&auth_domain_lock);
136}
137
129void auth_domain_put(struct auth_domain *dom) 138void auth_domain_put(struct auth_domain *dom)
130{ 139{
131 if (atomic_dec_and_lock(&dom->ref.refcount, &auth_domain_lock)) { 140 kref_put_lock(&dom->ref, auth_domain_release, &auth_domain_lock);
132 hlist_del(&dom->hash);
133 dom->flavour->domain_release(dom);
134 spin_unlock(&auth_domain_lock);
135 }
136} 141}
137EXPORT_SYMBOL_GPL(auth_domain_put); 142EXPORT_SYMBOL_GPL(auth_domain_put);
138 143