diff mbox series

[PATCHv3,3/6] block: introduce bdev_dma_alignment helper

Message ID 20220523210119.2500150-4-kbusch@fb.com (mailing list archive)
State New, archived
Headers show
Series direct io dma alignment | expand

Commit Message

Keith Busch May 23, 2022, 9:01 p.m. UTC
From: Keith Busch <kbusch@kernel.org>

Preparing for upcoming dma_alignment users that have a block_device, but
don't need the request_queue.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 include/linux/blkdev.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Christoph Hellwig May 24, 2022, 6:02 a.m. UTC | #1
On Mon, May 23, 2022 at 02:01:16PM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
> 
> Preparing for upcoming dma_alignment users that have a block_device, but
> don't need the request_queue.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Johannes Thumshirn May 24, 2022, 6:25 a.m. UTC | #2
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5bdf2ac9142c..834b981ef01b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1365,6 +1365,11 @@  static inline int queue_dma_alignment(const struct request_queue *q)
 	return q ? q->dma_alignment : 511;
 }
 
+static inline unsigned int bdev_dma_alignment(struct block_device *bdev)
+{
+	return queue_dma_alignment(bdev_get_queue(bdev));
+}
+
 static inline int blk_rq_aligned(struct request_queue *q, unsigned long addr,
 				 unsigned int len)
 {