]> err.no Git - linux-2.6/commitdiff
block: allow queue dma_alignment of zero
authorPete Wyckoff <pw@osc.edu>
Tue, 1 Jan 2008 15:23:02 +0000 (10:23 -0500)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 28 Jan 2008 09:04:46 +0000 (10:04 +0100)
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: Pete Wyckoff <pw@osc.edu>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
include/linux/blkdev.h

index 49b7a4c31a6d5d35af9c3e11e24791afe86faaf4..c7a3ab575c24ec20ca50d32f9a9cab799ee0a9aa 100644 (file)
@@ -836,12 +836,7 @@ static inline int bdev_hardsect_size(struct block_device *bdev)
 
 static inline int queue_dma_alignment(struct request_queue *q)
 {
-       int retval = 511;
-
-       if (q && q->dma_alignment)
-               retval = q->dma_alignment;
-
-       return retval;
+       return q ? q->dma_alignment : 511;
 }
 
 /* assumes size > 256 */