The question about blkdev_issue_discard and discard_granularity

From: Andrew Wagin
Date: Thu Mar 22 2012 - 09:04:21 EST


Hello Jens,

I'm developing a virtual disk (aka ploop). Now I'm adding support of
discard requests. A block size of ploop may be customized, so I want
that a discard request contains only whole blocks. I found a queue's
parameter discard_granularity and set it correctly, but nothing's
changed. A kernel continues sending bio with size smaller than
discard_granularity and with unaligned borders.

I found that max_discard_sectors is aligned according with discard_granularity.

Why are bi->bi_size and bi->bi_sector not aligned according with
discard_granularity?

If it's just because nobody did this, I can do.

Thanks,
Andrey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/