diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-12-21 18:00:30 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-12-21 18:06:45 -0500 |
commit | 1cf4d51dc4661f336f5318c176a3561ddf5bf04f (patch) | |
tree | 8b390ccd48361ba1408be6799d46e62c6382cc39 /linux/blkdev.c | |
parent | 8acc54456e11ee0ec80ed0c6abb6d68abae60592 (diff) |
Update bcachefs sources to 14ce2a2031 bcachefs: fixes for building in userspace
Diffstat (limited to 'linux/blkdev.c')
-rw-r--r-- | linux/blkdev.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/linux/blkdev.c b/linux/blkdev.c index ea7db40b..156d5353 100644 --- a/linux/blkdev.c +++ b/linux/blkdev.c @@ -32,7 +32,7 @@ void generic_make_request(struct bio *bio) ret = fdatasync(bio->bi_bdev->bd_fd); if (ret) { fprintf(stderr, "fsync error: %m\n"); - bio->bi_error = -EIO; + bio->bi_status = BLK_STS_IOERR; bio_endio(bio); return; } @@ -106,7 +106,7 @@ int submit_bio_wait(struct bio *bio) submit_bio(bio); wait_for_completion(&done); - return bio->bi_error; + return blk_status_to_errno(bio->bi_status); } int blkdev_issue_discard(struct block_device *bdev, @@ -235,10 +235,8 @@ static int aio_completion_thread(void *arg) for (ev = events; ev < events + ret; ev++) { struct bio *bio = (struct bio *) ev->data; - if (ev->res < 0) - bio->bi_error = ev->res; - else if (ev->res != bio->bi_iter.bi_size) - bio->bi_error = -EIO; + if (ev->res != bio->bi_iter.bi_size) + bio->bi_status = BLK_STS_IOERR; bio_endio(bio); } |