Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147025
b: refs/heads/master
c: 6b0bf40
h: refs/heads/master
i:
  147023: 945122a
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed May 11, 2009
1 parent f77a778 commit aeba14e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 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: 1498ada7a8e80afe324f2b8d86158925d0096ec9
refs/heads/master: 6b0bf407b586b6ba8e060ad9979cb2bc3370b7eb
28 changes: 17 additions & 11 deletions trunk/drivers/sbus/char/jsflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,31 +186,37 @@ static void jsfd_do_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) {
struct jsfd_part *jdp = req->rq_disk->private_data;
unsigned long offset = blk_rq_pos(req) << 9;
size_t len = blk_rq_cur_bytes(req);
int err = -EIO;

if ((offset + len) > jdp->dsize) {
__blk_end_request_cur(req, -EIO);
continue;
}
if ((offset + len) > jdp->dsize)
goto end;

if (rq_data_dir(req) != READ) {
printk(KERN_ERR "jsfd: write\n");
__blk_end_request_cur(req, -EIO);
continue;
goto end;
}

if ((jdp->dbase & 0xff000000) != 0x20000000) {
printk(KERN_ERR "jsfd: bad base %x\n", (int)jdp->dbase);
__blk_end_request_cur(req, -EIO);
continue;
goto end;
}

jsfd_read(req->buffer, jdp->dbase + offset, len);

__blk_end_request_cur(req, 0);
err = 0;
end:
if (!__blk_end_request_cur(req, err)) {
req = elv_next_request(q);
if (req)
blkdev_dequeue_request(req);
}
}
}

Expand Down

0 comments on commit aeba14e

Please sign in to comment.