linux_dsm_epyc7002/drivers/scsi/libsas
Tejun Heo c3a4d78c58 block: add rq->resid_len
rq->data_len served two purposes - the length of data buffer on issue
and the residual count on completion.  This duality creates some
headaches.

First of all, block layer and low level drivers can't really determine
what rq->data_len contains while a request is executing.  It could be
the total request length or it coulde be anything else one of the
lower layers is using to keep track of residual count.  This
complicates things because blk_rq_bytes() and thus
[__]blk_end_request_all() relies on rq->data_len for PC commands.
Drivers which want to report residual count should first cache the
total request length, update rq->data_len and then complete the
request with the cached data length.

Secondly, it makes requests default to reporting full residual count,
ie. reporting that no data transfer occurred.  The residual count is
an exception not the norm; however, the driver should clear
rq->data_len to zero to signify the normal cases while leaving it
alone means no data transfer occurred at all.  This reverse default
behavior complicates code unnecessarily and renders block PC on some
drivers (ide-tape/floppy) unuseable.

This patch adds rq->resid_len which is used only for residual count.

While at it, remove now unnecessasry blk_rq_bytes() caching in
ide_pc_intr() as rq->data_len is not changed anymore.

Boaz	: spotted missing conversion in osd
Sergei	: spotted too early conversion to blk_rq_bytes() in ide-tape

[ Impact: cleanup residual count handling, report 0 resid by default ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Mike Miller <mike.miller@hp.com>
Cc: Eric Moore <Eric.Moore@lsi.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: Mike Miller <mike.miller@hp.com>
Cc: Eric Moore <Eric.Moore@lsi.com>
Cc: Darrick J. Wong <djwong@us.ibm.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11 09:50:53 +02:00
..
Kconfig [SCSI] libsas: add host SMP processing 2008-01-11 18:29:11 -06:00
Makefile [SCSI] libsas: abstract STP task status into a function 2008-01-25 11:47:23 -06:00
sas_ata.c Merge branch 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block 2008-10-10 10:52:45 -07:00
sas_discover.c [SCSI] struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-02 10:22:16 -06:00
sas_dump.c [SCSI] struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-02 10:22:16 -06:00
sas_dump.h [SCSI] aic94xx: new driver 2006-08-29 09:52:29 -05:00
sas_event.c [SCSI] libsas: Add SAS_HA state flags to avoid queueing events while unloading 2007-01-13 16:21:53 -06:00
sas_expander.c block: add rq->resid_len 2009-05-11 09:50:53 +02:00
sas_host_smp.c block: add rq->resid_len 2009-05-11 09:50:53 +02:00
sas_init.c Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2007-07-22 11:36:49 -07:00
sas_internal.h block: unify request timeout handling 2008-10-09 08:56:13 +02:00
sas_phy.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
sas_port.c [SCSI] struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-02 10:22:16 -06:00
sas_scsi_host.c [libata] get-identity ioctl: Fix use of invalid memory pointer 2009-01-16 10:17:09 -05:00
sas_task.c [SCSI] libsas: abstract STP task status into a function 2008-01-25 11:47:23 -06:00