mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
b3669a7f54
commit
b7efb98d3b
|
@ -51,7 +51,6 @@ void cfs_pause(cfs_duration_t ticks);
|
||||||
typedef void (cfs_timer_func_t)(ulong_ptr_t);
|
typedef void (cfs_timer_func_t)(ulong_ptr_t);
|
||||||
void schedule_timeout_and_set_state(long, int64_t);
|
void schedule_timeout_and_set_state(long, int64_t);
|
||||||
|
|
||||||
int64_t waitq_timedwait(wait_queue_t *, long, int64_t);
|
|
||||||
void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *);
|
void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *);
|
||||||
|
|
||||||
void cfs_init_timer(struct timer_list *t);
|
void cfs_init_timer(struct timer_list *t);
|
||||||
|
|
|
@ -3208,7 +3208,7 @@ kiblnd_connd (void *arg)
|
||||||
add_wait_queue(&kiblnd_data.kib_connd_waitq, &wait);
|
add_wait_queue(&kiblnd_data.kib_connd_waitq, &wait);
|
||||||
spin_unlock_irqrestore(&kiblnd_data.kib_connd_lock, flags);
|
spin_unlock_irqrestore(&kiblnd_data.kib_connd_lock, flags);
|
||||||
|
|
||||||
waitq_timedwait(&wait, TASK_INTERRUPTIBLE, timeout);
|
schedule_timeout(timeout);
|
||||||
|
|
||||||
set_current_state(TASK_RUNNING);
|
set_current_state(TASK_RUNNING);
|
||||||
remove_wait_queue(&kiblnd_data.kib_connd_waitq, &wait);
|
remove_wait_queue(&kiblnd_data.kib_connd_waitq, &wait);
|
||||||
|
|
|
@ -2229,7 +2229,7 @@ ksocknal_connd (void *arg)
|
||||||
spin_unlock_bh(connd_lock);
|
spin_unlock_bh(connd_lock);
|
||||||
|
|
||||||
nloops = 0;
|
nloops = 0;
|
||||||
waitq_timedwait(&wait, TASK_INTERRUPTIBLE, timeout);
|
schedule_timeout(timeout);
|
||||||
|
|
||||||
set_current_state(TASK_RUNNING);
|
set_current_state(TASK_RUNNING);
|
||||||
remove_wait_queue(&ksocknal_data.ksnd_connd_waitq, &wait);
|
remove_wait_queue(&ksocknal_data.ksnd_connd_waitq, &wait);
|
||||||
|
@ -2639,8 +2639,7 @@ ksocknal_reaper (void *arg)
|
||||||
if (!ksocknal_data.ksnd_shuttingdown &&
|
if (!ksocknal_data.ksnd_shuttingdown &&
|
||||||
list_empty (&ksocknal_data.ksnd_deathrow_conns) &&
|
list_empty (&ksocknal_data.ksnd_deathrow_conns) &&
|
||||||
list_empty (&ksocknal_data.ksnd_zombie_conns))
|
list_empty (&ksocknal_data.ksnd_zombie_conns))
|
||||||
waitq_timedwait (&wait, TASK_INTERRUPTIBLE,
|
schedule_timeout(timeout);
|
||||||
timeout);
|
|
||||||
|
|
||||||
set_current_state (TASK_RUNNING);
|
set_current_state (TASK_RUNNING);
|
||||||
remove_wait_queue (&ksocknal_data.ksnd_reaper_waitq, &wait);
|
remove_wait_queue (&ksocknal_data.ksnd_reaper_waitq, &wait);
|
||||||
|
|
|
@ -347,8 +347,7 @@ lnet_eq_wait_locked(int *timeout_ms)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
now = cfs_time_current();
|
now = cfs_time_current();
|
||||||
waitq_timedwait(&wl, TASK_INTERRUPTIBLE,
|
schedule_timeout(cfs_time_seconds(tms) / 1000);
|
||||||
cfs_time_seconds(tms) / 1000);
|
|
||||||
cfs_duration_usec(cfs_time_sub(cfs_time_current(), now), &tv);
|
cfs_duration_usec(cfs_time_sub(cfs_time_current(), now), &tv);
|
||||||
tms -= (int)(tv.tv_sec * 1000 + tv.tv_usec / 1000);
|
tms -= (int)(tv.tv_sec * 1000 + tv.tv_usec / 1000);
|
||||||
if (tms < 0) /* no more wait but may have new event */
|
if (tms < 0) /* no more wait but may have new event */
|
||||||
|
|
|
@ -564,9 +564,7 @@ do { \
|
||||||
min_t(cfs_duration_t, \
|
min_t(cfs_duration_t, \
|
||||||
info->lwi_interval,__timeout):\
|
info->lwi_interval,__timeout):\
|
||||||
__timeout; \
|
__timeout; \
|
||||||
cfs_duration_t remaining = waitq_timedwait(&__wait,\
|
cfs_duration_t remaining = schedule_timeout(interval);\
|
||||||
__wstate, \
|
|
||||||
interval); \
|
|
||||||
__timeout = cfs_time_sub(__timeout, \
|
__timeout = cfs_time_sub(__timeout, \
|
||||||
cfs_time_sub(interval, remaining));\
|
cfs_time_sub(interval, remaining));\
|
||||||
if (__timeout == 0) { \
|
if (__timeout == 0) { \
|
||||||
|
|
|
@ -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);
|
EXPORT_SYMBOL(add_wait_queue_exclusive_head);
|
||||||
|
|
||||||
int64_t
|
|
||||||
waitq_timedwait(wait_queue_t *link, long state, int64_t timeout)
|
|
||||||
{
|
|
||||||
return schedule_timeout(timeout);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(waitq_timedwait);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
schedule_timeout_and_set_state(long state, int64_t timeout)
|
schedule_timeout_and_set_state(long state, int64_t timeout)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1079,8 +1079,7 @@ static int tracefiled(void *arg)
|
||||||
init_waitqueue_entry(&__wait, current);
|
init_waitqueue_entry(&__wait, current);
|
||||||
add_wait_queue(&tctl->tctl_waitq, &__wait);
|
add_wait_queue(&tctl->tctl_waitq, &__wait);
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
waitq_timedwait(&__wait, TASK_INTERRUPTIBLE,
|
schedule_timeout(cfs_time_seconds(1));
|
||||||
cfs_time_seconds(1));
|
|
||||||
remove_wait_queue(&tctl->tctl_waitq, &__wait);
|
remove_wait_queue(&tctl->tctl_waitq, &__wait);
|
||||||
}
|
}
|
||||||
complete(&tctl->tctl_stop);
|
complete(&tctl->tctl_stop);
|
||||||
|
|
|
@ -223,8 +223,7 @@ struct upcall_cache_entry *upcall_cache_get_entry(struct upcall_cache *cache,
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
spin_unlock(&cache->uc_lock);
|
spin_unlock(&cache->uc_lock);
|
||||||
|
|
||||||
left = waitq_timedwait(&wait, TASK_INTERRUPTIBLE,
|
left = schedule_timeout(expiry);
|
||||||
expiry);
|
|
||||||
|
|
||||||
spin_lock(&cache->uc_lock);
|
spin_lock(&cache->uc_lock);
|
||||||
remove_wait_queue(&entry->ue_waitq, &wait);
|
remove_wait_queue(&entry->ue_waitq, &wait);
|
||||||
|
|
Loading…
Reference in New Issue