Skip to content

Commit

Permalink
dm: make dm_flush return void
Browse files Browse the repository at this point in the history
Make dm_flush return void.

The first error during flush is stored in md->barrier_error instead.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Jun 22, 2009
1 parent 32a926d commit 531fe96
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,34 +1439,25 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible)
return r;
}

static int dm_flush(struct mapped_device *md)
static void dm_flush(struct mapped_device *md)
{
dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE);
return 0;
}

static void process_barrier(struct mapped_device *md, struct bio *bio)
{
int error = dm_flush(md);
dm_flush(md);

if (unlikely(error)) {
bio_endio(bio, error);
return;
}
if (bio_empty_barrier(bio)) {
bio_endio(bio, 0);
return;
}

__split_and_process_bio(md, bio);

error = dm_flush(md);

if (!error && md->barrier_error)
error = md->barrier_error;
dm_flush(md);

if (md->barrier_error != DM_ENDIO_REQUEUE)
bio_endio(bio, error);
bio_endio(bio, md->barrier_error);
}

/*
Expand Down

0 comments on commit 531fe96

Please sign in to comment.