summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/device-mapper.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 40ea6338e1a1..a9ecba77fb30 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -13,6 +13,11 @@ struct dm_dev;
typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t;
+union map_info {
+ void *ptr;
+ unsigned long long ll;
+};
+
/*
* In the constructor the target parameter will already have the
* table, type, begin and len fields filled in.
@@ -32,7 +37,19 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti);
* = 0: The target will handle the io by resubmitting it later
* > 0: simple remap complete
*/
-typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio);
+typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
+ union map_info *map_context);
+
+/*
+ * Returns:
+ * < 0 : error (currently ignored)
+ * 0 : ended successfully
+ * 1 : for some reason the io has still not completed (eg,
+ * multipath target might want to requeue a failed io).
+ */
+typedef int (*dm_endio_fn) (struct dm_target *ti,
+ struct bio *bio, int error,
+ union map_info *map_context);
typedef void (*dm_suspend_fn) (struct dm_target *ti);
typedef void (*dm_resume_fn) (struct dm_target *ti);
@@ -60,6 +77,7 @@ struct target_type {
dm_ctr_fn ctr;
dm_dtr_fn dtr;
dm_map_fn map;
+ dm_endio_fn end_io;
dm_suspend_fn suspend;
dm_resume_fn resume;
dm_status_fn status;