Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6c249b4 authored by Jeff Layton's avatar Jeff Layton Committed by J. Bruce Fields
Browse files

nfsd: reduce some spinlocking in put_client_renew



No need to take the lock unless the count goes to 0.

Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent dff1399f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -193,8 +193,10 @@ static void put_client_renew(struct nfs4_client *clp)
{
	struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id);

	spin_lock(&nn->client_lock);
	put_client_renew_locked(clp);
	if (!atomic_dec_and_lock(&clp->cl_refcount, &nn->client_lock))
		return;
	if (!is_client_expired(clp))
		renew_client_locked(clp);
	spin_unlock(&nn->client_lock);
}