* [PATCH] scsi: remove current_cmnd field from struct scsi_device
@ 2016-07-11 4:34 Christoph Hellwig
2016-07-11 11:56 ` Tomas Henzl
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Christoph Hellwig @ 2016-07-11 4:34 UTC (permalink / raw)
To: linux-scsi
The field is only used by the 53c700 driver, so move it into the
driver-private device data instead of having it in the common structure.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/scsi/53c700.c | 8 +++++---
drivers/scsi/53c700.h | 1 +
include/scsi/scsi_device.h | 1 -
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 5556201..95e32a4 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -1120,9 +1120,9 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
"reselection is tag %d, slot %p(%d)\n",
hostdata->msgin[2], slot, slot->tag);
} else {
- struct scsi_cmnd *SCp;
+ struct NCR_700_Device_Parameters *p = SDp->hostdata;
+ struct scsi_cmnd *SCp = p->current_cmnd;
- SCp = SDp->current_cmnd;
if(unlikely(SCp == NULL)) {
sdev_printk(KERN_ERR, SDp,
"no saved request for untagged cmd\n");
@@ -1825,9 +1825,11 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)
CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n",
slot->tag, slot);
} else {
+ struct NCR_700_Device_Parameters *p = SCp->device->hostdata;
+
slot->tag = SCSI_NO_TAG;
/* save current command for reselection */
- SCp->device->current_cmnd = SCp;
+ p->current_cmnd = SCp;
}
/* sanity check: some of the commands generated by the mid-layer
* have an eccentric idea of their sc_data_direction */
diff --git a/drivers/scsi/53c700.h b/drivers/scsi/53c700.h
index c893a5d..f34c916 100644
--- a/drivers/scsi/53c700.h
+++ b/drivers/scsi/53c700.h
@@ -82,6 +82,7 @@ struct NCR_700_Device_Parameters {
* cmnd[1], this could be in static storage */
unsigned char cmnd[MAX_COMMAND_SIZE];
__u8 depth;
+ struct scsi_cmnd *current_cmnd; /* currently active command */
};
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index a6c346d..8a95631 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -94,7 +94,6 @@ struct scsi_device {
spinlock_t list_lock;
struct list_head cmd_list; /* queue of in use SCSI Command structures */
struct list_head starved_entry;
- struct scsi_cmnd *current_cmnd; /* currently active command */
unsigned short queue_depth; /* How deep of a queue we want */
unsigned short max_queue_depth; /* max queue depth */
unsigned short last_queue_full_depth; /* These two are used by */
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: remove current_cmnd field from struct scsi_device
2016-07-11 4:34 [PATCH] scsi: remove current_cmnd field from struct scsi_device Christoph Hellwig
@ 2016-07-11 11:56 ` Tomas Henzl
2016-07-11 14:16 ` Ewan D. Milne
2016-07-14 2:34 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Tomas Henzl @ 2016-07-11 11:56 UTC (permalink / raw)
To: Christoph Hellwig, linux-scsi
On 11.7.2016 06:34, Christoph Hellwig wrote:
> The field is only used by the 53c700 driver, so move it into the
> driver-private device data instead of having it in the common structure.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Tomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: remove current_cmnd field from struct scsi_device
2016-07-11 4:34 [PATCH] scsi: remove current_cmnd field from struct scsi_device Christoph Hellwig
2016-07-11 11:56 ` Tomas Henzl
@ 2016-07-11 14:16 ` Ewan D. Milne
2016-07-14 2:34 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Ewan D. Milne @ 2016-07-11 14:16 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-scsi
On Mon, 2016-07-11 at 13:34 +0900, Christoph Hellwig wrote:
> The field is only used by the 53c700 driver, so move it into the
> driver-private device data instead of having it in the common structure.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/scsi/53c700.c | 8 +++++---
> drivers/scsi/53c700.h | 1 +
> include/scsi/scsi_device.h | 1 -
> 3 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
> index 5556201..95e32a4 100644
> --- a/drivers/scsi/53c700.c
> +++ b/drivers/scsi/53c700.c
> @@ -1120,9 +1120,9 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
> "reselection is tag %d, slot %p(%d)\n",
> hostdata->msgin[2], slot, slot->tag);
> } else {
> - struct scsi_cmnd *SCp;
> + struct NCR_700_Device_Parameters *p = SDp->hostdata;
> + struct scsi_cmnd *SCp = p->current_cmnd;
>
> - SCp = SDp->current_cmnd;
> if(unlikely(SCp == NULL)) {
> sdev_printk(KERN_ERR, SDp,
> "no saved request for untagged cmd\n");
> @@ -1825,9 +1825,11 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)
> CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n",
> slot->tag, slot);
> } else {
> + struct NCR_700_Device_Parameters *p = SCp->device->hostdata;
> +
> slot->tag = SCSI_NO_TAG;
> /* save current command for reselection */
> - SCp->device->current_cmnd = SCp;
> + p->current_cmnd = SCp;
> }
> /* sanity check: some of the commands generated by the mid-layer
> * have an eccentric idea of their sc_data_direction */
> diff --git a/drivers/scsi/53c700.h b/drivers/scsi/53c700.h
> index c893a5d..f34c916 100644
> --- a/drivers/scsi/53c700.h
> +++ b/drivers/scsi/53c700.h
> @@ -82,6 +82,7 @@ struct NCR_700_Device_Parameters {
> * cmnd[1], this could be in static storage */
> unsigned char cmnd[MAX_COMMAND_SIZE];
> __u8 depth;
> + struct scsi_cmnd *current_cmnd; /* currently active command */
> };
>
>
> diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
> index a6c346d..8a95631 100644
> --- a/include/scsi/scsi_device.h
> +++ b/include/scsi/scsi_device.h
> @@ -94,7 +94,6 @@ struct scsi_device {
> spinlock_t list_lock;
> struct list_head cmd_list; /* queue of in use SCSI Command structures */
> struct list_head starved_entry;
> - struct scsi_cmnd *current_cmnd; /* currently active command */
> unsigned short queue_depth; /* How deep of a queue we want */
> unsigned short max_queue_depth; /* max queue depth */
> unsigned short last_queue_full_depth; /* These two are used by */
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: remove current_cmnd field from struct scsi_device
2016-07-11 4:34 [PATCH] scsi: remove current_cmnd field from struct scsi_device Christoph Hellwig
2016-07-11 11:56 ` Tomas Henzl
2016-07-11 14:16 ` Ewan D. Milne
@ 2016-07-14 2:34 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2016-07-14 2:34 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-scsi
>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:
Christoph> The field is only used by the 53c700 driver, so move it into
Christoph> the driver-private device data instead of having it in the
Christoph> common structure.
Applied to 4.8/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-14 2:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-11 4:34 [PATCH] scsi: remove current_cmnd field from struct scsi_device Christoph Hellwig
2016-07-11 11:56 ` Tomas Henzl
2016-07-11 14:16 ` Ewan D. Milne
2016-07-14 2:34 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).