aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xd.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-04-28 00:06:06 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-28 02:14:50 -0400
commit5b5c5d12b91cb6b2a2967f06aef35d59008dc2e7 (patch)
treeea8397d10aaedda61fcc849ce9a7fcab17b5438b /drivers/block/xd.c
parent4c94dece1baf320d925cedb231489c4e0358ac5a (diff)
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)
308 while ((req = elv_next_request(q)) != NULL) { 308 while ((req = elv_next_request(q)) != NULL) {
309 unsigned block = req->sector; 309 unsigned block = req->sector;
310 unsigned count = req->nr_sectors; 310 unsigned count = req->nr_sectors;
311 int rw = rq_data_dir(req);
312 XD_INFO *disk = req->rq_disk->private_data; 311 XD_INFO *disk = req->rq_disk->private_data;
313 int res = 0; 312 int res = 0;
314 int retry; 313 int retry;
@@ -321,13 +320,9 @@ static void do_xd_request (struct request_queue * q)
321 __blk_end_request_cur(req, -EIO); 320 __blk_end_request_cur(req, -EIO);
322 continue; 321 continue;
323 } 322 }
324 if (rw != READ && rw != WRITE) {
325 printk("do_xd_request: unknown request\n");
326 __blk_end_request_cur(req, -EIO);
327 continue;
328 }
329 for (retry = 0; (retry < XD_RETRIES) && !res; retry++) 323 for (retry = 0; (retry < XD_RETRIES) && !res; retry++)
330 res = xd_readwrite(rw, disk, req->buffer, block, count); 324 res = xd_readwrite(rq_data_dir(req), disk, req->buffer,
325 block, count);
331 /* wrap up, 0 = success, -errno = fail */ 326 /* wrap up, 0 = success, -errno = fail */
332 __blk_end_request_cur(req, res); 327 __blk_end_request_cur(req, res);
333 } 328 }