linux/drivers/block
Tejun Heo 5f49f63178 block: set rq->resid_len to blk_rq_bytes() on issue
In commit c3a4d78c58, while introducing
rq->resid_len, the default value of residue count was changed from
full count to zero.  The conversion was done under the assumption that
when a request fails residue count wasn't defined.  However, Boaz and
James pointed out that this wasn't true and the residue count should
be preserved for failed requests too.

This patchset restores the original behavior by setting rq->resid_len
to blk_rq_bytes(rq) on request start and restoring explicit clearing
in affected drivers.  While at it, take advantage of the fact that
rq->resid_len is set to full count where applicable.

* ide-cd: rq->resid_len cleared on pc success

* mptsas: req->resid_len cleared on success

* sas_expander: rsp/req->resid_len cleared on success

* mpt2sas_transport: req->resid_len cleared on success

* ide-cd, ide-tape, mptsas, sas_host_smp, mpt2sas_transport, ub: take
  advantage of initial full count to simplify code

Boaz Harrosh spotted bug in resid_len initialization.  Fixed as
suggested.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Borislav Petkov <petkovbb@googlemail.com>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Eric Moore <Eric.Moore@lsi.com>
Cc: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-19 11:36:08 +02:00
..
aoe aoe: WIN_* -> ATA_CMD_* 2009-04-01 21:42:24 +02:00
paride block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
amiflop.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
ataflop.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
brd.c brd: fix cacheflushing 2009-04-15 12:10:13 +02:00
cciss_cmd.h cciss: kernel scan thread for MSA2012 2009-04-07 08:12:38 +02:00
cciss_scsi.c cciss: Fix cciss SCSI rescan code to better notice device changes 2008-10-09 08:56:18 +02:00
cciss_scsi.h cciss: Fix cciss SCSI rescan code to better notice device changes 2008-10-09 08:56:18 +02:00
cciss.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
cciss.h cciss: kernel scan thread for MSA2012 2009-04-07 08:12:38 +02:00
cpqarray.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
cpqarray.h
cryptoloop.c drivers: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:16:32 -04:00
DAC960.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
DAC960.h
floppy.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
hd.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
ida_cmd.h
ida_ioctl.h
Kconfig mg_disk: fix dependency on libata 2009-04-28 08:14:52 +02:00
loop.c splice: implement default splice_read method 2009-05-11 14:13:10 +02:00
Makefile mflash: initial support 2009-04-07 08:12:38 +02:00
mg_disk.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
nbd.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
pktcdvd.c pktcdvd: remove broken dev_t export of class devices 2008-12-10 10:03:32 -08:00
ps3disk.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
ps3vram.c proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
smart1,2.h
sunvdc.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
swim3.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
swim_asm.S m68k: mac - Add SWIM floppy support 2009-03-26 21:15:27 +01:00
swim.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
sx8.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
ub.c block: set rq->resid_len to blk_rq_bytes() on issue 2009-05-19 11:36:08 +02:00
umem.c umem: fix request_queue lock warning 2009-04-24 08:54:21 +02:00
umem.h
viodasd.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
virtio_blk.c virtio_blk: get rid of unused variable 2009-05-18 14:44:45 +02:00
xd.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
xd.h [PATCH] switch xd 2008-10-21 07:48:11 -04:00
xen-blkfront.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
xsysace.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00
z2ram.c block: implement and enforce request peek/start/fetch 2009-05-11 09:52:18 +02:00