@@ -557,8 +557,7 @@ static void nfs_clear_request(struct nfs_page *req)
req->wb_page = NULL;
}
if (l_ctx != NULL) {
- if (atomic_dec_and_test(&l_ctx->io_count)) {
- wake_up_var(&l_ctx->io_count);
+ if (atomic_dec_and_wake_up(&l_ctx->io_count)) {
ctx = l_ctx->open_context;
if (test_bit(NFS_CONTEXT_UNLOCK, &ctx->flags))
rpc_wake_up(&NFS_SERVER(d_inode(ctx->dentry))->uoc_rpcwaitq);
@@ -1658,11 +1658,7 @@ void nfs_commit_begin(struct nfs_mds_commit_info *cinfo)
bool nfs_commit_end(struct nfs_mds_commit_info *cinfo)
{
- if (atomic_dec_and_test(&cinfo->rpcs_out)) {
- wake_up_var(&cinfo->rpcs_out);
- return true;
- }
- return false;
+ return atomic_dec_and_wake_up(&cinfo->rpcs_out);
}
void nfs_commitdata_release(struct nfs_commit_data *data)
In two places nfs uses wake_up_var() after atomic_dec_and_test() on the same var. This is correct as no extra barriers are needed in this case. This can be made more clear by using the atomic_dec_and_wake_up() interface. Signed-off-by: NeilBrown <neilb@suse.de> --- fs/nfs/pagelist.c | 3 +-- fs/nfs/write.c | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-)