Skip to content

Commit

Permalink
staging/lustre/libcfs: remove waitq_wait
Browse files Browse the repository at this point in the history
Cc: Andreas Dilger <[email protected]>
Cc: Oleg Drokin <[email protected]>
Signed-off-by: Peng Tao <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
bergwolf authored and gregkh committed Mar 19, 2014
1 parent 9e795d3 commit b3669a7
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 19 deletions.
1 change: 0 additions & 1 deletion drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ typedef void (cfs_timer_func_t)(ulong_ptr_t);
void schedule_timeout_and_set_state(long, int64_t);

int64_t waitq_timedwait(wait_queue_t *, long, int64_t);
void waitq_wait(wait_queue_t *, long);
void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *);

void cfs_init_timer(struct timer_list *t);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3423,7 +3423,7 @@ kiblnd_scheduler(void *arg)
add_wait_queue_exclusive(&sched->ibs_waitq, &wait);
spin_unlock_irqrestore(&sched->ibs_lock, flags);

waitq_wait(&wait, TASK_INTERRUPTIBLE);
schedule();
busy_loops = 0;

remove_wait_queue(&sched->ibs_waitq, &wait);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lnet/lnet/lib-eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ lnet_eq_wait_locked(int *timeout_ms)
lnet_eq_wait_unlock();

if (tms < 0) {
waitq_wait(&wl, TASK_INTERRUPTIBLE);
schedule();

} else {
struct timeval tv;
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/lustre/lustre/fid/fid_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static int seq_fid_alloc_prep(struct lu_client_seq *seq,
set_current_state(TASK_UNINTERRUPTIBLE);
mutex_unlock(&seq->lcs_mutex);

waitq_wait(link, TASK_UNINTERRUPTIBLE);
schedule();

mutex_lock(&seq->lcs_mutex);
remove_wait_queue(&seq->lcs_waitq, link);
Expand Down Expand Up @@ -378,7 +378,7 @@ void seq_client_flush(struct lu_client_seq *seq)
set_current_state(TASK_UNINTERRUPTIBLE);
mutex_unlock(&seq->lcs_mutex);

waitq_wait(&link, TASK_UNINTERRUPTIBLE);
schedule();

mutex_lock(&seq->lcs_mutex);
remove_wait_queue(&seq->lcs_waitq, &link);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/include/lustre_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ do { \
break; \
\
if (__timeout == 0) { \
waitq_wait(&__wait, __wstate); \
schedule(); \
} else { \
cfs_duration_t interval = info->lwi_interval? \
min_t(cfs_duration_t, \
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/lclient/lcommon_cl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ static void cl_object_put_last(struct lu_env *env, struct cl_object *obj)
set_current_state(TASK_UNINTERRUPTIBLE);
if (atomic_read(&header->loh_ref) == 1)
break;
waitq_wait(&waiter, TASK_UNINTERRUPTIBLE);
schedule();
}

set_current_state(TASK_RUNNING);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/libcfs/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void libcfs_debug_dumplog(void)
printk(KERN_ERR "LustreError: cannot start log dump thread:"
" %ld\n", PTR_ERR(dumper));
else
waitq_wait(&wait, TASK_INTERRUPTIBLE);
schedule();

/* be sure to teardown if cfs_create_thread() failed */
remove_wait_queue(&debug_ctlwq, &wait);
Expand Down
7 changes: 0 additions & 7 deletions drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,6 @@ add_wait_queue_exclusive_head(wait_queue_head_t *waitq, wait_queue_t *link)
}
EXPORT_SYMBOL(add_wait_queue_exclusive_head);

void
waitq_wait(wait_queue_t *link, long state)
{
schedule();
}
EXPORT_SYMBOL(waitq_wait);

int64_t
waitq_timedwait(wait_queue_t *link, long state, int64_t timeout)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/lov/lov_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ static void lov_subobject_kill(const struct lu_env *env, struct lov_object *lov,
spin_lock(&r0->lo_sub_lock);
if (r0->lo_sub[idx] == los) {
spin_unlock(&r0->lo_sub_lock);
waitq_wait(waiter, TASK_UNINTERRUPTIBLE);
schedule();
} else {
spin_unlock(&r0->lo_sub_lock);
set_current_state(TASK_RUNNING);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/obdclass/cl_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ int cl_lock_state_wait(const struct lu_env *env, struct cl_lock *lock)
* can be restarted if signals are pending here */
result = -ERESTARTSYS;
if (likely(!OBD_FAIL_CHECK(OBD_FAIL_LOCK_STATE_WAIT_INTR))) {
waitq_wait(&waiter, TASK_INTERRUPTIBLE);
schedule();
if (!cfs_signal_pending())
result = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/obdclass/lu_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ struct lu_object *lu_object_find_at(const struct lu_env *env,
* lu_object_find_try() already added waiter into the
* wait queue.
*/
waitq_wait(&wait, TASK_UNINTERRUPTIBLE);
schedule();
bkt = lu_site_bkt_from_fid(dev->ld_site, (void *)f);
remove_wait_queue(&bkt->lsb_marche_funebre, &wait);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ int sptlrpc_enc_pool_get_pages(struct ptlrpc_bulk_desc *desc)
add_wait_queue(&page_pools.epp_waitq, &waitlink);

spin_unlock(&page_pools.epp_lock);
waitq_wait(&waitlink, TASK_UNINTERRUPTIBLE);
schedule();
remove_wait_queue(&page_pools.epp_waitq, &waitlink);
LASSERT(page_pools.epp_waitqlen > 0);
spin_lock(&page_pools.epp_lock);
Expand Down

0 comments on commit b3669a7

Please sign in to comment.