diff options
author | Peng Tao <bergwolf@gmail.com> | 2014-03-18 09:05:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-19 16:42:38 -0400 |
commit | b7efb98d3b65daf6d0400a91cfcde61d73ec72fd (patch) | |
tree | a3622c86bf24940c2321ea73e3981adf260b462f | |
parent | b3669a7f5481c16870c021cd28a24ec62027773f (diff) |
staging/lustre/libcfs: remove waitq_timedwait
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 files changed, 7 insertions, 21 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h index b9251a59bba1..41fad1ac611c 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h | |||
@@ -51,7 +51,6 @@ void cfs_pause(cfs_duration_t ticks); | |||
51 | typedef void (cfs_timer_func_t)(ulong_ptr_t); | 51 | typedef void (cfs_timer_func_t)(ulong_ptr_t); |
52 | void schedule_timeout_and_set_state(long, int64_t); | 52 | void schedule_timeout_and_set_state(long, int64_t); |
53 | 53 | ||
54 | int64_t waitq_timedwait(wait_queue_t *, long, int64_t); | ||
55 | void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *); | 54 | void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *); |
56 | 55 | ||
57 | void cfs_init_timer(struct timer_list *t); | 56 | void cfs_init_timer(struct timer_list *t); |
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index 07b1da248c04..6173e74d7492 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | |||
@@ -3208,7 +3208,7 @@ kiblnd_connd (void *arg) | |||
3208 | add_wait_queue(&kiblnd_data.kib_connd_waitq, &wait); | 3208 | add_wait_queue(&kiblnd_data.kib_connd_waitq, &wait); |
3209 | spin_unlock_irqrestore(&kiblnd_data.kib_connd_lock, flags); | 3209 | spin_unlock_irqrestore(&kiblnd_data.kib_connd_lock, flags); |
3210 | 3210 | ||
3211 | waitq_timedwait(&wait, TASK_INTERRUPTIBLE, timeout); | 3211 | schedule_timeout(timeout); |
3212 | 3212 | ||
3213 | set_current_state(TASK_RUNNING); | 3213 | set_current_state(TASK_RUNNING); |
3214 | remove_wait_queue(&kiblnd_data.kib_connd_waitq, &wait); | 3214 | remove_wait_queue(&kiblnd_data.kib_connd_waitq, &wait); |
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c index fdf9101fea46..6150d1761c76 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | |||
@@ -2229,7 +2229,7 @@ ksocknal_connd (void *arg) | |||
2229 | spin_unlock_bh(connd_lock); | 2229 | spin_unlock_bh(connd_lock); |
2230 | 2230 | ||
2231 | nloops = 0; | 2231 | nloops = 0; |
2232 | waitq_timedwait(&wait, TASK_INTERRUPTIBLE, timeout); | 2232 | schedule_timeout(timeout); |
2233 | 2233 | ||
2234 | set_current_state(TASK_RUNNING); | 2234 | set_current_state(TASK_RUNNING); |
2235 | remove_wait_queue(&ksocknal_data.ksnd_connd_waitq, &wait); | 2235 | remove_wait_queue(&ksocknal_data.ksnd_connd_waitq, &wait); |
@@ -2639,8 +2639,7 @@ ksocknal_reaper (void *arg) | |||
2639 | if (!ksocknal_data.ksnd_shuttingdown && | 2639 | if (!ksocknal_data.ksnd_shuttingdown && |
2640 | list_empty (&ksocknal_data.ksnd_deathrow_conns) && | 2640 | list_empty (&ksocknal_data.ksnd_deathrow_conns) && |
2641 | list_empty (&ksocknal_data.ksnd_zombie_conns)) | 2641 | list_empty (&ksocknal_data.ksnd_zombie_conns)) |
2642 | waitq_timedwait (&wait, TASK_INTERRUPTIBLE, | 2642 | schedule_timeout(timeout); |
2643 | timeout); | ||
2644 | 2643 | ||
2645 | set_current_state (TASK_RUNNING); | 2644 | set_current_state (TASK_RUNNING); |
2646 | remove_wait_queue (&ksocknal_data.ksnd_reaper_waitq, &wait); | 2645 | remove_wait_queue (&ksocknal_data.ksnd_reaper_waitq, &wait); |
diff --git a/drivers/staging/lustre/lnet/lnet/lib-eq.c b/drivers/staging/lustre/lnet/lnet/lib-eq.c index 65af2018317e..7ce07f61b2e1 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-eq.c +++ b/drivers/staging/lustre/lnet/lnet/lib-eq.c | |||
@@ -347,8 +347,7 @@ lnet_eq_wait_locked(int *timeout_ms) | |||
347 | struct timeval tv; | 347 | struct timeval tv; |
348 | 348 | ||
349 | now = cfs_time_current(); | 349 | now = cfs_time_current(); |
350 | waitq_timedwait(&wl, TASK_INTERRUPTIBLE, | 350 | schedule_timeout(cfs_time_seconds(tms) / 1000); |
351 | cfs_time_seconds(tms) / 1000); | ||
352 | cfs_duration_usec(cfs_time_sub(cfs_time_current(), now), &tv); | 351 | cfs_duration_usec(cfs_time_sub(cfs_time_current(), now), &tv); |
353 | tms -= (int)(tv.tv_sec * 1000 + tv.tv_usec / 1000); | 352 | tms -= (int)(tv.tv_sec * 1000 + tv.tv_usec / 1000); |
354 | if (tms < 0) /* no more wait but may have new event */ | 353 | if (tms < 0) /* no more wait but may have new event */ |
diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index 06954364db5e..0368ca6ffcc1 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h | |||
@@ -564,9 +564,7 @@ do { \ | |||
564 | min_t(cfs_duration_t, \ | 564 | min_t(cfs_duration_t, \ |
565 | info->lwi_interval,__timeout):\ | 565 | info->lwi_interval,__timeout):\ |
566 | __timeout; \ | 566 | __timeout; \ |
567 | cfs_duration_t remaining = waitq_timedwait(&__wait,\ | 567 | cfs_duration_t remaining = schedule_timeout(interval);\ |
568 | __wstate, \ | ||
569 | interval); \ | ||
570 | __timeout = cfs_time_sub(__timeout, \ | 568 | __timeout = cfs_time_sub(__timeout, \ |
571 | cfs_time_sub(interval, remaining));\ | 569 | cfs_time_sub(interval, remaining));\ |
572 | if (__timeout == 0) { \ | 570 | if (__timeout == 0) { \ |
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c index 86475c2b42a7..8aa00e573834 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c | |||
@@ -70,13 +70,6 @@ add_wait_queue_exclusive_head(wait_queue_head_t *waitq, wait_queue_t *link) | |||
70 | } | 70 | } |
71 | EXPORT_SYMBOL(add_wait_queue_exclusive_head); | 71 | EXPORT_SYMBOL(add_wait_queue_exclusive_head); |
72 | 72 | ||
73 | int64_t | ||
74 | waitq_timedwait(wait_queue_t *link, long state, int64_t timeout) | ||
75 | { | ||
76 | return schedule_timeout(timeout); | ||
77 | } | ||
78 | EXPORT_SYMBOL(waitq_timedwait); | ||
79 | |||
80 | void | 73 | void |
81 | schedule_timeout_and_set_state(long state, int64_t timeout) | 74 | schedule_timeout_and_set_state(long state, int64_t timeout) |
82 | { | 75 | { |
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c index 32ed879e66d4..c8599eefeb76 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c | |||
@@ -1079,8 +1079,7 @@ end_loop: | |||
1079 | init_waitqueue_entry(&__wait, current); | 1079 | init_waitqueue_entry(&__wait, current); |
1080 | add_wait_queue(&tctl->tctl_waitq, &__wait); | 1080 | add_wait_queue(&tctl->tctl_waitq, &__wait); |
1081 | set_current_state(TASK_INTERRUPTIBLE); | 1081 | set_current_state(TASK_INTERRUPTIBLE); |
1082 | waitq_timedwait(&__wait, TASK_INTERRUPTIBLE, | 1082 | schedule_timeout(cfs_time_seconds(1)); |
1083 | cfs_time_seconds(1)); | ||
1084 | remove_wait_queue(&tctl->tctl_waitq, &__wait); | 1083 | remove_wait_queue(&tctl->tctl_waitq, &__wait); |
1085 | } | 1084 | } |
1086 | complete(&tctl->tctl_stop); | 1085 | complete(&tctl->tctl_stop); |
diff --git a/drivers/staging/lustre/lustre/libcfs/upcall_cache.c b/drivers/staging/lustre/lustre/libcfs/upcall_cache.c index 8a3b62d08e68..8085e32e5e7a 100644 --- a/drivers/staging/lustre/lustre/libcfs/upcall_cache.c +++ b/drivers/staging/lustre/lustre/libcfs/upcall_cache.c | |||
@@ -223,8 +223,7 @@ find_again: | |||
223 | set_current_state(TASK_INTERRUPTIBLE); | 223 | set_current_state(TASK_INTERRUPTIBLE); |
224 | spin_unlock(&cache->uc_lock); | 224 | spin_unlock(&cache->uc_lock); |
225 | 225 | ||
226 | left = waitq_timedwait(&wait, TASK_INTERRUPTIBLE, | 226 | left = schedule_timeout(expiry); |
227 | expiry); | ||
228 | 227 | ||
229 | spin_lock(&cache->uc_lock); | 228 | spin_lock(&cache->uc_lock); |
230 | remove_wait_queue(&entry->ue_waitq, &wait); | 229 | remove_wait_queue(&entry->ue_waitq, &wait); |