Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147026
b: refs/heads/master
c: fb3ac7f
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed May 11, 2009
1 parent aeba14e commit d633fc9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b0bf407b586b6ba8e060ad9979cb2bc3370b7eb
refs/heads/master: fb3ac7f6b811eac8e0aafa3df1c16ed872e898a8
19 changes: 15 additions & 4 deletions trunk/drivers/block/z2ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,21 @@ static struct gendisk *z2ram_gendisk;
static void do_z2_request(struct request_queue *q)
{
struct request *req;
while ((req = elv_next_request(q)) != NULL) {

req = elv_next_request(q);
if (req)
blkdev_dequeue_request(req);

while (req) {
unsigned long start = blk_rq_pos(req) << 9;
unsigned long len = blk_rq_cur_bytes(req);
int err = 0;

if (start + len > z2ram_size) {
printk( KERN_ERR DEVICE_NAME ": bad access: block=%lu, count=%u\n",
blk_rq_pos(req), blk_rq_cur_sectors(req));
__blk_end_request_cur(req, -EIO);
continue;
err = -EIO;
goto done;
}
while (len) {
unsigned long addr = start & Z2RAM_CHUNKMASK;
Expand All @@ -93,7 +99,12 @@ static void do_z2_request(struct request_queue *q)
start += size;
len -= size;
}
__blk_end_request_cur(req, 0);
done:
if (!__blk_end_request_cur(req, err)) {
req = elv_next_request(q);
if (req)
blkdev_dequeue_request(req);
}
}
}

Expand Down

0 comments on commit d633fc9

Please sign in to comment.