aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2009-06-22 05:12:33 -0400
committerAlasdair G Kergon <agk@redhat.com>2009-06-22 05:12:33 -0400
commitaf4874e03ed82f050d5872d8c39ce64bf16b5c38 (patch)
tree38aa5dee43b4bb7a369995d4f38dee992cb051e0 /include
parent1197764e403d97231eb6da2b1e16f511a7fd3101 (diff)
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')
-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 @@
11#include <linux/bio.h> 11#include <linux/bio.h>
12#include <linux/blkdev.h> 12#include <linux/blkdev.h>
13 13
14struct dm_dev;
14struct dm_target; 15struct dm_target;
15struct dm_table; 16struct dm_table;
16struct mapped_device; 17struct mapped_device;
@@ -81,6 +82,15 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd,
81typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, 82typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
82 struct bio_vec *biovec, int max_size); 83 struct bio_vec *biovec, int max_size);
83 84
85typedef int (*iterate_devices_callout_fn) (struct dm_target *ti,
86 struct dm_dev *dev,
87 sector_t physical_start,
88 void *data);
89
90typedef int (*dm_iterate_devices_fn) (struct dm_target *ti,
91 iterate_devices_callout_fn fn,
92 void *data);
93
84/* 94/*
85 * Returns: 95 * Returns:
86 * 0: The target can handle the next I/O immediately. 96 * 0: The target can handle the next I/O immediately.
@@ -139,6 +149,7 @@ struct target_type {
139 dm_ioctl_fn ioctl; 149 dm_ioctl_fn ioctl;
140 dm_merge_fn merge; 150 dm_merge_fn merge;
141 dm_busy_fn busy; 151 dm_busy_fn busy;
152 dm_iterate_devices_fn iterate_devices;
142 153
143 /* For internal device-mapper use. */ 154 /* For internal device-mapper use. */
144 struct list_head list; 155 struct list_head list;