Commit 723c921e authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched/wait, fs/nfs: Convert wait_on_atomic_t() usage to the new wait_var_event() API

The old wait_on_atomic_t() is going to get removed, use the more
flexible wait_var_event() API instead.

No change in functionality.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent dc5d4afb
...@@ -85,11 +85,6 @@ int nfs_wait_bit_killable(struct wait_bit_key *key, int mode) ...@@ -85,11 +85,6 @@ int nfs_wait_bit_killable(struct wait_bit_key *key, int mode)
} }
EXPORT_SYMBOL_GPL(nfs_wait_bit_killable); EXPORT_SYMBOL_GPL(nfs_wait_bit_killable);
int nfs_wait_atomic_killable(atomic_t *p, unsigned int mode)
{
return nfs_wait_killable(mode);
}
/** /**
* nfs_compat_user_ino64 - returns the user-visible inode number * nfs_compat_user_ino64 - returns the user-visible inode number
* @fileid: 64-bit fileid * @fileid: 64-bit fileid
......
...@@ -98,8 +98,8 @@ nfs_page_free(struct nfs_page *p) ...@@ -98,8 +98,8 @@ nfs_page_free(struct nfs_page *p)
int int
nfs_iocounter_wait(struct nfs_lock_context *l_ctx) nfs_iocounter_wait(struct nfs_lock_context *l_ctx)
{ {
return wait_on_atomic_t(&l_ctx->io_count, nfs_wait_atomic_killable, return wait_var_event_killable(&l_ctx->io_count,
TASK_KILLABLE); !atomic_read(&l_ctx->io_count));
} }
/** /**
...@@ -395,7 +395,7 @@ static void nfs_clear_request(struct nfs_page *req) ...@@ -395,7 +395,7 @@ static void nfs_clear_request(struct nfs_page *req)
} }
if (l_ctx != NULL) { if (l_ctx != NULL) {
if (atomic_dec_and_test(&l_ctx->io_count)) { if (atomic_dec_and_test(&l_ctx->io_count)) {
wake_up_atomic_t(&l_ctx->io_count); wake_up_var(&l_ctx->io_count);
if (test_bit(NFS_CONTEXT_UNLOCK, &ctx->flags)) if (test_bit(NFS_CONTEXT_UNLOCK, &ctx->flags))
rpc_wake_up(&NFS_SERVER(d_inode(ctx->dentry))->uoc_rpcwaitq); rpc_wake_up(&NFS_SERVER(d_inode(ctx->dentry))->uoc_rpcwaitq);
} }
......
...@@ -245,7 +245,7 @@ pnfs_generic_commit_cancel_empty_pagelist(struct list_head *pages, ...@@ -245,7 +245,7 @@ pnfs_generic_commit_cancel_empty_pagelist(struct list_head *pages,
{ {
if (list_empty(pages)) { if (list_empty(pages)) {
if (atomic_dec_and_test(&cinfo->mds->rpcs_out)) if (atomic_dec_and_test(&cinfo->mds->rpcs_out))
wake_up_atomic_t(&cinfo->mds->rpcs_out); wake_up_var(&cinfo->mds->rpcs_out);
/* don't call nfs_commitdata_release - it tries to put /* don't call nfs_commitdata_release - it tries to put
* the open_context which is not acquired until nfs_init_commit * the open_context which is not acquired until nfs_init_commit
* which has not been called on @data */ * which has not been called on @data */
......
...@@ -1620,8 +1620,8 @@ static void nfs_writeback_result(struct rpc_task *task, ...@@ -1620,8 +1620,8 @@ static void nfs_writeback_result(struct rpc_task *task,
static int wait_on_commit(struct nfs_mds_commit_info *cinfo) static int wait_on_commit(struct nfs_mds_commit_info *cinfo)
{ {
return wait_on_atomic_t(&cinfo->rpcs_out, return wait_var_event_killable(&cinfo->rpcs_out,
nfs_wait_atomic_killable, TASK_KILLABLE); !atomic_read(&cinfo->rpcs_out));
} }
static void nfs_commit_begin(struct nfs_mds_commit_info *cinfo) static void nfs_commit_begin(struct nfs_mds_commit_info *cinfo)
...@@ -1632,7 +1632,7 @@ static void nfs_commit_begin(struct nfs_mds_commit_info *cinfo) ...@@ -1632,7 +1632,7 @@ static void nfs_commit_begin(struct nfs_mds_commit_info *cinfo)
static void nfs_commit_end(struct nfs_mds_commit_info *cinfo) static void nfs_commit_end(struct nfs_mds_commit_info *cinfo)
{ {
if (atomic_dec_and_test(&cinfo->rpcs_out)) if (atomic_dec_and_test(&cinfo->rpcs_out))
wake_up_atomic_t(&cinfo->rpcs_out); wake_up_var(&cinfo->rpcs_out);
} }
void nfs_commitdata_release(struct nfs_commit_data *data) void nfs_commitdata_release(struct nfs_commit_data *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment