@@ -86,9 +86,8 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid,
list_for_each_entry(item, &imp->imp_conn_list, oic_item) {
if (obd_uuid_equals(uuid, &item->oic_uuid)) {
if (priority) {
- list_del(&item->oic_item);
- list_add(&item->oic_item,
- &imp->imp_conn_list);
+ list_move(&item->oic_item,
+ &imp->imp_conn_list);
item->oic_last_attempt = 0;
}
CDEBUG(D_HA, "imp %p@%s: found existing conn %s%s\n",
@@ -1132,8 +1132,7 @@ int ldlm_cli_cancel_list_local(struct list_head *cancels, int count,
*/
if (!(flags & LCF_BL_AST) && (rc == LDLM_FL_BL_AST)) {
LDLM_DEBUG(lock, "Cancel lock separately");
- list_del_init(&lock->l_bl_ast);
- list_add(&lock->l_bl_ast, &head);
+ list_move(&lock->l_bl_ast, &head);
bl_ast++;
continue;
}
@@ -1833,9 +1833,8 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
* put on delay list - only if we wait
* recovery finished - before send
*/
- list_del_init(&req->rq_list);
- list_add_tail(&req->rq_list,
- &imp->imp_delayed_list);
+ list_move_tail(&req->rq_list,
+ &imp->imp_delayed_list);
spin_unlock(&imp->imp_lock);
continue;
}
@@ -1856,9 +1855,8 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
goto interpret;
}
- list_del_init(&req->rq_list);
- list_add_tail(&req->rq_list,
- &imp->imp_sending_list);
+ list_move_tail(&req->rq_list,
+ &imp->imp_sending_list);
spin_unlock(&imp->imp_lock);
@@ -753,8 +753,7 @@ static int ptlrpc_connect_set_flags(struct obd_import *imp,
static bool warned;
spin_lock(&imp->imp_lock);
- list_del(&imp->imp_conn_current->oic_item);
- list_add(&imp->imp_conn_current->oic_item, &imp->imp_conn_list);
+ list_move(&imp->imp_conn_current->oic_item, &imp->imp_conn_list);
imp->imp_last_success_conn = imp->imp_conn_current->oic_last_attempt;
spin_unlock(&imp->imp_lock);
@@ -307,11 +307,10 @@ void ptlrpc_dispatch_difficult_reply(struct ptlrpc_reply_state *rs)
rqbd = list_first_entry(&svcpt->scp_rqbd_idle,
struct ptlrpc_request_buffer_desc,
rqbd_list);
- list_del(&rqbd->rqbd_list);
/* assume we will post successfully */
svcpt->scp_nrqbds_posted++;
- list_add(&rqbd->rqbd_list, &svcpt->scp_rqbd_posted);
+ list_move(&rqbd->rqbd_list, &svcpt->scp_rqbd_posted);
spin_unlock(&svcpt->scp_lock);
@@ -325,8 +324,7 @@ void ptlrpc_dispatch_difficult_reply(struct ptlrpc_reply_state *rs)
spin_lock(&svcpt->scp_lock);
svcpt->scp_nrqbds_posted--;
- list_del(&rqbd->rqbd_list);
- list_add_tail(&rqbd->rqbd_list, &svcpt->scp_rqbd_idle);
+ list_move_tail(&rqbd->rqbd_list, &svcpt->scp_rqbd_idle);
/* Don't complain if no request buffers are posted right now; LNET
* won't drop requests because we set the portal lazy!
@@ -769,9 +767,7 @@ static void ptlrpc_server_drop_request(struct ptlrpc_request *req)
refcount = --(rqbd->rqbd_refcount);
if (refcount == 0) {
/* request buffer is now idle: add to history */
- list_del(&rqbd->rqbd_list);
-
- list_add_tail(&rqbd->rqbd_list, &svcpt->scp_hist_rqbds);
+ list_move_tail(&rqbd->rqbd_list, &svcpt->scp_hist_rqbds);
svcpt->scp_hist_nrqbds++;
/* cull some history?
@@ -2416,8 +2412,7 @@ static void ptlrpc_svcpt_stop_threads(struct ptlrpc_service_part *svcpt)
struct ptlrpc_thread,
t_link)) != NULL) {
if (thread_is_stopped(thread)) {
- list_del(&thread->t_link);
- list_add(&thread->t_link, &zombie);
+ list_move(&thread->t_link, &zombie);
continue;
}
spin_unlock(&svcpt->scp_lock);