diff options
author | Christoph Hellwig <hch@lst.de> | 2017-06-03 09:38:03 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-06-09 17:27:32 +0200 |
commit | 1be5690984588953e759af0a4c6ddac182a1806c (patch) | |
tree | 703e6e07de09bb76f3fd0de3a84afa34ace79183 /drivers/md/dm-mpath.c | |
parent | dm: don't return errnos from ->map (diff) | |
download | linux-1be5690984588953e759af0a4c6ddac182a1806c.tar.xz linux-1be5690984588953e759af0a4c6ddac182a1806c.zip |
dm: change ->end_io calling convention
Turn the error paramter into a pointer so that target drivers can change
the value, and make sure only DM_ENDIO_* values are returned from the
methods.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r-- | drivers/md/dm-mpath.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index bf6e49c780d5..ceeeb495d01c 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1517,14 +1517,15 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone, return r; } -static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone, int error) +static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone, int *error) { struct multipath *m = ti->private; struct dm_mpath_io *mpio = get_mpio_from_bio(clone); struct pgpath *pgpath = mpio->pgpath; unsigned long flags; + int r = DM_ENDIO_DONE; - if (!error || noretry_error(error)) + if (!*error || noretry_error(*error)) goto done; if (pgpath) @@ -1533,7 +1534,7 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone, int err if (atomic_read(&m->nr_valid_paths) == 0 && !test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) { dm_report_EIO(m); - error = -EIO; + *error = -EIO; goto done; } @@ -1546,7 +1547,7 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone, int err if (!test_bit(MPATHF_QUEUE_IO, &m->flags)) queue_work(kmultipathd, &m->process_queued_bios); - error = DM_ENDIO_INCOMPLETE; + r = DM_ENDIO_INCOMPLETE; done: if (pgpath) { struct path_selector *ps = &pgpath->pg->ps; @@ -1555,7 +1556,7 @@ done: ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes); } - return error; + return r; } /* |