diff options
author | Peng Tao <bergwolf@gmail.com> | 2014-03-18 09:05:55 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-19 16:42:38 -0400 |
commit | 18fd5baa32f41b82d689d5d070577c9e2ccde986 (patch) | |
tree | 89189e3f0aba254a4cce9ffab44e3f2ed239aba3 | |
parent | b7efb98d3b65daf6d0400a91cfcde61d73ec72fd (diff) |
staging/lustre/libcfs: remove schedule_timeout_and_set_state
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>
-rw-r--r-- | drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h | 1 | ||||
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/router.c | 4 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 4 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/fail.c | 4 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c | 8 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/obdclass/genops.c | 4 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/obdecho/echo.c | 3 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/obdecho/echo_client.c | 4 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/ptlrpc/sec.c | 4 |
9 files changed, 14 insertions, 22 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h index 41fad1ac611c..5d1312469cef 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h | |||
@@ -49,7 +49,6 @@ void cfs_pause(cfs_duration_t ticks); | |||
49 | * Timer | 49 | * Timer |
50 | */ | 50 | */ |
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); | ||
53 | 52 | ||
54 | void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *); | 53 | void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *); |
55 | 54 | ||
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index d1ee44232eef..8ea89428d639 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c | |||
@@ -1209,8 +1209,8 @@ rescan: | |||
1209 | /* Call cfs_pause() here always adds 1 to load average | 1209 | /* Call cfs_pause() here always adds 1 to load average |
1210 | * because kernel counts # active tasks as nr_running | 1210 | * because kernel counts # active tasks as nr_running |
1211 | * + nr_uninterruptible. */ | 1211 | * + nr_uninterruptible. */ |
1212 | schedule_timeout_and_set_state(TASK_INTERRUPTIBLE, | 1212 | set_current_state(TASK_INTERRUPTIBLE); |
1213 | cfs_time_seconds(1)); | 1213 | schedule_timeout(cfs_time_seconds(1)); |
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_STOPPING); | 1216 | LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_STOPPING); |
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index d87048dcc70c..7e63cf355cd9 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | |||
@@ -192,8 +192,8 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req, | |||
192 | if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_BL_CB_RACE)) { | 192 | if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_BL_CB_RACE)) { |
193 | int to = cfs_time_seconds(1); | 193 | int to = cfs_time_seconds(1); |
194 | while (to > 0) { | 194 | while (to > 0) { |
195 | schedule_timeout_and_set_state( | 195 | set_current_state(TASK_INTERRUPTIBLE); |
196 | TASK_INTERRUPTIBLE, to); | 196 | schedule_timeout(to); |
197 | if (lock->l_granted_mode == lock->l_req_mode || | 197 | if (lock->l_granted_mode == lock->l_req_mode || |
198 | lock->l_flags & LDLM_FL_DESTROYED) | 198 | lock->l_flags & LDLM_FL_DESTROYED) |
199 | break; | 199 | break; |
diff --git a/drivers/staging/lustre/lustre/libcfs/fail.c b/drivers/staging/lustre/lustre/libcfs/fail.c index c54448d69008..ba43ff7f7900 100644 --- a/drivers/staging/lustre/lustre/libcfs/fail.c +++ b/drivers/staging/lustre/lustre/libcfs/fail.c | |||
@@ -127,8 +127,8 @@ int __cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set) | |||
127 | if (ret) { | 127 | if (ret) { |
128 | CERROR("cfs_fail_timeout id %x sleeping for %dms\n", | 128 | CERROR("cfs_fail_timeout id %x sleeping for %dms\n", |
129 | id, ms); | 129 | id, ms); |
130 | schedule_timeout_and_set_state(TASK_UNINTERRUPTIBLE, | 130 | set_current_state(TASK_UNINTERRUPTIBLE); |
131 | cfs_time_seconds(ms) / 1000); | 131 | schedule_timeout(cfs_time_seconds(ms) / 1000); |
132 | set_current_state(TASK_RUNNING); | 132 | set_current_state(TASK_RUNNING); |
133 | CERROR("cfs_fail_timeout id %x awake\n", id); | 133 | CERROR("cfs_fail_timeout id %x awake\n", id); |
134 | } | 134 | } |
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c index 8aa00e573834..fdb4cdb143a2 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c | |||
@@ -70,14 +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 | void | ||
74 | schedule_timeout_and_set_state(long state, int64_t timeout) | ||
75 | { | ||
76 | set_current_state(state); | ||
77 | schedule_timeout(timeout); | ||
78 | } | ||
79 | EXPORT_SYMBOL(schedule_timeout_and_set_state); | ||
80 | |||
81 | /* deschedule for a bit... */ | 73 | /* deschedule for a bit... */ |
82 | void | 74 | void |
83 | cfs_pause(cfs_duration_t ticks) | 75 | cfs_pause(cfs_duration_t ticks) |
diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 169c9ed56521..f2bdea33041d 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c | |||
@@ -1534,8 +1534,8 @@ void obd_exports_barrier(struct obd_device *obd) | |||
1534 | spin_lock(&obd->obd_dev_lock); | 1534 | spin_lock(&obd->obd_dev_lock); |
1535 | while (!list_empty(&obd->obd_unlinked_exports)) { | 1535 | while (!list_empty(&obd->obd_unlinked_exports)) { |
1536 | spin_unlock(&obd->obd_dev_lock); | 1536 | spin_unlock(&obd->obd_dev_lock); |
1537 | schedule_timeout_and_set_state(TASK_UNINTERRUPTIBLE, | 1537 | set_current_state(TASK_UNINTERRUPTIBLE); |
1538 | cfs_time_seconds(waited)); | 1538 | schedule_timeout(cfs_time_seconds(waited)); |
1539 | if (waited > 5 && IS_PO2(waited)) { | 1539 | if (waited > 5 && IS_PO2(waited)) { |
1540 | LCONSOLE_WARN("%s is waiting for obd_unlinked_exports " | 1540 | LCONSOLE_WARN("%s is waiting for obd_unlinked_exports " |
1541 | "more than %d seconds. " | 1541 | "more than %d seconds. " |
diff --git a/drivers/staging/lustre/lustre/obdecho/echo.c b/drivers/staging/lustre/lustre/obdecho/echo.c index debb9cec4900..96a807f82ec1 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo.c +++ b/drivers/staging/lustre/lustre/obdecho/echo.c | |||
@@ -606,7 +606,8 @@ static int echo_cleanup(struct obd_device *obd) | |||
606 | 606 | ||
607 | /* XXX Bug 3413; wait for a bit to ensure the BL callback has | 607 | /* XXX Bug 3413; wait for a bit to ensure the BL callback has |
608 | * happened before calling ldlm_namespace_free() */ | 608 | * happened before calling ldlm_namespace_free() */ |
609 | schedule_timeout_and_set_state(TASK_UNINTERRUPTIBLE, cfs_time_seconds(1)); | 609 | set_current_state(TASK_UNINTERRUPTIBLE); |
610 | schedule_timeout(cfs_time_seconds(1)); | ||
610 | 611 | ||
611 | ldlm_namespace_free(obd->obd_namespace, NULL, obd->obd_force); | 612 | ldlm_namespace_free(obd->obd_namespace, NULL, obd->obd_force); |
612 | obd->obd_namespace = NULL; | 613 | obd->obd_namespace = NULL; |
diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 268a202c21e5..754aa8e55665 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c | |||
@@ -997,8 +997,8 @@ static struct lu_device *echo_device_free(const struct lu_env *env, | |||
997 | spin_unlock(&ec->ec_lock); | 997 | spin_unlock(&ec->ec_lock); |
998 | CERROR("echo_client still has objects at cleanup time, " | 998 | CERROR("echo_client still has objects at cleanup time, " |
999 | "wait for 1 second\n"); | 999 | "wait for 1 second\n"); |
1000 | schedule_timeout_and_set_state(TASK_UNINTERRUPTIBLE, | 1000 | set_current_state(TASK_UNINTERRUPTIBLE); |
1001 | cfs_time_seconds(1)); | 1001 | schedule_timeout(cfs_time_seconds(1)); |
1002 | lu_site_purge(env, &ed->ed_site->cs_lu, -1); | 1002 | lu_site_purge(env, &ed->ed_site->cs_lu, -1); |
1003 | spin_lock(&ec->ec_lock); | 1003 | spin_lock(&ec->ec_lock); |
1004 | } | 1004 | } |
diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index 9145dd25023b..d80418057f29 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c | |||
@@ -543,8 +543,8 @@ int sptlrpc_req_replace_dead_ctx(struct ptlrpc_request *req) | |||
543 | "ctx (%p, fl %lx) doesn't switch, relax a little bit\n", | 543 | "ctx (%p, fl %lx) doesn't switch, relax a little bit\n", |
544 | newctx, newctx->cc_flags); | 544 | newctx, newctx->cc_flags); |
545 | 545 | ||
546 | schedule_timeout_and_set_state(TASK_INTERRUPTIBLE, | 546 | set_current_state(TASK_INTERRUPTIBLE); |
547 | HZ); | 547 | schedule_timeout(HZ); |
548 | } else { | 548 | } else { |
549 | /* | 549 | /* |
550 | * it's possible newctx == oldctx if we're switching | 550 | * it's possible newctx == oldctx if we're switching |