Skip to content

Commit

Permalink
block: allow queue dma_alignment of zero
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pete Wyckoff authored and Jens Axboe committed Jan 28, 2008
1 parent 6da127a commit 482eb68
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 482eb68

Please sign in to comment.