On Fri, Nov 19, 2010 at 10:24:52AM -0500, Mark Lord wrote:
We actually sent discards down as BLOCK_PC commands, which basically
is SG_IO style I/O from kernelspace. But that caused a lot of problems
with scsi error handling so we moved away from it. But even when
you do a BLOCK_PC UNMAP command that later gets translated to a TRIM
by libata you have a few issues:
- you need to get partion offsets in the I/O sumitter to include them
in every range. That's doable but a quite nasty layering violation,
and it also prevents us from ever adding DM/MD support to that
scheme.
- you'll have to allocate new memory for the TRIM payload in libata,
and switch the libata command to use it, instead of the current
hack to reuse the zeroed page sent down with the WRITE SAME command.
I tried to get the payload switching in libata to work a few times,
but never managed to get it right.
--