aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-01-13 15:00:02 -0500
committerAlasdair G Kergon <agk@redhat.com>2011-01-13 15:00:02 -0500
commit99d03c141b40914b67d63c9d23b8da4386422ed7 (patch)
treed9c2d4da01f749325fac949d96e35aedea05cfc4
parent9d357b0787bb3c91835d5e658c3bda178f9ca419 (diff)
dm: per target unplug callback support
Add per-target unplug callback support. 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>
-rw-r--r--drivers/md/dm-table.c5
-rw-r--r--include/linux/device-mapper.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 7e2ec3c05550..dffa0ac7c4f0 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1278,6 +1278,7 @@ void dm_table_unplug_all(struct dm_table *t)
1278{ 1278{
1279 struct dm_dev_internal *dd; 1279 struct dm_dev_internal *dd;
1280 struct list_head *devices = dm_table_get_devices(t); 1280 struct list_head *devices = dm_table_get_devices(t);
1281 struct dm_target_callbacks *cb;
1281 1282
1282 list_for_each_entry(dd, devices, list) { 1283 list_for_each_entry(dd, devices, list) {
1283 struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev); 1284 struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev);
@@ -1290,6 +1291,10 @@ void dm_table_unplug_all(struct dm_table *t)
1290 dm_device_name(t->md), 1291 dm_device_name(t->md),
1291 bdevname(dd->dm_dev.bdev, b)); 1292 bdevname(dd->dm_dev.bdev, b));
1292 } 1293 }
1294
1295 list_for_each_entry(cb, &t->target_callbacks, list)
1296 if (cb->unplug_fn)
1297 cb->unplug_fn(cb);
1293} 1298}
1294 1299
1295struct mapped_device *dm_table_get_md(struct dm_table *t) 1300struct mapped_device *dm_table_get_md(struct dm_table *t)
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 4b1c63d478ab..272496d1fae4 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -197,6 +197,7 @@ struct dm_target {
197struct dm_target_callbacks { 197struct dm_target_callbacks {
198 struct list_head list; 198 struct list_head list;
199 int (*congested_fn) (struct dm_target_callbacks *, int); 199 int (*congested_fn) (struct dm_target_callbacks *, int);
200 void (*unplug_fn)(struct dm_target_callbacks *);
200}; 201};
201 202
202int dm_register_target(struct target_type *t); 203int dm_register_target(struct target_type *t);