block: don't allocate a payload for discard request
authorChristoph Hellwig <hch@lst.de>
Fri, 18 Jun 2010 14:59:42 +0000 (16:59 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Sat, 7 Aug 2010 16:23:08 +0000 (18:23 +0200)
commit66ac0280197981f88774e74b60c8e5f9f07c1dba
treed093ce493146779926df88b5831805c6f9ee14e1
parent082439004b31adc146e96e5f1c574dd2b57dcd93
block: don't allocate a payload for discard request

Allocating a fixed payload for discard requests always was a horrible hack,
and it's not coming to byte us when adding support for discard in DM/MD.

So change the code to leave the allocation of a payload to the lowlevel
driver.  Unfortunately that means we'll need another hack, which allows
us to update the various block layer length fields indicating that we
have a payload.  Instead of hiding this in sd.c, which we already partially
do for UNMAP support add a documented helper in the core block layer for it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
block/blk-core.c
block/blk-lib.c
drivers/scsi/sd.c
include/linux/blkdev.h