aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-04-28 00:06:10 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-28 02:14:51 -0400
commitf81f2f7c9fee307e371f37424577d46f9eaf8692 (patch)
tree75bb4afd8690847234d502ad244d90c8c20a7bc6 /arch/um
parent4d6c84d91d1a539ebc47d1a36a35e9390ba11fdc (diff)
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/um')
-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)
1222{ 1222{
1223 struct io_thread_req *io_req; 1223 struct io_thread_req *io_req;
1224 struct request *req; 1224 struct request *req;
1225 int n, last_sectors; 1225 sector_t sector;
1226 int n;
1226 1227
1227 while(1){ 1228 while(1){
1228 struct ubd *dev = q->queuedata; 1229 struct ubd *dev = q->queuedata;
@@ -1238,11 +1239,10 @@ static void do_ubd_request(struct request_queue *q)
1238 } 1239 }
1239 1240
1240 req = dev->request; 1241 req = dev->request;
1241 last_sectors = 0; 1242 sector = req->sector;
1242 while(dev->start_sg < dev->end_sg){ 1243 while(dev->start_sg < dev->end_sg){
1243 struct scatterlist *sg = &dev->sg[dev->start_sg]; 1244 struct scatterlist *sg = &dev->sg[dev->start_sg];
1244 1245
1245 req->sector += last_sectors;
1246 io_req = kmalloc(sizeof(struct io_thread_req), 1246 io_req = kmalloc(sizeof(struct io_thread_req),
1247 GFP_ATOMIC); 1247 GFP_ATOMIC);
1248 if(io_req == NULL){ 1248 if(io_req == NULL){
@@ -1251,10 +1251,10 @@ static void do_ubd_request(struct request_queue *q)
1251 return; 1251 return;
1252 } 1252 }
1253 prepare_request(req, io_req, 1253 prepare_request(req, io_req,
1254 (unsigned long long) req->sector << 9, 1254 (unsigned long long)sector << 9,
1255 sg->offset, sg->length, sg_page(sg)); 1255 sg->offset, sg->length, sg_page(sg));
1256 1256
1257 last_sectors = sg->length >> 9; 1257 sector += sg->length >> 9;
1258 n = os_write_file(thread_fd, &io_req, 1258 n = os_write_file(thread_fd, &io_req,
1259 sizeof(struct io_thread_req *)); 1259 sizeof(struct io_thread_req *));
1260 if(n != sizeof(struct io_thread_req *)){ 1260 if(n != sizeof(struct io_thread_req *)){