summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-11-23 18:34:15 -0800
committerKent Overstreet <kmo@daterainc.com>2013-11-23 22:33:56 -0800
commit196d38bccfcfa32faed8c561868336fdfa0fe8e4 (patch)
tree9dee2bc174436072c9e90ffebbe71f47fde63aaf /drivers/md/dm-snap.c
parente90abc8ec323c1fd2a25600097ef7ae1e91f39b0 (diff)
downloadop-kernel-dev-196d38bccfcfa32faed8c561868336fdfa0fe8e4.zip
op-kernel-dev-196d38bccfcfa32faed8c561868336fdfa0fe8e4.tar.gz
block: Generic bio chaining
This adds a generic mechanism for chaining bio completions. This is going to be used for a bio_split() replacement, and it turns out to be very useful in a fair amount of driver code - a fair number of drivers were implementing this in their own roundabout ways, often painfully. Note that this means it's no longer to call bio_endio() more than once on the same bio! This can cause problems for drivers that save/restore bi_end_io. Arguably they shouldn't be saving/restoring bi_end_io at all - in all but the simplest cases they'd be better off just cloning the bio, and immutable biovecs is making bio cloning cheaper. But for now, we add a bio_endio_nodec() for these cases. Signed-off-by: Kent Overstreet <kmo@daterainc.com> Cc: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r--drivers/md/dm-snap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 3ded8c7..80b5cab 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1415,6 +1415,7 @@ out:
if (full_bio) {
full_bio->bi_end_io = pe->full_bio_end_io;
full_bio->bi_private = pe->full_bio_private;
+ atomic_inc(&full_bio->bi_remaining);
}
free_pending_exception(pe);
OpenPOWER on IntegriCloud