Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242237
b: refs/heads/master
c: 143a87f
h: refs/heads/master
i:
  242235: 3383c1e
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Jan 25, 2011
1 parent 8c59048 commit 1bb3d13
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 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: 414b4ff5eecff0097d09c4a7da12e435fd503692
refs/heads/master: 143a87f4c9c629067afea5b6703d66ea88c82f8e
48 changes: 21 additions & 27 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,37 +136,31 @@ static void req_bio_endio(struct request *rq, struct bio *bio,
{
struct request_queue *q = rq->q;

if (!(rq->cmd_flags & REQ_FLUSH_SEQ)) {
if (error)
clear_bit(BIO_UPTODATE, &bio->bi_flags);
else if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
error = -EIO;

if (unlikely(nbytes > bio->bi_size)) {
printk(KERN_ERR "%s: want %u bytes done, %u left\n",
__func__, nbytes, bio->bi_size);
nbytes = bio->bi_size;
}
if (error)
clear_bit(BIO_UPTODATE, &bio->bi_flags);
else if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
error = -EIO;

if (unlikely(nbytes > bio->bi_size)) {
printk(KERN_ERR "%s: want %u bytes done, %u left\n",
__func__, nbytes, bio->bi_size);
nbytes = bio->bi_size;
}

if (unlikely(rq->cmd_flags & REQ_QUIET))
set_bit(BIO_QUIET, &bio->bi_flags);
if (unlikely(rq->cmd_flags & REQ_QUIET))
set_bit(BIO_QUIET, &bio->bi_flags);

bio->bi_size -= nbytes;
bio->bi_sector += (nbytes >> 9);
bio->bi_size -= nbytes;
bio->bi_sector += (nbytes >> 9);

if (bio_integrity(bio))
bio_integrity_advance(bio, nbytes);
if (bio_integrity(bio))
bio_integrity_advance(bio, nbytes);

if (bio->bi_size == 0)
bio_endio(bio, error);
} else {
/*
* Okay, this is the sequenced flush request in
* progress, just record the error;
*/
if (error && !q->flush_err)
q->flush_err = error;
}
/* don't actually finish bio if it's part of flush sequence */
if (bio->bi_size == 0 && !(rq->cmd_flags & REQ_FLUSH_SEQ))
bio_endio(bio, error);
else if (error && !q->flush_err)
q->flush_err = error;
}

void blk_dump_rq_flags(struct request *rq, char *msg)
Expand Down

0 comments on commit 1bb3d13

Please sign in to comment.