summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-04-28 13:06:10 +0900
committerJens Axboe <jens.axboe@oracle.com>2009-04-28 08:14:51 +0200
commitf81f2f7c9fee307e371f37424577d46f9eaf8692 (patch)
tree75bb4afd8690847234d502ad244d90c8c20a7bc6 /arch
parent4d6c84d91d1a539ebc47d1a36a35e9390ba11fdc (diff)
downloadblackbird-op-linux-f81f2f7c9fee307e371f37424577d46f9eaf8692.tar.gz
blackbird-op-linux-f81f2f7c9fee307e371f37424577d46f9eaf8692.zip
ubd: drop unnecessary rq->sector manipulation
ubd curiously updates rq->sector while issuing the request in multiple pieces. Don't do it and simply use local copy of sector. [ Impact: cleanup ] Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/drivers/ubd_kern.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 36ca9fa89d05..433012764a37 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1222,7 +1222,8 @@ static void do_ubd_request(struct request_queue *q)
{
struct io_thread_req *io_req;
struct request *req;
- int n, last_sectors;
+ sector_t sector;
+ int n;
while(1){
struct ubd *dev = q->queuedata;
@@ -1238,11 +1239,10 @@ static void do_ubd_request(struct request_queue *q)
}
req = dev->request;
- last_sectors = 0;
+ sector = req->sector;
while(dev->start_sg < dev->end_sg){
struct scatterlist *sg = &dev->sg[dev->start_sg];
- req->sector += last_sectors;
io_req = kmalloc(sizeof(struct io_thread_req),
GFP_ATOMIC);
if(io_req == NULL){
@@ -1251,10 +1251,10 @@ static void do_ubd_request(struct request_queue *q)
return;
}
prepare_request(req, io_req,
- (unsigned long long) req->sector << 9,
+ (unsigned long long)sector << 9,
sg->offset, sg->length, sg_page(sg));
- last_sectors = sg->length >> 9;
+ sector += sg->length >> 9;
n = os_write_file(thread_fd, &io_req,
sizeof(struct io_thread_req *));
if(n != sizeof(struct io_thread_req *)){
OpenPOWER on IntegriCloud