diff options
author | Christoph Hellwig <hch@lst.de> | 2005-06-19 07:40:52 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-06-26 13:15:28 -0400 |
commit | b4edcbcafdecc80ef5356ff6452768b1b926ea76 (patch) | |
tree | e30da76124facf97f4183b0fe41b29d90b00f237 | |
parent | f5ad56145d43cdb68760bba3e14655ff6ae726aa (diff) |
[SCSI] remove scsi_cmnd->owner
never checked anywhere
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r-- | drivers/scsi/scsi.c | 5 | ||||
-rw-r--r-- | drivers/scsi/scsi_error.c | 18 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 2 | ||||
-rw-r--r-- | drivers/scsi/scsi_priv.h | 11 | ||||
-rw-r--r-- | include/scsi/scsi_cmnd.h | 1 |
5 files changed, 1 insertions, 36 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 5add683804e5..b25e5e531eb9 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -260,7 +260,6 @@ struct scsi_cmnd *scsi_get_command(struct scsi_device *dev, int gfp_mask) | |||
260 | memset(cmd, 0, sizeof(*cmd)); | 260 | memset(cmd, 0, sizeof(*cmd)); |
261 | cmd->device = dev; | 261 | cmd->device = dev; |
262 | cmd->state = SCSI_STATE_UNUSED; | 262 | cmd->state = SCSI_STATE_UNUSED; |
263 | cmd->owner = SCSI_OWNER_NOBODY; | ||
264 | init_timer(&cmd->eh_timeout); | 263 | init_timer(&cmd->eh_timeout); |
265 | INIT_LIST_HEAD(&cmd->list); | 264 | INIT_LIST_HEAD(&cmd->list); |
266 | spin_lock_irqsave(&dev->list_lock, flags); | 265 | spin_lock_irqsave(&dev->list_lock, flags); |
@@ -612,7 +611,6 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) | |||
612 | */ | 611 | */ |
613 | 612 | ||
614 | cmd->state = SCSI_STATE_QUEUED; | 613 | cmd->state = SCSI_STATE_QUEUED; |
615 | cmd->owner = SCSI_OWNER_LOWLEVEL; | ||
616 | 614 | ||
617 | atomic_inc(&cmd->device->iorequest_cnt); | 615 | atomic_inc(&cmd->device->iorequest_cnt); |
618 | 616 | ||
@@ -683,7 +681,6 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq) | |||
683 | { | 681 | { |
684 | sreq->sr_command = cmd; | 682 | sreq->sr_command = cmd; |
685 | 683 | ||
686 | cmd->owner = SCSI_OWNER_MIDLEVEL; | ||
687 | cmd->cmd_len = sreq->sr_cmd_len; | 684 | cmd->cmd_len = sreq->sr_cmd_len; |
688 | cmd->use_sg = sreq->sr_use_sg; | 685 | cmd->use_sg = sreq->sr_use_sg; |
689 | 686 | ||
@@ -768,7 +765,6 @@ void __scsi_done(struct scsi_cmnd *cmd) | |||
768 | */ | 765 | */ |
769 | cmd->serial_number = 0; | 766 | cmd->serial_number = 0; |
770 | cmd->state = SCSI_STATE_BHQUEUE; | 767 | cmd->state = SCSI_STATE_BHQUEUE; |
771 | cmd->owner = SCSI_OWNER_BH_HANDLER; | ||
772 | 768 | ||
773 | atomic_inc(&cmd->device->iodone_cnt); | 769 | atomic_inc(&cmd->device->iodone_cnt); |
774 | if (cmd->result) | 770 | if (cmd->result) |
@@ -889,7 +885,6 @@ void scsi_finish_command(struct scsi_cmnd *cmd) | |||
889 | SCSI_LOG_MLCOMPLETE(4, printk("Notifying upper driver of completion " | 885 | SCSI_LOG_MLCOMPLETE(4, printk("Notifying upper driver of completion " |
890 | "for device %d %x\n", sdev->id, cmd->result)); | 886 | "for device %d %x\n", sdev->id, cmd->result)); |
891 | 887 | ||
892 | cmd->owner = SCSI_OWNER_HIGHLEVEL; | ||
893 | cmd->state = SCSI_STATE_FINISHED; | 888 | cmd->state = SCSI_STATE_FINISHED; |
894 | 889 | ||
895 | /* | 890 | /* |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index af61f989896e..0df8615732c1 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -77,7 +77,6 @@ int scsi_eh_scmd_add(struct scsi_cmnd *scmd, int eh_flag) | |||
77 | /* | 77 | /* |
78 | * FIXME: Can we stop setting owner and state. | 78 | * FIXME: Can we stop setting owner and state. |
79 | */ | 79 | */ |
80 | scmd->owner = SCSI_OWNER_ERROR_HANDLER; | ||
81 | scmd->state = SCSI_STATE_FAILED; | 80 | scmd->state = SCSI_STATE_FAILED; |
82 | list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); | 81 | list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); |
83 | set_bit(SHOST_RECOVERY, &shost->shost_state); | 82 | set_bit(SHOST_RECOVERY, &shost->shost_state); |
@@ -451,7 +450,6 @@ static void scsi_eh_done(struct scsi_cmnd *scmd) | |||
451 | */ | 450 | */ |
452 | if (del_timer(&scmd->eh_timeout)) { | 451 | if (del_timer(&scmd->eh_timeout)) { |
453 | scmd->request->rq_status = RQ_SCSI_DONE; | 452 | scmd->request->rq_status = RQ_SCSI_DONE; |
454 | scmd->owner = SCSI_OWNER_ERROR_HANDLER; | ||
455 | 453 | ||
456 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n", | 454 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n", |
457 | __FUNCTION__, scmd, scmd->result)); | 455 | __FUNCTION__, scmd, scmd->result)); |
@@ -484,8 +482,6 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) | |||
484 | * we will use a queued command if possible, otherwise we will | 482 | * we will use a queued command if possible, otherwise we will |
485 | * emulate the queuing and calling of completion function ourselves. | 483 | * emulate the queuing and calling of completion function ourselves. |
486 | */ | 484 | */ |
487 | scmd->owner = SCSI_OWNER_LOWLEVEL; | ||
488 | |||
489 | if (sdev->scsi_level <= SCSI_2) | 485 | if (sdev->scsi_level <= SCSI_2) |
490 | scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | | 486 | scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | |
491 | (sdev->lun << 5 & 0xe0); | 487 | (sdev->lun << 5 & 0xe0); |
@@ -514,7 +510,6 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) | |||
514 | */ | 510 | */ |
515 | if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) { | 511 | if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) { |
516 | scsi_eh_eflags_clr(scmd, SCSI_EH_REC_TIMEOUT); | 512 | scsi_eh_eflags_clr(scmd, SCSI_EH_REC_TIMEOUT); |
517 | scmd->owner = SCSI_OWNER_LOWLEVEL; | ||
518 | 513 | ||
519 | /* | 514 | /* |
520 | * as far as the low level driver is | 515 | * as far as the low level driver is |
@@ -530,8 +525,6 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) | |||
530 | shost->hostt->eh_abort_handler(scmd); | 525 | shost->hostt->eh_abort_handler(scmd); |
531 | 526 | ||
532 | scmd->request->rq_status = RQ_SCSI_DONE; | 527 | scmd->request->rq_status = RQ_SCSI_DONE; |
533 | scmd->owner = SCSI_OWNER_ERROR_HANDLER; | ||
534 | |||
535 | rtn = FAILED; | 528 | rtn = FAILED; |
536 | } | 529 | } |
537 | 530 | ||
@@ -742,9 +735,6 @@ static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) | |||
742 | */ | 735 | */ |
743 | if (scmd->serial_number == 0) | 736 | if (scmd->serial_number == 0) |
744 | return SUCCESS; | 737 | return SUCCESS; |
745 | |||
746 | scmd->owner = SCSI_OWNER_LOWLEVEL; | ||
747 | |||
748 | return scmd->device->host->hostt->eh_abort_handler(scmd); | 738 | return scmd->device->host->hostt->eh_abort_handler(scmd); |
749 | } | 739 | } |
750 | 740 | ||
@@ -862,10 +852,7 @@ static int scsi_try_bus_device_reset(struct scsi_cmnd *scmd) | |||
862 | if (!scmd->device->host->hostt->eh_device_reset_handler) | 852 | if (!scmd->device->host->hostt->eh_device_reset_handler) |
863 | return FAILED; | 853 | return FAILED; |
864 | 854 | ||
865 | scmd->owner = SCSI_OWNER_LOWLEVEL; | ||
866 | |||
867 | rtn = scmd->device->host->hostt->eh_device_reset_handler(scmd); | 855 | rtn = scmd->device->host->hostt->eh_device_reset_handler(scmd); |
868 | |||
869 | if (rtn == SUCCESS) { | 856 | if (rtn == SUCCESS) { |
870 | scmd->device->was_reset = 1; | 857 | scmd->device->was_reset = 1; |
871 | scmd->device->expecting_cc_ua = 1; | 858 | scmd->device->expecting_cc_ua = 1; |
@@ -1048,7 +1035,6 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd) | |||
1048 | 1035 | ||
1049 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n", | 1036 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n", |
1050 | __FUNCTION__)); | 1037 | __FUNCTION__)); |
1051 | scmd->owner = SCSI_OWNER_LOWLEVEL; | ||
1052 | 1038 | ||
1053 | if (!scmd->device->host->hostt->eh_bus_reset_handler) | 1039 | if (!scmd->device->host->hostt->eh_bus_reset_handler) |
1054 | return FAILED; | 1040 | return FAILED; |
@@ -1077,7 +1063,6 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd) | |||
1077 | 1063 | ||
1078 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n", | 1064 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n", |
1079 | __FUNCTION__)); | 1065 | __FUNCTION__)); |
1080 | scmd->owner = SCSI_OWNER_LOWLEVEL; | ||
1081 | 1066 | ||
1082 | if (!scmd->device->host->hostt->eh_host_reset_handler) | 1067 | if (!scmd->device->host->hostt->eh_host_reset_handler) |
1083 | return FAILED; | 1068 | return FAILED; |
@@ -1819,8 +1804,7 @@ scsi_reset_provider(struct scsi_device *dev, int flag) | |||
1819 | memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout)); | 1804 | memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout)); |
1820 | scmd->request->rq_status = RQ_SCSI_BUSY; | 1805 | scmd->request->rq_status = RQ_SCSI_BUSY; |
1821 | scmd->state = SCSI_STATE_INITIALIZING; | 1806 | scmd->state = SCSI_STATE_INITIALIZING; |
1822 | scmd->owner = SCSI_OWNER_MIDLEVEL; | 1807 | |
1823 | |||
1824 | memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd)); | 1808 | memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd)); |
1825 | 1809 | ||
1826 | scmd->scsi_done = scsi_reset_provider_done_command; | 1810 | scmd->scsi_done = scsi_reset_provider_done_command; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index b4f320854d66..912cea081119 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -149,7 +149,6 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) | |||
149 | * Register the fact that we own the thing for now. | 149 | * Register the fact that we own the thing for now. |
150 | */ | 150 | */ |
151 | cmd->state = SCSI_STATE_MLQUEUE; | 151 | cmd->state = SCSI_STATE_MLQUEUE; |
152 | cmd->owner = SCSI_OWNER_MIDLEVEL; | ||
153 | 152 | ||
154 | /* | 153 | /* |
155 | * Decrement the counters, since these commands are no longer | 154 | * Decrement the counters, since these commands are no longer |
@@ -299,7 +298,6 @@ EXPORT_SYMBOL(scsi_wait_req); | |||
299 | */ | 298 | */ |
300 | static int scsi_init_cmd_errh(struct scsi_cmnd *cmd) | 299 | static int scsi_init_cmd_errh(struct scsi_cmnd *cmd) |
301 | { | 300 | { |
302 | cmd->owner = SCSI_OWNER_MIDLEVEL; | ||
303 | cmd->serial_number = 0; | 301 | cmd->serial_number = 0; |
304 | 302 | ||
305 | memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); | 303 | memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); |
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 96d4f745975c..e0f5b5d4582d 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h | |||
@@ -13,17 +13,6 @@ struct Scsi_Host; | |||
13 | 13 | ||
14 | 14 | ||
15 | /* | 15 | /* |
16 | * These are the values that the owner field can take. | ||
17 | * They are used as an indication of who the command belongs to. | ||
18 | */ | ||
19 | #define SCSI_OWNER_HIGHLEVEL 0x100 | ||
20 | #define SCSI_OWNER_MIDLEVEL 0x101 | ||
21 | #define SCSI_OWNER_LOWLEVEL 0x102 | ||
22 | #define SCSI_OWNER_ERROR_HANDLER 0x103 | ||
23 | #define SCSI_OWNER_BH_HANDLER 0x104 | ||
24 | #define SCSI_OWNER_NOBODY 0x105 | ||
25 | |||
26 | /* | ||
27 | * Magic values for certain scsi structs. Shouldn't ever be used. | 16 | * Magic values for certain scsi structs. Shouldn't ever be used. |
28 | */ | 17 | */ |
29 | #define SCSI_CMND_MAGIC 0xE25C23A5 | 18 | #define SCSI_CMND_MAGIC 0xE25C23A5 |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 5f8c907c32e8..0c149219caf9 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -32,7 +32,6 @@ struct scsi_cmnd { | |||
32 | 32 | ||
33 | struct scsi_device *device; | 33 | struct scsi_device *device; |
34 | unsigned short state; | 34 | unsigned short state; |
35 | unsigned short owner; | ||
36 | struct scsi_request *sc_request; | 35 | struct scsi_request *sc_request; |
37 | 36 | ||
38 | struct list_head list; /* scsi_cmnd participates in queue lists */ | 37 | struct list_head list; /* scsi_cmnd participates in queue lists */ |