diff options
author | Mike Snitzer <snitzer@redhat.com> | 2009-06-22 05:12:33 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-06-22 05:12:33 -0400 |
commit | af4874e03ed82f050d5872d8c39ce64bf16b5c38 (patch) | |
tree | 38aa5dee43b4bb7a369995d4f38dee992cb051e0 /drivers/md/dm-linear.c | |
parent | 1197764e403d97231eb6da2b1e16f511a7fd3101 (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 'drivers/md/dm-linear.c')
-rw-r--r-- | drivers/md/dm-linear.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index ecbb17421da4..9184b6deb868 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md/dm-linear.c | |||
@@ -134,9 +134,17 @@ static int linear_merge(struct dm_target *ti, struct bvec_merge_data *bvm, | |||
134 | return min(max_size, q->merge_bvec_fn(q, bvm, biovec)); | 134 | return min(max_size, q->merge_bvec_fn(q, bvm, biovec)); |
135 | } | 135 | } |
136 | 136 | ||
137 | static int linear_iterate_devices(struct dm_target *ti, | ||
138 | iterate_devices_callout_fn fn, void *data) | ||
139 | { | ||
140 | struct linear_c *lc = ti->private; | ||
141 | |||
142 | return fn(ti, lc->dev, lc->start, data); | ||
143 | } | ||
144 | |||
137 | static struct target_type linear_target = { | 145 | static struct target_type linear_target = { |
138 | .name = "linear", | 146 | .name = "linear", |
139 | .version= {1, 0, 3}, | 147 | .version = {1, 1, 0}, |
140 | .module = THIS_MODULE, | 148 | .module = THIS_MODULE, |
141 | .ctr = linear_ctr, | 149 | .ctr = linear_ctr, |
142 | .dtr = linear_dtr, | 150 | .dtr = linear_dtr, |
@@ -144,6 +152,7 @@ static struct target_type linear_target = { | |||
144 | .status = linear_status, | 152 | .status = linear_status, |
145 | .ioctl = linear_ioctl, | 153 | .ioctl = linear_ioctl, |
146 | .merge = linear_merge, | 154 | .merge = linear_merge, |
155 | .iterate_devices = linear_iterate_devices, | ||
147 | }; | 156 | }; |
148 | 157 | ||
149 | int __init dm_linear_init(void) | 158 | int __init dm_linear_init(void) |