forked from Minki/linux
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()
This commit is contained in:
commit
264780c290
@ -163,6 +163,7 @@ struct ubd {
|
||||
struct scatterlist sg[MAX_SG];
|
||||
struct request *request;
|
||||
int start_sg, end_sg;
|
||||
sector_t rq_pos;
|
||||
};
|
||||
|
||||
#define DEFAULT_COW { \
|
||||
@ -187,6 +188,7 @@ struct ubd {
|
||||
.request = NULL, \
|
||||
.start_sg = 0, \
|
||||
.end_sg = 0, \
|
||||
.rq_pos = 0, \
|
||||
}
|
||||
|
||||
/* Protected by ubd_lock */
|
||||
@ -1228,7 +1230,6 @@ static void do_ubd_request(struct request_queue *q)
|
||||
{
|
||||
struct io_thread_req *io_req;
|
||||
struct request *req;
|
||||
sector_t sector;
|
||||
int n;
|
||||
|
||||
while(1){
|
||||
@ -1239,12 +1240,12 @@ static void do_ubd_request(struct request_queue *q)
|
||||
return;
|
||||
|
||||
dev->request = req;
|
||||
dev->rq_pos = blk_rq_pos(req);
|
||||
dev->start_sg = 0;
|
||||
dev->end_sg = blk_rq_map_sg(q, req, dev->sg);
|
||||
}
|
||||
|
||||
req = dev->request;
|
||||
sector = blk_rq_pos(req);
|
||||
while(dev->start_sg < dev->end_sg){
|
||||
struct scatterlist *sg = &dev->sg[dev->start_sg];
|
||||
|
||||
@ -1256,10 +1257,9 @@ static void do_ubd_request(struct request_queue *q)
|
||||
return;
|
||||
}
|
||||
prepare_request(req, io_req,
|
||||
(unsigned long long)sector << 9,
|
||||
(unsigned long long)dev->rq_pos << 9,
|
||||
sg->offset, sg->length, sg_page(sg));
|
||||
|
||||
sector += sg->length >> 9;
|
||||
n = os_write_file(thread_fd, &io_req,
|
||||
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)
|
||||
return;
|
||||
}
|
||||
|
||||
dev->rq_pos += sg->length >> 9;
|
||||
dev->start_sg++;
|
||||
}
|
||||
dev->end_sg = 0;
|
||||
|
@ -113,7 +113,7 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev,
|
||||
memcpy(buf, dev->bounce_buf+offset, size);
|
||||
offset += size;
|
||||
flush_kernel_dcache_page(bvec->bv_page);
|
||||
bvec_kunmap_irq(bvec, &flags);
|
||||
bvec_kunmap_irq(buf, &flags);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user