diff options
author | Keith Busch | 2022-06-10 12:58:23 -0700 |
---|---|---|
committer | Jens Axboe | 2022-06-27 06:29:11 -0600 |
commit | 4a2dcc35911324d6fcde09b1760cf4f2962699ef (patch) | |
tree | 860be4d6d89079ed8033a4b5448b932624e3d92a /include | |
parent | 3850e13f2853a17c083eb00fad2c6da4fde0b41e (diff) |
block: introduce bdev_dma_alignment helper
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>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220610195830.3574005-5-kbusch@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blkdev.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 2f7b43444c5f..2556fcdb645b 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) { |