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-crypt.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-crypt.c')
-rw-r--r-- | drivers/md/dm-crypt.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 04db6c4004a8..9933eb861c71 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -1313,9 +1313,17 @@ static int crypt_merge(struct dm_target *ti, struct bvec_merge_data *bvm, | |||
1313 | return min(max_size, q->merge_bvec_fn(q, bvm, biovec)); | 1313 | return min(max_size, q->merge_bvec_fn(q, bvm, biovec)); |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | static int crypt_iterate_devices(struct dm_target *ti, | ||
1317 | iterate_devices_callout_fn fn, void *data) | ||
1318 | { | ||
1319 | struct crypt_config *cc = ti->private; | ||
1320 | |||
1321 | return fn(ti, cc->dev, cc->start, data); | ||
1322 | } | ||
1323 | |||
1316 | static struct target_type crypt_target = { | 1324 | static struct target_type crypt_target = { |
1317 | .name = "crypt", | 1325 | .name = "crypt", |
1318 | .version= {1, 6, 0}, | 1326 | .version = {1, 7, 0}, |
1319 | .module = THIS_MODULE, | 1327 | .module = THIS_MODULE, |
1320 | .ctr = crypt_ctr, | 1328 | .ctr = crypt_ctr, |
1321 | .dtr = crypt_dtr, | 1329 | .dtr = crypt_dtr, |
@@ -1326,6 +1334,7 @@ static struct target_type crypt_target = { | |||
1326 | .resume = crypt_resume, | 1334 | .resume = crypt_resume, |
1327 | .message = crypt_message, | 1335 | .message = crypt_message, |
1328 | .merge = crypt_merge, | 1336 | .merge = crypt_merge, |
1337 | .iterate_devices = crypt_iterate_devices, | ||
1329 | }; | 1338 | }; |
1330 | 1339 | ||
1331 | static int __init dm_crypt_init(void) | 1340 | static int __init dm_crypt_init(void) |