Whamcloud - gitweb
LU-12930 various: use schedule_timeout_*interruptible
[fs/lustre-release.git] / lustre / ldlm / ldlm_lockd.c
index faf7545..178976b 100644 (file)
@@ -332,8 +332,7 @@ static void waiting_locks_callback(TIMER_DATA_TYPE unused)
                 * the waiting_locks_list and ldlm_add_waiting_lock()
                 * already grabbed a ref
                 */
-               list_del(&lock->l_pending_chain);
-               list_add(&lock->l_pending_chain, &expired_lock_list);
+               list_move(&lock->l_pending_chain, &expired_lock_list);
                need_dump = 1;
        }
 
@@ -1908,7 +1907,7 @@ static int ldlm_handle_cp_callback(struct ptlrpc_request *req,
                                     struct ldlm_request *dlm_req,
                                     struct ldlm_lock *lock)
 {
-       struct list_head ast_list;
+       LIST_HEAD(ast_list);
        int lvb_len;
        int rc = 0;
 
@@ -1916,15 +1915,13 @@ static int ldlm_handle_cp_callback(struct ptlrpc_request *req,
 
        LDLM_DEBUG(lock, "client completion callback handler START");
 
-       INIT_LIST_HEAD(&ast_list);
        if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_CANCEL_BL_CB_RACE)) {
                long to = cfs_time_seconds(1);
 
                ldlm_callback_reply(req, 0);
 
                while (to > 0) {
-                       set_current_state(TASK_INTERRUPTIBLE);
-                       schedule_timeout(to);
+                       schedule_timeout_interruptible(to);
                        if (ldlm_is_granted(lock) ||
                            ldlm_is_destroyed(lock))
                                break;
@@ -2680,11 +2677,10 @@ static int ldlm_revoke_lock_cb(struct cfs_hash *hs, struct cfs_hash_bd *bd,
 
 void ldlm_revoke_export_locks(struct obd_export *exp)
 {
-       struct list_head rpc_list;
+       LIST_HEAD(rpc_list);
 
        ENTRY;
 
-       INIT_LIST_HEAD(&rpc_list);
        cfs_hash_for_each_nolock(exp->exp_lock_hash,
                                 ldlm_revoke_lock_cb, &rpc_list, 0);
        ldlm_run_ast_work(exp->exp_obd->obd_namespace, &rpc_list,