diff mbox series

[5/5] Move the resid member from struct scsi_data_buffer into struct scsi_cmnd

Message ID 20190208212503.237150-6-bvanassche@acm.org (mailing list archive)
State Mainlined
Commit 9fa505adf9f2914637e4e81620f62dcdaa575f71
Headers show
Series Reduce the size of the SCSI request data structure | expand

Commit Message

Bart Van Assche Feb. 8, 2019, 9:25 p.m. UTC
This patch does not change any functionality but reduces the size of
struct scsi_cmnd.

Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/scsi_lib.c  | 1 -
 include/scsi/scsi_cmnd.h | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Christoph Hellwig Feb. 12, 2019, 7:59 a.m. UTC | #1
On Fri, Feb 08, 2019 at 01:25:03PM -0800, Bart Van Assche wrote:
> This patch does not change any functionality but reduces the size of
> struct scsi_cmnd.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index d25101c5e3b8..c77cb0d31dbc 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -938,7 +938,6 @@  void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
 		 * scsi_result_to_blk_status may have reset the host_byte
 		 */
 		scsi_req(req)->result = cmd->result;
-		scsi_req(req)->resid_len = scsi_get_resid(cmd);
 	}
 
 	/*
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index af6ae3e1eba6..6c7793c2ad01 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -35,7 +35,6 @@  struct scsi_driver;
 struct scsi_data_buffer {
 	struct sg_table table;
 	unsigned length;
-	int resid;
 };
 
 /* embedded in scsi_cmnd */
@@ -202,12 +201,12 @@  static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd)
 
 static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)
 {
-	cmd->sdb.resid = resid;
+	cmd->req.resid_len = resid;
 }
 
 static inline int scsi_get_resid(struct scsi_cmnd *cmd)
 {
-	return cmd->sdb.resid;
+	return cmd->req.resid_len;
 }
 
 #define scsi_for_each_sg(cmd, sg, nseg, __i)			\