diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-03-11 16:13:40 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-03-11 16:13:40 -0800 |
| commit | ba657cf7696bf324ae660b642f23258a1bc50028 (patch) | |
| tree | 365c44d27b5e12aa91ae45d84ce08ff011ab5c44 /include/linux | |
| parent | e8c8fab4f4d8a23b95223189b4f7b4ffb2d80de0 (diff) | |
[PATCH] dm: endio method
From: Joe Thornber <thornber@redhat.com>
Add an endio method to targets. This method is allowed to request another
shot at failed ios (think multipath). Context can be passed between the map
method and the endio method.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/device-mapper.h | 20 |
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; |
