mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Minor fixes from/inspired by Vu Pham
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@96 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2160,6 +2160,7 @@ static void blockio_exec_rw(struct scst_cmd *cmd, struct scst_vdisk_thr *thr,
|
||||
if (bio_add_page(bio, page, bytes, off) < bytes) {
|
||||
need_new_bio = 1;
|
||||
lba_start += thislen >> virt_dev->block_shift;
|
||||
thislen = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -2340,13 +2340,13 @@ void scst_unblock_cmds(struct scst_device *dev)
|
||||
{
|
||||
#ifdef STRICT_SERIALIZING
|
||||
struct scst_cmd *cmd, *t;
|
||||
unsigned long flags;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
local_irq_save(flags);
|
||||
list_for_each_entry_safe(cmd, t, &dev->blocked_cmd_list,
|
||||
blocked_cmd_list_entry) {
|
||||
unsigned long flags;
|
||||
int brk = 0;
|
||||
/*
|
||||
* Since only one cmd per time is being executed, expected_sn
|
||||
@@ -2374,7 +2374,7 @@ void scst_unblock_cmds(struct scst_device *dev)
|
||||
if (brk)
|
||||
break;
|
||||
}
|
||||
local_irq_restore(, flags);
|
||||
local_irq_restore(flags);
|
||||
#else /* STRICT_SERIALIZING */
|
||||
struct scst_cmd *cmd, *tcmd;
|
||||
unsigned long flags;
|
||||
|
||||
@@ -2464,14 +2464,10 @@ static void scst_cmd_set_sn(struct scst_cmd *cmd)
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
PRINT_ERROR_PR("Unsupported queue type %d, treating it as "
|
||||
"ORDERED", cmd->queue_type);
|
||||
cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
|
||||
/* go through */
|
||||
case SCST_CMD_QUEUE_ORDERED:
|
||||
TRACE(TRACE_SCSI|TRACE_SCSI_SERIALIZING, "ORDERED cmd %p "
|
||||
"(op %x)", cmd, cmd->cdb[0]);
|
||||
ordered:
|
||||
if (!tgt_dev->prev_cmd_ordered) {
|
||||
spin_lock_irqsave(&tgt_dev->sn_lock, flags);
|
||||
tgt_dev->num_free_sn_slots--;
|
||||
@@ -2491,7 +2487,6 @@ static void scst_cmd_set_sn(struct scst_cmd *cmd)
|
||||
tgt_dev->num_free_sn_slots++;
|
||||
spin_unlock_irqrestore(&tgt_dev->sn_lock, flags);
|
||||
}
|
||||
ordered:
|
||||
tgt_dev->prev_cmd_ordered = 1;
|
||||
tgt_dev->curr_sn++;
|
||||
cmd->sn = tgt_dev->curr_sn;
|
||||
@@ -2506,6 +2501,12 @@ ordered:
|
||||
list_add(&cmd->sn_cmd_list_entry, &tgt_dev->hq_cmd_list);
|
||||
spin_unlock_irqrestore(&tgt_dev->sn_lock, flags);
|
||||
break;
|
||||
|
||||
default:
|
||||
PRINT_ERROR_PR("Unsupported queue type %d, treating it as "
|
||||
"ORDERED", cmd->queue_type);
|
||||
cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
|
||||
goto ordered;
|
||||
}
|
||||
|
||||
TRACE_SN("cmd(%p)->sn: %d (tgt_dev %p, *cur_sn_slot %d, "
|
||||
|
||||
Reference in New Issue
Block a user