aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/ubd_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/ubd_kern.c')
-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 *)){