Skip to content

Commit 9fa505a

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: core: Move resid from scsi_data_buffer to scsi_cmnd
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>
1 parent 80f82c1 commit 9fa505a

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/scsi/scsi_lib.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
938938
* scsi_result_to_blk_status may have reset the host_byte
939939
*/
940940
scsi_req(req)->result = cmd->result;
941-
scsi_req(req)->resid_len = scsi_get_resid(cmd);
942941
}
943942

944943
/*

‎include/scsi/scsi_cmnd.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ struct scsi_driver;
3535
struct scsi_data_buffer {
3636
struct sg_table table;
3737
unsigned length;
38-
int resid;
3938
};
4039

4140
/* embedded in scsi_cmnd */
@@ -202,12 +201,12 @@ static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd)
202201

203202
static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)
204203
{
205-
cmd->sdb.resid = resid;
204+
cmd->req.resid_len = resid;
206205
}
207206

208207
static inline int scsi_get_resid(struct scsi_cmnd *cmd)
209208
{
210-
return cmd->sdb.resid;
209+
return cmd->req.resid_len;
211210
}
212211

213212
#define scsi_for_each_sg(cmd, sg, nseg, __i) \

0 commit comments

Comments
 (0)