On Sun, 2009-03-08 at 16:24 -0500, James Bottomley wrote: > The problem in the prepare is you need to set up a command with data. > What I'm not quite clear on is why blk_rq_map_kern() on a kmalloc'd > buffer can't be used. You'd end up with a dual bio request (one for the > discard, one for the data), but they should tear down correctly using > the separate bio teardowns and pass correctly into blk_rq_map_sg() which > was the original point. Actually, found the reason, blk_rq_map_kern will blast the original bio from the request. You could fix this by chaining it back again at the beginning. If that works, we could just wrap it into a block API to prevent users from having to muck with bios. James -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html