swim: clean up request completion paths
authorTejun Heo <tj@kernel.org>
Tue, 28 Apr 2009 04:06:13 +0000 (13:06 +0900)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 28 Apr 2009 06:14:51 +0000 (08:14 +0200)
swim curiously tries to update request parameters before calling
__blk_end_request() when __blk_end_request() will do it anyway and
unnecessarily checks whether current_nr_sectors is zero right after
fetching.

Drop unnecessary stuff and use standard block layer mechanisms.

[ Impact: cleanup ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Laurent Vivier <Laurent@lvivier.info>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/block/swim.c

index 6544a7b06bf020aa92ac2e6070c8f2fd8a40af1b..97ef4266c4c7e34947983fb00361440cdbcd4d4c 100644 (file)
@@ -535,10 +535,6 @@ static void redo_fd_request(struct request_queue *q)
                        __blk_end_request_cur(req, -EIO);
                        continue;
                }
-               if (req->current_nr_sectors == 0) {
-                       __blk_end_request_cur(req, 0);
-                       continue;
-               }
                if (!fs->disk_in) {
                        __blk_end_request_cur(req, -EIO);
                        continue;
@@ -561,9 +557,6 @@ static void redo_fd_request(struct request_queue *q)
                                __blk_end_request_cur(req, -EIO);
                                continue;
                        }
-                       req->nr_sectors -= req->current_nr_sectors;
-                       req->sector += req->current_nr_sectors;
-                       req->buffer += req->current_nr_sectors * 512;
                        __blk_end_request_cur(req, 0);
                        break;
                }