Commit 482eb689 authored by Pete Wyckoff's avatar Pete Wyckoff Committed by Jens Axboe

block: allow queue dma_alignment of zero

Let queue_dma_alignment return 0 if it was specifically set to 0.
This permits devices with no particular alignment restrictions to
use arbitrary user space buffers without copying.
Signed-off-by: default avatarPete Wyckoff <pw@osc.edu>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 6da127ad
...@@ -836,12 +836,7 @@ static inline int bdev_hardsect_size(struct block_device *bdev) ...@@ -836,12 +836,7 @@ static inline int bdev_hardsect_size(struct block_device *bdev)
static inline int queue_dma_alignment(struct request_queue *q) static inline int queue_dma_alignment(struct request_queue *q)
{ {
int retval = 511; return q ? q->dma_alignment : 511;
if (q && q->dma_alignment)
retval = q->dma_alignment;
return retval;
} }
/* assumes size > 256 */ /* assumes size > 256 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment