staging/lustre/libcfs: remove schedule_timeout_and_set_state
authorPeng Tao <bergwolf@gmail.com>
Tue, 18 Mar 2014 13:05:55 +0000 (21:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Mar 2014 20:42:38 +0000 (13:42 -0700)
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>
drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
drivers/staging/lustre/lnet/lnet/router.c
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
drivers/staging/lustre/lustre/libcfs/fail.c
drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
drivers/staging/lustre/lustre/obdclass/genops.c
drivers/staging/lustre/lustre/obdecho/echo.c
drivers/staging/lustre/lustre/obdecho/echo_client.c
drivers/staging/lustre/lustre/ptlrpc/sec.c

index 41fad1ac611c94404a3f58e1be6f709241201f1f..5d1312469ceffaed06bf7f6311e3e07d584cfe8d 100644 (file)
@@ -49,7 +49,6 @@ void cfs_pause(cfs_duration_t ticks);
  * Timer
  */
 typedef  void (cfs_timer_func_t)(ulong_ptr_t);
-void schedule_timeout_and_set_state(long, int64_t);
 
 void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *);
 
index d1ee44232eefab83765a36378f5193c1c68dc1df..8ea89428d639084c0c0d7ec8f0ebcd3b9308c9f2 100644 (file)
@@ -1209,8 +1209,8 @@ rescan:
                /* Call cfs_pause() here always adds 1 to load average
                 * because kernel counts # active tasks as nr_running
                 * + nr_uninterruptible. */
-               schedule_timeout_and_set_state(TASK_INTERRUPTIBLE,
-                                                  cfs_time_seconds(1));
+               set_current_state(TASK_INTERRUPTIBLE);
+               schedule_timeout(cfs_time_seconds(1));
        }
 
        LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_STOPPING);
index d87048dcc70c25cec635dbbb278d37f5146fed7a..7e63cf355cd9ead5766793c1c25649cad8a134ba 100644 (file)
@@ -192,8 +192,8 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req,
        if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_BL_CB_RACE)) {
                int to = cfs_time_seconds(1);
                while (to > 0) {
-                       schedule_timeout_and_set_state(
-                               TASK_INTERRUPTIBLE, to);
+                       set_current_state(TASK_INTERRUPTIBLE);
+                       schedule_timeout(to);
                        if (lock->l_granted_mode == lock->l_req_mode ||
                            lock->l_flags & LDLM_FL_DESTROYED)
                                break;
index c54448d69008c1c11ea5af3731185ad36b24b9f6..ba43ff7f7900950eb94286ed65fecd381e7f2c5c 100644 (file)
@@ -127,8 +127,8 @@ int __cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set)
        if (ret) {
                CERROR("cfs_fail_timeout id %x sleeping for %dms\n",
                       id, ms);
-               schedule_timeout_and_set_state(TASK_UNINTERRUPTIBLE,
-                                                  cfs_time_seconds(ms) / 1000);
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               schedule_timeout(cfs_time_seconds(ms) / 1000);
                set_current_state(TASK_RUNNING);
                CERROR("cfs_fail_timeout id %x awake\n", id);
        }
index 8aa00e5738346b704630fb533face1ea9def1486..fdb4cdb143a2dd842ac8fca7964a3e2b43d7cec1 100644 (file)
@@ -70,14 +70,6 @@ add_wait_queue_exclusive_head(wait_queue_head_t *waitq, wait_queue_t *link)
 }
 EXPORT_SYMBOL(add_wait_queue_exclusive_head);
 
-void
-schedule_timeout_and_set_state(long state, int64_t timeout)
-{
-       set_current_state(state);
-       schedule_timeout(timeout);
-}
-EXPORT_SYMBOL(schedule_timeout_and_set_state);
-
 /* deschedule for a bit... */
 void
 cfs_pause(cfs_duration_t ticks)
index 169c9ed56521abdbf32d0c8902bcee8ae98d7f9c..f2bdea33041da230bd5430834b055fc6bc04a4e1 100644 (file)
@@ -1534,8 +1534,8 @@ void obd_exports_barrier(struct obd_device *obd)
        spin_lock(&obd->obd_dev_lock);
        while (!list_empty(&obd->obd_unlinked_exports)) {
                spin_unlock(&obd->obd_dev_lock);
-               schedule_timeout_and_set_state(TASK_UNINTERRUPTIBLE,
-                                                  cfs_time_seconds(waited));
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               schedule_timeout(cfs_time_seconds(waited));
                if (waited > 5 && IS_PO2(waited)) {
                        LCONSOLE_WARN("%s is waiting for obd_unlinked_exports "
                                      "more than %d seconds. "
index debb9cec4900ab6b6b7ef51a3c69f2163df5ed8b..96a807f82ec10f6d31c1c0b6d30b7a256e451045 100644 (file)
@@ -606,7 +606,8 @@ static int echo_cleanup(struct obd_device *obd)
 
        /* XXX Bug 3413; wait for a bit to ensure the BL callback has
         * happened before calling ldlm_namespace_free() */
-       schedule_timeout_and_set_state(TASK_UNINTERRUPTIBLE, cfs_time_seconds(1));
+       set_current_state(TASK_UNINTERRUPTIBLE);
+       schedule_timeout(cfs_time_seconds(1));
 
        ldlm_namespace_free(obd->obd_namespace, NULL, obd->obd_force);
        obd->obd_namespace = NULL;
index 268a202c21e54a8e446abd4827875b3832f8c8eb..754aa8e5566526f8edbe462a67b9a091ded5f7e8 100644 (file)
@@ -997,8 +997,8 @@ static struct lu_device *echo_device_free(const struct lu_env *env,
                spin_unlock(&ec->ec_lock);
                CERROR("echo_client still has objects at cleanup time, "
                       "wait for 1 second\n");
-               schedule_timeout_and_set_state(TASK_UNINTERRUPTIBLE,
-                                                  cfs_time_seconds(1));
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               schedule_timeout(cfs_time_seconds(1));
                lu_site_purge(env, &ed->ed_site->cs_lu, -1);
                spin_lock(&ec->ec_lock);
        }
index 9145dd25023b20b5a9f3574fc2d9bce0567316c5..d80418057f296f7167b3355f56c689e051cd4c01 100644 (file)
@@ -543,8 +543,8 @@ int sptlrpc_req_replace_dead_ctx(struct ptlrpc_request *req)
                       "ctx (%p, fl %lx) doesn't switch, relax a little bit\n",
                       newctx, newctx->cc_flags);
 
-               schedule_timeout_and_set_state(TASK_INTERRUPTIBLE,
-                                                  HZ);
+               set_current_state(TASK_INTERRUPTIBLE);
+               schedule_timeout(HZ);
        } else {
                /*
                 * it's possible newctx == oldctx if we're switching