Support discard for multiple devices The previous code supported discards only if there was one underlying device. (i.e. multiple linear targets pointing to the same device would support discards, multiple linear targets pointing to different devices wouldn't). This restriction is not necessary, so this patch removes it. As we checked, barrier+discard requests are handled by the barrier thread, so it's safe to use these requests on devices with multiple underlying devices. Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx> --- drivers/md/dm-table.c | 6 ------ 1 file changed, 6 deletions(-) Index: linux-2.6.35-rc3-fast/drivers/md/dm-table.c =================================================================== --- linux-2.6.35-rc3-fast.orig/drivers/md/dm-table.c 2010-07-02 16:05:22.000000000 +0200 +++ linux-2.6.35-rc3-fast/drivers/md/dm-table.c 2010-07-02 16:07:45.000000000 +0200 @@ -911,12 +911,6 @@ int dm_table_complete(struct dm_table *t int r = 0; unsigned int leaf_nodes; - /* - * We only support discards if there is exactly one underlying device. - */ - if (!list_is_singular(&t->devices)) - t->discards_supported = 0; - /* how many indexes will the btree have ? */ leaf_nodes = dm_div_up(t->num_targets, KEYS_PER_NODE); t->depth = 1 + int_log(leaf_nodes, CHILDREN_PER_NODE); -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel