Commit 264780c2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  ubd: fix incorrect sector handling during request restart
  ps3disk: passing wrong variable to bvec_kunmap_irq()
parents 8fd01d6c 47526903
...@@ -163,6 +163,7 @@ struct ubd { ...@@ -163,6 +163,7 @@ struct ubd {
struct scatterlist sg[MAX_SG]; struct scatterlist sg[MAX_SG];
struct request *request; struct request *request;
int start_sg, end_sg; int start_sg, end_sg;
sector_t rq_pos;
}; };
#define DEFAULT_COW { \ #define DEFAULT_COW { \
...@@ -187,6 +188,7 @@ struct ubd { ...@@ -187,6 +188,7 @@ struct ubd {
.request = NULL, \ .request = NULL, \
.start_sg = 0, \ .start_sg = 0, \
.end_sg = 0, \ .end_sg = 0, \
.rq_pos = 0, \
} }
/* Protected by ubd_lock */ /* Protected by ubd_lock */
...@@ -1228,7 +1230,6 @@ static void do_ubd_request(struct request_queue *q) ...@@ -1228,7 +1230,6 @@ static void do_ubd_request(struct request_queue *q)
{ {
struct io_thread_req *io_req; struct io_thread_req *io_req;
struct request *req; struct request *req;
sector_t sector;
int n; int n;
while(1){ while(1){
...@@ -1239,12 +1240,12 @@ static void do_ubd_request(struct request_queue *q) ...@@ -1239,12 +1240,12 @@ static void do_ubd_request(struct request_queue *q)
return; return;
dev->request = req; dev->request = req;
dev->rq_pos = blk_rq_pos(req);
dev->start_sg = 0; dev->start_sg = 0;
dev->end_sg = blk_rq_map_sg(q, req, dev->sg); dev->end_sg = blk_rq_map_sg(q, req, dev->sg);
} }
req = dev->request; req = dev->request;
sector = blk_rq_pos(req);
while(dev->start_sg < dev->end_sg){ while(dev->start_sg < dev->end_sg){
struct scatterlist *sg = &dev->sg[dev->start_sg]; struct scatterlist *sg = &dev->sg[dev->start_sg];
...@@ -1256,10 +1257,9 @@ static void do_ubd_request(struct request_queue *q) ...@@ -1256,10 +1257,9 @@ static void do_ubd_request(struct request_queue *q)
return; return;
} }
prepare_request(req, io_req, prepare_request(req, io_req,
(unsigned long long)sector << 9, (unsigned long long)dev->rq_pos << 9,
sg->offset, sg->length, sg_page(sg)); sg->offset, sg->length, sg_page(sg));
sector += sg->length >> 9;
n = os_write_file(thread_fd, &io_req, n = os_write_file(thread_fd, &io_req,
sizeof(struct io_thread_req *)); sizeof(struct io_thread_req *));
if(n != sizeof(struct io_thread_req *)){ if(n != sizeof(struct io_thread_req *)){
...@@ -1272,6 +1272,7 @@ static void do_ubd_request(struct request_queue *q) ...@@ -1272,6 +1272,7 @@ static void do_ubd_request(struct request_queue *q)
return; return;
} }
dev->rq_pos += sg->length >> 9;
dev->start_sg++; dev->start_sg++;
} }
dev->end_sg = 0; dev->end_sg = 0;
......
...@@ -113,7 +113,7 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev, ...@@ -113,7 +113,7 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev,
memcpy(buf, dev->bounce_buf+offset, size); memcpy(buf, dev->bounce_buf+offset, size);
offset += size; offset += size;
flush_kernel_dcache_page(bvec->bv_page); flush_kernel_dcache_page(bvec->bv_page);
bvec_kunmap_irq(bvec, &flags); bvec_kunmap_irq(buf, &flags);
i++; i++;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment