kernel_optimize_test/drivers/message/fusion
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
..
lsi [SCSI] mpt fusion: Update MPI Headers to version 01.05.19 2009-01-13 10:36:01 -06:00
Kconfig [SCSI] mpt fusion: Kconfig cleanup 2007-10-12 14:48:53 -04:00
Makefile [SCSI] mpt fusion: logging support in Kconfig, Makefile, mptbase.h and addition of mptdebug.h 2007-07-28 11:25:35 -04:00
mptbase.c scsi: mpt: suppress debugobjects warning 2009-04-21 13:41:50 -07:00
mptbase.h [SCSI] mpt fusion: Add Firmware debug support 2009-01-13 10:36:02 -06:00
mptctl.c [SCSI] fusion: Move a dereference below a NULL test 2009-01-02 12:11:15 -06:00
mptctl.h [SCSI] mpt fusion : Updated copyright statment with 2008 included 2008-06-05 09:27:17 -05:00
mptdebug.h [SCSI] mpt fusion : Updated copyright statment with 2008 included 2008-06-05 09:27:17 -05:00
mptfc.c [SCSI] replace __FUNCTION__ with __func__ 2008-07-27 10:31:49 -04:00
mptlan.c fusion: convert devices to new API 2009-01-07 18:04:45 -08:00
mptlan.h mptlan: Kill directly reference of netdev->priv 2008-12-03 21:13:37 -08:00
mptsas.c block: add rq->resid_len 2009-05-11 09:50:53 +02:00
mptsas.h [SCSI] mpt fusion : Updated copyright statment with 2008 included 2008-06-05 09:27:17 -05:00
mptscsih.c [SCSI] mpt fusion: Add Firmware debug support 2009-01-13 10:36:02 -06:00
mptscsih.h [SCSI] mpt fusion : Updated copyright statment with 2008 included 2008-06-05 09:27:17 -05:00
mptspi.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00