Re: Query about dm device max_discard_sectors
|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
On Sun, Mar 25 2012 at 7:54pm -0400,
Mike Snitzer <snitzer@xxxxxxxxxx> wrote:
> On Sun, Mar 25 2012 at 6:46pm -0400,
> Amar Mudrankit <amar.mudrankit@xxxxxxxxx> wrote:
> > Hi all,
> > I am building an experimental device mapper target which is supposed to
> > receive
> > all TRIM requests (REQ_DISCARD). Irrespective of whether underlying actual
> > physical block device supports discards or not, my device mapper target
> > should
> > receive REQ_DISCARD bios.
> I'm just curious but: what will your target do in general?
>ah, I now see you already did set discards_supported.
> > In my target, I set:
> > ti->num_discard_requests = 1;
> > ti->discards_supported = 1;
> You'll also want to set ti->discards_supported
> see: http://git.kernel.org/linus/4c259327
BTW, the dm-thin.c discard changes will be merged in 3.4, you can see
> > So, if my device mapper target does not implement iterate_devices function
> > (used to set max_discard_sectors based on underlying physical device's
> > discard
> > support) or underlying physical device does not support discards, then there
> > is no way for device mapper target to set max_discard_sectors more than 0
> > to receive REQ_DISCARD commands.
> > Is this analysis correct? Or I am missing something?
> All DM targets should implement .iterate_devices -- intent is to iterate
> over all data devices.
> You'll also want to implement .io_hints to set limits->max_discard_sectors
> (like drivers/md/dm-thin.c does).
the relevant patches here:
-- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel