mirror of https://gitee.com/openkylin/linux.git
sched/wait, fs/afs: 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: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: David Howells <dhowells@redhat.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: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
f0baa040f7
commit
ab1fbe3247
|
@ -25,7 +25,7 @@ static void afs_manage_cell(struct work_struct *);
|
|||
static void afs_dec_cells_outstanding(struct afs_net *net)
|
||||
{
|
||||
if (atomic_dec_and_test(&net->cells_outstanding))
|
||||
wake_up_atomic_t(&net->cells_outstanding);
|
||||
wake_up_var(&net->cells_outstanding);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -764,7 +764,7 @@ void afs_cell_purge(struct afs_net *net)
|
|||
afs_queue_cell_manager(net);
|
||||
|
||||
_debug("wait");
|
||||
wait_on_atomic_t(&net->cells_outstanding, atomic_t_wait,
|
||||
TASK_UNINTERRUPTIBLE);
|
||||
wait_var_event(&net->cells_outstanding,
|
||||
!atomic_read(&net->cells_outstanding));
|
||||
_leave("");
|
||||
}
|
||||
|
|
|
@ -103,8 +103,8 @@ void afs_close_socket(struct afs_net *net)
|
|||
}
|
||||
|
||||
_debug("outstanding %u", atomic_read(&net->nr_outstanding_calls));
|
||||
wait_on_atomic_t(&net->nr_outstanding_calls, atomic_t_wait,
|
||||
TASK_UNINTERRUPTIBLE);
|
||||
wait_var_event(&net->nr_outstanding_calls,
|
||||
!atomic_read(&net->nr_outstanding_calls));
|
||||
_debug("no outstanding calls");
|
||||
|
||||
kernel_sock_shutdown(net->socket, SHUT_RDWR);
|
||||
|
@ -175,7 +175,7 @@ void afs_put_call(struct afs_call *call)
|
|||
trace_afs_call(call, afs_call_trace_free, 0, o,
|
||||
__builtin_return_address(0));
|
||||
if (o == 0)
|
||||
wake_up_atomic_t(&net->nr_outstanding_calls);
|
||||
wake_up_var(&net->nr_outstanding_calls);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ static void afs_inc_servers_outstanding(struct afs_net *net)
|
|||
static void afs_dec_servers_outstanding(struct afs_net *net)
|
||||
{
|
||||
if (atomic_dec_and_test(&net->servers_outstanding))
|
||||
wake_up_atomic_t(&net->servers_outstanding);
|
||||
wake_up_var(&net->servers_outstanding);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -521,8 +521,8 @@ void afs_purge_servers(struct afs_net *net)
|
|||
afs_queue_server_manager(net);
|
||||
|
||||
_debug("wait");
|
||||
wait_on_atomic_t(&net->servers_outstanding, atomic_t_wait,
|
||||
TASK_UNINTERRUPTIBLE);
|
||||
wait_var_event(&net->servers_outstanding,
|
||||
!atomic_read(&net->servers_outstanding));
|
||||
_leave("");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue