]> git.dujemihanovic.xyz Git - linux.git/commitdiff
nfsd: use clear_and_wake_up_bit()
authorNeilBrown <neilb@suse.de>
Fri, 30 Aug 2024 07:03:16 +0000 (17:03 +1000)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 20 Sep 2024 23:31:03 +0000 (19:31 -0400)
nfsd has two places that open-code clear_and_wake_up_bit().  One has
the required memory barriers.  The other does not.

Change both to use clear_and_wake_up_bit() so we have the barriers
without the noise.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4state.c

index 67d8673a9391c7f58b713a6f7752af2ab78ef3fd..0d25ad5eeae3304d3633de23b92f19aaa692a7be 100644 (file)
@@ -1895,10 +1895,7 @@ nfsd4_cltrack_upcall_lock(struct nfs4_client *clp)
 static void
 nfsd4_cltrack_upcall_unlock(struct nfs4_client *clp)
 {
-       smp_mb__before_atomic();
-       clear_bit(NFSD4_CLIENT_UPCALL_LOCK, &clp->cl_flags);
-       smp_mb__after_atomic();
-       wake_up_bit(&clp->cl_flags, NFSD4_CLIENT_UPCALL_LOCK);
+       clear_and_wake_up_bit(NFSD4_CLIENT_UPCALL_LOCK, &clp->cl_flags);
 }
 
 static void
index eaa11d42d1b1e789abd4fdd04ca3bf8a1ae17487..0ea70d615c78d40a21df330c582632e1c56e4dcc 100644 (file)
@@ -3079,8 +3079,7 @@ nfsd4_cb_getattr_release(struct nfsd4_callback *cb)
        struct nfs4_delegation *dp =
                        container_of(ncf, struct nfs4_delegation, dl_cb_fattr);
 
-       clear_bit(CB_GETATTR_BUSY, &ncf->ncf_cb_flags);
-       wake_up_bit(&ncf->ncf_cb_flags, CB_GETATTR_BUSY);
+       clear_and_wake_up_bit(CB_GETATTR_BUSY, &ncf->ncf_cb_flags);
        nfs4_put_stid(&dp->dl_stid);
 }