On Fri, Jul 02 2010 at 11:19am -0400, Mikulas Patocka <mpatocka@xxxxxxxxxx> wrote: > 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); > Removing this constraint means that a discard request that spans targets will return -EOPNOTSUPP. I'd prefer that we first make basic discard splitting work (like I already have a DM patch to do that I'll rebase shortly). But given the new-found desire for DM to return -EOPNOTSUPP as a means to convey that a subset of the device does not support discards: This change will start to force this issue with DM consumers higher up the IO stack (e.g. ext4 and other filesystems). So I'm cc'ing FS development lists, if they don't care now they will at some point. Acked-by: Mike Snitzer <snitzer@xxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html