aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2011-04-01 19:06:09 -0400
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 11:20:10 -0400
commit63ce2499947683dcc026373e24a4cb5a9d086e7d (patch)
treeabafb4f3a79e8c7a7a3af9901a966942f4bd181a
parent38b34aca30ef1296bbc552505d80c69f274f0872 (diff)
[SCSI] esp, scsi_tgt_lib, fcoe: use list_move() instead of list_del()/list_add() combination
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/esp_scsi.c6
-rw-r--r--drivers/scsi/fcoe/fcoe_ctlr.c6
-rw-r--r--drivers/scsi/scsi_tgt_lib.c6
3 files changed, 6 insertions, 12 deletions
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
index 57558523c1b8..9a1af1d6071a 100644
--- a/drivers/scsi/esp_scsi.c
+++ b/drivers/scsi/esp_scsi.c
@@ -708,8 +708,7 @@ static void esp_maybe_execute_command(struct esp *esp)
708 tp = &esp->target[tgt]; 708 tp = &esp->target[tgt];
709 lp = dev->hostdata; 709 lp = dev->hostdata;
710 710
711 list_del(&ent->list); 711 list_move(&ent->list, &esp->active_cmds);
712 list_add(&ent->list, &esp->active_cmds);
713 712
714 esp->active_cmd = ent; 713 esp->active_cmd = ent;
715 714
@@ -1244,8 +1243,7 @@ static int esp_finish_select(struct esp *esp)
1244 /* Now that the state is unwound properly, put back onto 1243 /* Now that the state is unwound properly, put back onto
1245 * the issue queue. This command is no longer active. 1244 * the issue queue. This command is no longer active.
1246 */ 1245 */
1247 list_del(&ent->list); 1246 list_move(&ent->list, &esp->queued_cmds);
1248 list_add(&ent->list, &esp->queued_cmds);
1249 esp->active_cmd = NULL; 1247 esp->active_cmd = NULL;
1250 1248
1251 /* Return value ignored by caller, it directly invokes 1249 /* Return value ignored by caller, it directly invokes
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 9d38be2a41f9..229e4af5508a 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -978,10 +978,8 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
978 * the FCF that answers multicast solicitations, not the others that 978 * the FCF that answers multicast solicitations, not the others that
979 * are sending periodic multicast advertisements. 979 * are sending periodic multicast advertisements.
980 */ 980 */
981 if (mtu_valid) { 981 if (mtu_valid)
982 list_del(&fcf->list); 982 list_move(&fcf->list, &fip->fcfs);
983 list_add(&fcf->list, &fip->fcfs);
984 }
985 983
986 /* 984 /*
987 * If this is the first validated FCF, note the time and 985 * If this is the first validated FCF, note the time and
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index 8bca8c25ba69..84a1fdf67864 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -275,10 +275,8 @@ void scsi_tgt_free_queue(struct Scsi_Host *shost)
275 275
276 for (i = 0; i < ARRAY_SIZE(qdata->cmd_hash); i++) { 276 for (i = 0; i < ARRAY_SIZE(qdata->cmd_hash); i++) {
277 list_for_each_entry_safe(tcmd, n, &qdata->cmd_hash[i], 277 list_for_each_entry_safe(tcmd, n, &qdata->cmd_hash[i],
278 hash_list) { 278 hash_list)
279 list_del(&tcmd->hash_list); 279 list_move(&tcmd->hash_list, &cmds);
280 list_add(&tcmd->hash_list, &cmds);
281 }
282 } 280 }
283 281
284 spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags); 282 spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags);