static void nfs4_put_stateowner(struct nfs4_stateowner *sop)
{
- if (!atomic_dec_and_test(&sop->so_count))
+ struct nfs4_client *clp = sop->so_client;
+
+ might_lock(&clp->cl_lock);
+
+ if (!atomic_dec_and_lock(&sop->so_count, &clp->cl_lock))
return;
sop->so_ops->so_unhash(sop);
+ spin_unlock(&clp->cl_lock);
kfree(sop->so_owner.data);
sop->so_ops->so_free(sop);
}
static void nfs4_unhash_openowner(struct nfs4_stateowner *so)
{
- struct nfs4_client *clp = so->so_client;
-
- spin_lock(&clp->cl_lock);
unhash_openowner_locked(openowner(so));
- spin_unlock(&clp->cl_lock);
}
static void nfs4_free_openowner(struct nfs4_stateowner *so)
static void nfs4_unhash_lockowner(struct nfs4_stateowner *sop)
{
- struct nfs4_client *clp = sop->so_client;
-
- spin_lock(&clp->cl_lock);
unhash_lockowner_locked(lockowner(sop));
- spin_unlock(&clp->cl_lock);
}
static void nfs4_free_lockowner(struct nfs4_stateowner *sop)