summaryrefslogtreecommitdiff
path: root/include/linux/device-mapper.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2009-06-22 13:12:33 +0400
committerAlasdair G Kergon <agk@redhat.com>2009-06-22 13:12:33 +0400
commitaf4874e03ed82f050d5872d8c39ce64bf16b5c38 (patch)
tree38aa5dee43b4bb7a369995d4f38dee992cb051e0 /include/linux/device-mapper.h
parent1197764e403d97231eb6da2b1e16f511a7fd3101 (diff)
downloadlinux-af4874e03ed82f050d5872d8c39ce64bf16b5c38.tar.xz
dm target:s introduce iterate devices fn
Add .iterate_devices to 'struct target_type' to allow a function to be called for all devices in a DM target. Implemented it for all targets except those in dm-snap.c (origin and snapshot). (The raid1 version number jumps to 1.12 because we originally reserved 1.1 to 1.11 for 'block_on_error' but ended up using 'handle_errors' instead.) Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Cc: martin.petersen@oracle.com
Diffstat (limited to 'include/linux/device-mapper.h')
-rw-r--r--include/linux/device-mapper.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 236880c1dc3f..deac3b4e5e18 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -11,6 +11,7 @@
#include <linux/bio.h>
#include <linux/blkdev.h>
+struct dm_dev;
struct dm_target;
struct dm_table;
struct mapped_device;
@@ -81,6 +82,15 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd,
typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
struct bio_vec *biovec, int max_size);
+typedef int (*iterate_devices_callout_fn) (struct dm_target *ti,
+ struct dm_dev *dev,
+ sector_t physical_start,
+ void *data);
+
+typedef int (*dm_iterate_devices_fn) (struct dm_target *ti,
+ iterate_devices_callout_fn fn,
+ void *data);
+
/*
* Returns:
* 0: The target can handle the next I/O immediately.
@@ -139,6 +149,7 @@ struct target_type {
dm_ioctl_fn ioctl;
dm_merge_fn merge;
dm_busy_fn busy;
+ dm_iterate_devices_fn iterate_devices;
/* For internal device-mapper use. */
struct list_head list;