diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-03-08 14:22:02 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2016-10-07 12:35:45 -0800 |
commit | d425a352c93afe8a4d7ab506055b18996ee9051a (patch) | |
tree | b3da538c8e5423747b5cf88bbf43bbb5e7eedcc1 | |
parent | 4524d2c05b839d77f45f5de8ef9e380386883050 (diff) |
block: bio_endio_nodec()
i have a feeling we had something like this once and i was the one who insisted
on getting rid of it...
-rw-r--r-- | block/bio.c | 22 | ||||
-rw-r--r-- | include/linux/bio.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/block/bio.c b/block/bio.c index 3fca46e0945b..18bc574f6368 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1831,6 +1831,28 @@ again: } EXPORT_SYMBOL(bio_endio); +void bio_endio_nodec(struct bio *bio) +{ + goto nodec; + + while (bio) { + if (unlikely(!bio_remaining_done(bio))) + break; +nodec: + if (bio->bi_end_io == bio_chain_endio) { + struct bio *parent = bio->bi_private; + parent->bi_error = bio->bi_error; + bio_put(bio); + bio = parent; + } else { + if (bio->bi_end_io) + bio->bi_end_io(bio); + bio = NULL; + } + } +} +EXPORT_SYMBOL(bio_endio_nodec); + /** * bio_split - split a bio * @bio: bio to split diff --git a/include/linux/bio.h b/include/linux/bio.h index b3bb07d2c447..8bf46c64c341 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -407,6 +407,7 @@ static inline struct bio *bio_clone_kmalloc(struct bio *bio, gfp_t gfp_mask) } extern void bio_endio(struct bio *); +extern void bio_endio_nodec(struct bio *); static inline void bio_io_error(struct bio *bio) { |