diff options
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 38e4eb1bb965..416d4e258df6 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -55,6 +55,7 @@ struct dm_table { | |||
55 | struct dm_target *targets; | 55 | struct dm_target *targets; |
56 | 56 | ||
57 | unsigned discards_supported:1; | 57 | unsigned discards_supported:1; |
58 | unsigned integrity_supported:1; | ||
58 | 59 | ||
59 | /* | 60 | /* |
60 | * Indicates the rw permissions for the new logical | 61 | * Indicates the rw permissions for the new logical |
@@ -859,7 +860,7 @@ int dm_table_alloc_md_mempools(struct dm_table *t) | |||
859 | return -EINVAL; | 860 | return -EINVAL; |
860 | } | 861 | } |
861 | 862 | ||
862 | t->mempools = dm_alloc_md_mempools(type); | 863 | t->mempools = dm_alloc_md_mempools(type, t->integrity_supported); |
863 | if (!t->mempools) | 864 | if (!t->mempools) |
864 | return -ENOMEM; | 865 | return -ENOMEM; |
865 | 866 | ||
@@ -935,8 +936,10 @@ static int dm_table_prealloc_integrity(struct dm_table *t, struct mapped_device | |||
935 | struct dm_dev_internal *dd; | 936 | struct dm_dev_internal *dd; |
936 | 937 | ||
937 | list_for_each_entry(dd, devices, list) | 938 | list_for_each_entry(dd, devices, list) |
938 | if (bdev_get_integrity(dd->dm_dev.bdev)) | 939 | if (bdev_get_integrity(dd->dm_dev.bdev)) { |
940 | t->integrity_supported = 1; | ||
939 | return blk_integrity_register(dm_disk(md), NULL); | 941 | return blk_integrity_register(dm_disk(md), NULL); |
942 | } | ||
940 | 943 | ||
941 | return 0; | 944 | return 0; |
942 | } | 945 | } |
@@ -1275,29 +1278,6 @@ int dm_table_any_busy_target(struct dm_table *t) | |||
1275 | return 0; | 1278 | return 0; |
1276 | } | 1279 | } |
1277 | 1280 | ||
1278 | void dm_table_unplug_all(struct dm_table *t) | ||
1279 | { | ||
1280 | struct dm_dev_internal *dd; | ||
1281 | struct list_head *devices = dm_table_get_devices(t); | ||
1282 | struct dm_target_callbacks *cb; | ||
1283 | |||
1284 | list_for_each_entry(dd, devices, list) { | ||
1285 | struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev); | ||
1286 | char b[BDEVNAME_SIZE]; | ||
1287 | |||
1288 | if (likely(q)) | ||
1289 | blk_unplug(q); | ||
1290 | else | ||
1291 | DMWARN_LIMIT("%s: Cannot unplug nonexistent device %s", | ||
1292 | dm_device_name(t->md), | ||
1293 | bdevname(dd->dm_dev.bdev, b)); | ||
1294 | } | ||
1295 | |||
1296 | list_for_each_entry(cb, &t->target_callbacks, list) | ||
1297 | if (cb->unplug_fn) | ||
1298 | cb->unplug_fn(cb); | ||
1299 | } | ||
1300 | |||
1301 | struct mapped_device *dm_table_get_md(struct dm_table *t) | 1281 | struct mapped_device *dm_table_get_md(struct dm_table *t) |
1302 | { | 1282 | { |
1303 | return t->md; | 1283 | return t->md; |
@@ -1345,4 +1325,3 @@ EXPORT_SYMBOL(dm_table_get_mode); | |||
1345 | EXPORT_SYMBOL(dm_table_get_md); | 1325 | EXPORT_SYMBOL(dm_table_get_md); |
1346 | EXPORT_SYMBOL(dm_table_put); | 1326 | EXPORT_SYMBOL(dm_table_put); |
1347 | EXPORT_SYMBOL(dm_table_get); | 1327 | EXPORT_SYMBOL(dm_table_get); |
1348 | EXPORT_SYMBOL(dm_table_unplug_all); | ||