Commit 412445ac authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Mike Snitzer

dm: introduce a new DM_MAPIO_KILL return value

This untangles the DM_MAPIO_* values returned from ->clone_and_map_rq
from the error codes used by the block layer.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 7ed8578a
...@@ -504,14 +504,12 @@ static int map_request(struct dm_rq_target_io *tio) ...@@ -504,14 +504,12 @@ static int map_request(struct dm_rq_target_io *tio)
/* The target wants to requeue the I/O after a delay */ /* The target wants to requeue the I/O after a delay */
dm_requeue_original_request(tio, true); dm_requeue_original_request(tio, true);
break; break;
default: case DM_MAPIO_KILL:
if (r > 0) {
DMWARN("unimplemented target map return value: %d", r);
BUG();
}
/* The target wants to complete the I/O */ /* The target wants to complete the I/O */
dm_kill_unmapped_request(rq, r); dm_kill_unmapped_request(rq, -EIO);
default:
DMWARN("unimplemented target map return value: %d", r);
BUG();
} }
return r; return r;
......
...@@ -135,7 +135,7 @@ static int io_err_clone_and_map_rq(struct dm_target *ti, struct request *rq, ...@@ -135,7 +135,7 @@ static int io_err_clone_and_map_rq(struct dm_target *ti, struct request *rq,
union map_info *map_context, union map_info *map_context,
struct request **clone) struct request **clone)
{ {
return -EIO; return DM_MAPIO_KILL;
} }
static void io_err_release_clone_rq(struct request *clone) static void io_err_release_clone_rq(struct request *clone)
......
...@@ -604,6 +604,7 @@ extern struct ratelimit_state dm_ratelimit_state; ...@@ -604,6 +604,7 @@ extern struct ratelimit_state dm_ratelimit_state;
#define DM_MAPIO_REMAPPED 1 #define DM_MAPIO_REMAPPED 1
#define DM_MAPIO_REQUEUE DM_ENDIO_REQUEUE #define DM_MAPIO_REQUEUE DM_ENDIO_REQUEUE
#define DM_MAPIO_DELAY_REQUEUE 3 #define DM_MAPIO_DELAY_REQUEUE 3
#define DM_MAPIO_KILL 4
#define dm_sector_div64(x, y)( \ #define dm_sector_div64(x, y)( \
{ \ { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment