aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device-mapper.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-01-13 15:00:01 -0500
committerAlasdair G Kergon <agk@redhat.com>2011-01-13 15:00:01 -0500
commit9d357b0787bb3c91835d5e658c3bda178f9ca419 (patch)
tree48f2c3adc8ae06918ef0523f073291990407fa28 /include/linux/device-mapper.h
parent4e2d19e46b507018c6ed15f6c081d8f887ae229c (diff)
dm: introduce target callbacks and congestion callback
DM currently implements congestion checking by checking on congestion in each component device. For raid456 we need to also check if the stripe cache is congested. Add per-target congestion checker callback support. Extending the target_callbacks structure with additional callback functions allows for establishing multiple callbacks per-target (a callback is also needed for unplug). Cc: linux-raid@vger.kernel.org Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.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 2970022faa63..4b1c63d478ab 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -193,6 +193,12 @@ struct dm_target {
193 char *error; 193 char *error;
194}; 194};
195 195
196/* Each target can link one of these into the table */
197struct dm_target_callbacks {
198 struct list_head list;
199 int (*congested_fn) (struct dm_target_callbacks *, int);
200};
201
196int dm_register_target(struct target_type *t); 202int dm_register_target(struct target_type *t);
197void dm_unregister_target(struct target_type *t); 203void dm_unregister_target(struct target_type *t);
198 204
@@ -269,6 +275,11 @@ int dm_table_add_target(struct dm_table *t, const char *type,
269 sector_t start, sector_t len, char *params); 275 sector_t start, sector_t len, char *params);
270 276
271/* 277/*
278 * Target_ctr should call this if it needs to add any callbacks.
279 */
280void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callbacks *cb);
281
282/*
272 * Finally call this to make the table ready for use. 283 * Finally call this to make the table ready for use.
273 */ 284 */
274int dm_table_complete(struct dm_table *t); 285int dm_table_complete(struct dm_table *t);