[PATCH] block queue dma alignment zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make queue_dma_alignment return 0 if it was specifically set to
0.  Set it to the default 511 to keep the old behavior when it
was not explicitly set.  This permits devices with no particular
alignment restrictions to use direct IO from arbitrary addresses.

Signed-off-by: Pete Wyckoff <pw@xxxxxxx>
---
 block/ll_rw_blk.c      |    2 ++
 include/linux/blkdev.h |    7 +------
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index fb67897..ef1d1a8 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1925,6 +1925,8 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
 	blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS);
 	blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
 
+	blk_queue_dma_alignment(q, 511);
+
 	/*
 	 * all done
 	 */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 36a6eac..f416c2a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -819,12 +819,7 @@ static inline int bdev_hardsect_size(struct block_device *bdev)
 
 static inline int queue_dma_alignment(request_queue_t *q)
 {
-	int retval = 511;
-
-	if (q && q->dma_alignment)
-		retval = q->dma_alignment;
-
-	return retval;
+	return q ? q->dma_alignment : 511;
 }
 
 /* assumes size > 256 */
-- 
1.5.0.2

-
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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux