Move bio completion from dm_rh_mark_nosync to its caller. It is more understandable this way. Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx> --- drivers/md/dm-raid1.c | 3 ++- drivers/md/dm-region-hash.c | 6 +----- include/linux/dm-region-hash.h | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) Index: linux-2.6.31.6-fast/drivers/md/dm-raid1.c =================================================================== --- linux-2.6.31.6-fast.orig/drivers/md/dm-raid1.c 2009-11-18 10:51:37.000000000 +0100 +++ linux-2.6.31.6-fast/drivers/md/dm-raid1.c 2009-11-18 10:53:00.000000000 +0100 @@ -729,7 +729,8 @@ static void do_failures(struct mirror_se while ((bio = bio_list_pop(failures))) { if (!ms->log_failure) { ms->in_sync = 0; - dm_rh_mark_nosync(ms->rh, bio, bio->bi_size, 0); + dm_rh_mark_nosync(ms->rh, bio); + bio_endio(bio, 0); } else { hold_bio(ms, bio); } Index: linux-2.6.31.6-fast/drivers/md/dm-region-hash.c =================================================================== --- linux-2.6.31.6-fast.orig/drivers/md/dm-region-hash.c 2009-11-18 10:53:10.000000000 +0100 +++ linux-2.6.31.6-fast/drivers/md/dm-region-hash.c 2009-11-18 10:59:17.000000000 +0100 @@ -392,8 +392,6 @@ static void complete_resync_work(struct /* dm_rh_mark_nosync * @ms * @bio - * @done - * @error * * The bio was written on some mirror(s) but failed on other mirror(s). * We can successfully endio the bio but should avoid the region being @@ -401,8 +399,7 @@ static void complete_resync_work(struct * * This function is _not_ safe in interrupt context! */ -void dm_rh_mark_nosync(struct dm_region_hash *rh, - struct bio *bio, unsigned done, int error) +void dm_rh_mark_nosync(struct dm_region_hash *rh, struct bio *bio) { unsigned long flags; struct dm_dirty_log *log = rh->log; @@ -439,7 +436,6 @@ void dm_rh_mark_nosync(struct dm_region_ BUG_ON(!list_empty(®->list)); spin_unlock_irqrestore(&rh->region_lock, flags); - bio_endio(bio, error); if (recovering) complete_resync_work(reg, 0); } Index: linux-2.6.31.6-fast/include/linux/dm-region-hash.h =================================================================== --- linux-2.6.31.6-fast.orig/include/linux/dm-region-hash.h 2009-11-18 10:53:39.000000000 +0100 +++ linux-2.6.31.6-fast/include/linux/dm-region-hash.h 2009-11-18 10:53:45.000000000 +0100 @@ -78,8 +78,7 @@ void dm_rh_dec(struct dm_region_hash *rh /* Delay bios on regions. */ void dm_rh_delay(struct dm_region_hash *rh, struct bio *bio); -void dm_rh_mark_nosync(struct dm_region_hash *rh, - struct bio *bio, unsigned done, int error); +void dm_rh_mark_nosync(struct dm_region_hash *rh, struct bio *bio); /* * Region recovery control. -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel