[dm-devel] REQ_OP for zeroing, was Re: [PATCH 1/4] brd: handle misaligned discard
Christoph Hellwig
hch at infradead.org
Fri Oct 28 13:14:57 UTC 2016
[adding Chaitanya to Cc]
On Fri, Oct 28, 2016 at 07:43:41AM -0400, Mikulas Patocka wrote:
> We could detect if the REQ_OP_WRITE_SAME command contains all zeroes and
> if it does, turn it into "Write Zeroes" or TRIM command (if the device
> guarantees zeroing on trim). If it doesn't contain all zeroes and the
> device doesn't support non-zero WRITE SAME, then reject it.
I don't like this because it's very inefficient - we have to allocate
a payload first and then compare the whole payload for very operation.
> Or maybe we could add a new command REQ_OP_WRITE_ZEROES - I'm not sure
> which of these two possibilities is better.
Chaitanya actually did an initial prototype implementation of this for
NVMe that he shared with me. I liked it a lot and I think he'll be
ready to post it in a few days. Now that we have the REQ_OP* values
instead of mapping different command types to flags it's actually
surprisingly easy to add new block layer operations.
More information about the dm-devel
mailing list