Skip to content

Commit 985eeae

Browse files
neilbrownchucklever
authored andcommitted
nfsd: use clear_and_wake_up_bit()
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 <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent aeddf8e commit 985eeae

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

fs/nfsd/nfs4recover.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,10 +1895,7 @@ nfsd4_cltrack_upcall_lock(struct nfs4_client *clp)
18951895
static void
18961896
nfsd4_cltrack_upcall_unlock(struct nfs4_client *clp)
18971897
{
1898-
smp_mb__before_atomic();
1899-
clear_bit(NFSD4_CLIENT_UPCALL_LOCK, &clp->cl_flags);
1900-
smp_mb__after_atomic();
1901-
wake_up_bit(&clp->cl_flags, NFSD4_CLIENT_UPCALL_LOCK);
1898+
clear_and_wake_up_bit(NFSD4_CLIENT_UPCALL_LOCK, &clp->cl_flags);
19021899
}
19031900

19041901
static void

fs/nfsd/nfs4state.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,8 +3079,7 @@ nfsd4_cb_getattr_release(struct nfsd4_callback *cb)
30793079
struct nfs4_delegation *dp =
30803080
container_of(ncf, struct nfs4_delegation, dl_cb_fattr);
30813081

3082-
clear_bit(CB_GETATTR_BUSY, &ncf->ncf_cb_flags);
3083-
wake_up_bit(&ncf->ncf_cb_flags, CB_GETATTR_BUSY);
3082+
clear_and_wake_up_bit(CB_GETATTR_BUSY, &ncf->ncf_cb_flags);
30843083
nfs4_put_stid(&dp->dl_stid);
30853084
}
30863085

0 commit comments

Comments
 (0)