aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/ubd_kern.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 2e09f162c42f..0947f2e20045 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1083,7 +1083,7 @@ static void do_ubd_request(request_queue_t *q)
1083{ 1083{
1084 struct io_thread_req *io_req; 1084 struct io_thread_req *io_req;
1085 struct request *req; 1085 struct request *req;
1086 int n; 1086 int n, last_sectors;
1087 1087
1088 while(1){ 1088 while(1){
1089 struct ubd *dev = q->queuedata; 1089 struct ubd *dev = q->queuedata;
@@ -1099,9 +1099,11 @@ static void do_ubd_request(request_queue_t *q)
1099 } 1099 }
1100 1100
1101 req = dev->request; 1101 req = dev->request;
1102 last_sectors = 0;
1102 while(dev->start_sg < dev->end_sg){ 1103 while(dev->start_sg < dev->end_sg){
1103 struct scatterlist *sg = &dev->sg[dev->start_sg]; 1104 struct scatterlist *sg = &dev->sg[dev->start_sg];
1104 1105
1106 req->sector += last_sectors;
1105 io_req = kmalloc(sizeof(struct io_thread_req), 1107 io_req = kmalloc(sizeof(struct io_thread_req),
1106 GFP_ATOMIC); 1108 GFP_ATOMIC);
1107 if(io_req == NULL){ 1109 if(io_req == NULL){
@@ -1113,6 +1115,7 @@ static void do_ubd_request(request_queue_t *q)
1113 (unsigned long long) req->sector << 9, 1115 (unsigned long long) req->sector << 9,
1114 sg->offset, sg->length, sg->page); 1116 sg->offset, sg->length, sg->page);
1115 1117
1118 last_sectors = sg->length >> 9;
1116 n = os_write_file(thread_fd, &io_req, 1119 n = os_write_file(thread_fd, &io_req,
1117 sizeof(struct io_thread_req *)); 1120 sizeof(struct io_thread_req *));
1118 if(n != sizeof(struct io_thread_req *)){ 1121 if(n != sizeof(struct io_thread_req *)){
@@ -1124,7 +1127,6 @@ static void do_ubd_request(request_queue_t *q)
1124 return; 1127 return;
1125 } 1128 }
1126 1129
1127 req->sector += sg->length >> 9;
1128 dev->start_sg++; 1130 dev->start_sg++;
1129 } 1131 }
1130 dev->end_sg = 0; 1132 dev->end_sg = 0;