aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/platforms
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-07-20 09:29:37 -0400
committerJens Axboe <axboe@fb.com>2015-07-29 10:55:15 -0400
commit4246a0b63bd8f56a1469b12eafeb875b1041a451 (patch)
tree3281bb158d658ef7f208ad380c0ecee600a5ab5e /arch/xtensa/platforms
parent0034af036554c39eefd14d835a8ec3496ac46712 (diff)
block: add a bi_error field to struct bio
Currently we have two different ways to signal an I/O error on a BIO: (1) by clearing the BIO_UPTODATE flag (2) by returning a Linux errno value to the bi_end_io callback The first one has the drawback of only communicating a single possible error (-EIO), and the second one has the drawback of not beeing persistent when bios are queued up, and are not passed along from child to parent bio in the ever more popular chaining scenario. Having both mechanisms available has the additional drawback of utterly confusing driver authors and introducing bugs where various I/O submitters only deal with one of them, and the others have to add boilerplate code to deal with both kinds of error returns. So add a new bi_error field to store an errno value directly in struct bio and remove the existing mechanisms to clean all this up. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'arch/xtensa/platforms')
-rw-r--r--arch/xtensa/platforms/iss/simdisk.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c
index 48eebacdf5fe..fa84ca990caa 100644
--- a/arch/xtensa/platforms/iss/simdisk.c
+++ b/arch/xtensa/platforms/iss/simdisk.c
@@ -101,8 +101,9 @@ static void simdisk_transfer(struct simdisk *dev, unsigned long sector,
101 spin_unlock(&dev->lock); 101 spin_unlock(&dev->lock);
102} 102}
103 103
104static int simdisk_xfer_bio(struct simdisk *dev, struct bio *bio) 104static void simdisk_make_request(struct request_queue *q, struct bio *bio)
105{ 105{
106 struct simdisk *dev = q->queuedata;
106 struct bio_vec bvec; 107 struct bio_vec bvec;
107 struct bvec_iter iter; 108 struct bvec_iter iter;
108 sector_t sector = bio->bi_iter.bi_sector; 109 sector_t sector = bio->bi_iter.bi_sector;
@@ -116,17 +117,10 @@ static int simdisk_xfer_bio(struct simdisk *dev, struct bio *bio)
116 sector += len; 117 sector += len;
117 __bio_kunmap_atomic(buffer); 118 __bio_kunmap_atomic(buffer);
118 } 119 }
119 return 0;
120}
121 120
122static void simdisk_make_request(struct request_queue *q, struct bio *bio) 121 bio_endio(bio);
123{
124 struct simdisk *dev = q->queuedata;
125 int status = simdisk_xfer_bio(dev, bio);
126 bio_endio(bio, status);
127} 122}
128 123
129
130static int simdisk_open(struct block_device *bdev, fmode_t mode) 124static int simdisk_open(struct block_device *bdev, fmode_t mode)
131{ 125{
132 struct simdisk *dev = bdev->bd_disk->private_data; 126 struct simdisk *dev = bdev->bd_disk->private_data;