On Fri, Aug 08, 2008 at 11:52:11AM +0100, David Woodhouse wrote: > Secondly, it allows drivers to insert the appropriate command onto their > queue -- I expect that SCSI and ATA drives won't use REQ_TYPE_DISCARD, > just as they don't use REQ_TYPE_FLUSH. They'll use REQ_TYPE_BLOCK_PC > with whatever opcode is allocated for trim/punch. I hadn't realised that was what you'd intended. I was setting REQ_TYPE_DISCARD in the ->prepare and then translating in the prep_fn. If the current T10 and T13 proposals stand unmodified, it'll be a bit of a pain to implement fully. PUNCH currently requires creating a data buffer and attaching it to the command. When we get down into libata, we then want to throw that data buffer away again because TRIM doesn't need a data buffer (indeed to translate PUNCH to TRIM, we need to send a series of commands because PUNCH allows you to specify a set of ranges whereas TRIM only lets you send one range at a time). Let's hope T10 agrees that only one range is necessary at a time. -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- 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