scsi: core: Move resid from scsi_data_buffer to scsi_cmnd
authorBart Van Assche <bvanassche@acm.org>
Fri, 8 Feb 2019 21:25:03 +0000 (13:25 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 12 Feb 2019 16:13:41 +0000 (11:13 -0500)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c
include/scsi/scsi_cmnd.h

index d25101c5e3b8f750b497d8a4354732863542e093..c77cb0d31dbc84ee66826f99b017a74210009a65 100644 (file)
@@ -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);
        }
 
        /*
index af6ae3e1eba6aa8f6ac9a156914cd74c9da81f5c..6c7793c2ad013da047627ee8654f4b9013762419 100644 (file)
@@ -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)                   \