kernel-ark/drivers
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
..
accessibility
acpi Merge branch 'bjorn.button' into release 2009-04-24 10:42:29 -04:00
amba
ata [libata] fix build error on drivers/ata/pata_legacy.c 2009-04-17 19:05:33 -04:00
atm Replace all DMA_nBIT_MASK macro with DMA_BIT_MASK(n) 2009-04-13 15:04:33 -07:00
auxdisplay
base driver synchronization: make scsi_wait_scan more advanced 2009-04-21 19:40:00 -07:00
block block: add rq->resid_len 2009-05-11 09:50:53 +02:00
bluetooth
cdrom block: replace end_request() with [__]blk_end_request_cur() 2009-04-28 07:37:36 +02:00
char virtio-rng: Remove false BUG for spurious callbacks 2009-04-24 13:28:30 -07:00
clocksource clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
connector
cpufreq
cpuidle
crypto
dca
dio
dma
edac edac: ppc mpc85xx fix mc err detect 2009-04-21 13:41:51 -07:00
eisa
firewire
firmware
gpio
gpu ACPI, i915: Register ACPI video even when not modesetting 2009-04-24 00:42:06 -04:00
hid
hwmon hwmon: sht15 humidity sensor driver 2009-04-13 15:04:29 -07:00
i2c i2c: Let new-style drivers implement attach_adapter 2009-04-13 17:02:14 +02:00
ide block: add rq->resid_len 2009-05-11 09:50:53 +02:00
idle
ieee1394
infiniband Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2009-04-09 16:42:26 -07:00
input drivers/input/serio/hp_sdc.c: fix crash when removing hp_sdc module 2009-04-21 13:41:49 -07:00
isdn USB: add reset endpoint operations 2009-04-17 10:50:27 -07:00
leds
lguest lguest: fix guest crash on non-linear addresses in gdt pvops 2009-04-19 23:14:01 +09:30
macintosh Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 2009-04-24 08:16:05 -07:00
mca
md Merge branch 'for-linus' of git://neil.brown.name/md 2009-04-20 08:37:37 -07:00
media Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2009-04-24 08:36:06 -07:00
memstick block: implement and use [__]blk_end_request_all() 2009-04-28 07:37:35 +02:00
message block: add rq->resid_len 2009-05-11 09:50:53 +02:00
mfd
misc sgi-xp/sgi-gru: allow modules to load on non-uv systems 2009-04-21 13:41:50 -07:00
mmc
mtd block: replace end_request() with [__]blk_end_request_cur() 2009-04-28 07:37:36 +02:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2009-04-24 07:46:51 -07:00
nubus
of
oprofile
parisc parport: Fix various uses of parport_pc 2009-04-14 08:48:50 -07:00
parport
pci Merge git://git.infradead.org/iommu-2.6 2009-04-13 11:35:50 -07:00
pcmcia [ARM] 5458/1: pcmcia: pxa2xx-sharpsl: check if we do have Scoop config 2009-04-23 23:25:40 +01:00
platform Merge branch 'sony-laptop' into release 2009-04-24 01:34:52 -04:00
pnp
power Merge git://git.infradead.org/battery-2.6 2009-04-08 17:45:02 -07:00
ps3
rapidio
regulator
rtc rtc-cmos: fix printk output 2009-04-21 13:41:50 -07:00
s390 block: implement and use [__]blk_end_request_all() 2009-04-28 07:37:35 +02:00
sbus block: replace end_request() with [__]blk_end_request_cur() 2009-04-28 07:37:36 +02:00
scsi block: add rq->resid_len 2009-05-11 09:50:53 +02:00
serial serial: remove contact data 2009-04-24 07:52:08 -07:00
sh
sn
spi spi: pxa2xx: limit reaches -1 2009-04-21 13:41:49 -07:00
ssb
staging go7007: Convert to the new i2c device binding model 2009-04-21 21:47:22 +02:00
tc
telephony
thermal
uio UIO: fix specific device driver missing statement for depmod 2009-04-16 16:17:11 -07:00
usb USB: otg: Fix bug on remove path without transceiver 2009-04-23 14:15:31 -07:00
uwb
video pxafb: lcsr1 is unused without CONFIG_FB_PXA_OVERLAY 2009-04-21 13:41:47 -07:00
virtio virtio: fix suspend when using virtio_balloon 2009-04-19 23:14:01 +09:30
w1
watchdog [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
xen
zorro
Kconfig
Makefile