Skip to content

Commit

Permalink
dm raid1: remove bio_endio from dm_rh_mark_nosync
Browse files Browse the repository at this point in the history
Move bio completion out of dm_rh_mark_nosync in preparation for the
next patch.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Takahiro Yasui <tyasui@redhat.com>
Tested-by: Takahiro Yasui <tyasui@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Dec 10, 2009
1 parent 87968dd commit c58098b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 2 additions & 1 deletion drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ static void do_failures(struct mirror_set *ms, struct bio_list *failures)
hold_bio(ms, bio);
else {
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);
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions drivers/md/dm-region-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,14 @@ static void complete_resync_work(struct dm_region *reg, int success)
/* 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
* marked clean by setting the state DM_RH_NOSYNC.
*
* 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;
Expand Down Expand Up @@ -430,7 +427,6 @@ void dm_rh_mark_nosync(struct dm_region_hash *rh,
BUG_ON(!list_empty(&reg->list));
spin_unlock_irqrestore(&rh->region_lock, flags);

bio_endio(bio, error);
if (recovering)
complete_resync_work(reg, 0);
}
Expand Down
3 changes: 1 addition & 2 deletions include/linux/dm-region-hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ void dm_rh_dec(struct dm_region_hash *rh, region_t region);
/* 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.
Expand Down

0 comments on commit c58098b

Please sign in to comment.