summaryrefslogtreecommitdiffstats
path: root/drivers/block/xd.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-04-28 06:06:06 +0200
committerJens Axboe <jens.axboe@oracle.com>2009-04-28 08:14:50 +0200
commit5b5c5d12b91cb6b2a2967f06aef35d59008dc2e7 (patch)
treeea8397d10aaedda61fcc849ce9a7fcab17b5438b /drivers/block/xd.c
parentblock: don't init rq fields unnecessarily (diff)
downloadlinux-5b5c5d12b91cb6b2a2967f06aef35d59008dc2e7.tar.xz
linux-5b5c5d12b91cb6b2a2967f06aef35d59008dc2e7.zip
amiflop,ataflop,xd,mg_disk: clean up unnecessary stuff from block drivers
rq_data_dir() can only be READ or WRITE and rq->sector and nr_sectors are always automatically updated after partial request completion. Don't worry about rq_data_dir() not being either READ or WRITE or manually update sector and nr_sectors. [ Impact: cleanup ] Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Jörg Dorchain <joerg@dorchain.net> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: unsik Kim <donari75@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/xd.c')
-rw-r--r--drivers/block/xd.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 6f6ad82ec0c0..14be4c1ed1aa 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -308,7 +308,6 @@ static void do_xd_request (struct request_queue * q)
while ((req = elv_next_request(q)) != NULL) {
unsigned block = req->sector;
unsigned count = req->nr_sectors;
- int rw = rq_data_dir(req);
XD_INFO *disk = req->rq_disk->private_data;
int res = 0;
int retry;
@@ -321,13 +320,9 @@ static void do_xd_request (struct request_queue * q)
__blk_end_request_cur(req, -EIO);
continue;
}
- if (rw != READ && rw != WRITE) {
- printk("do_xd_request: unknown request\n");
- __blk_end_request_cur(req, -EIO);
- continue;
- }
for (retry = 0; (retry < XD_RETRIES) && !res; retry++)
- res = xd_readwrite(rw, disk, req->buffer, block, count);
+ res = xd_readwrite(rq_data_dir(req), disk, req->buffer,
+ block, count);
/* wrap up, 0 = success, -errno = fail */
__blk_end_request_cur(req, res);
}