diff options
author | Christoph Hellwig <hch@lst.de> | 2021-07-24 10:20:21 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-07-29 05:24:25 +0300 |
commit | 547e2f7093b19a993d76c249b4c3ec8af8127d09 (patch) | |
tree | ea1d8388ce3da300fba114a07763d2c8779cb87b /include/linux/blkdev.h | |
parent | 2e27f576abc6f056e63ef207b9911b1a04d07020 (diff) | |
download | linux-547e2f7093b19a993d76c249b4c3ec8af8127d09.tar.xz |
scsi: block: Add a queue_max_bytes() helper
Return the max_sectors value in bytes. Lifted from scsi_ioctl.c.
Link: https://lore.kernel.org/r/20210724072033.1284840-13-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/linux/blkdev.h')
-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 e2b972a85012..9971796819ef 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1373,6 +1373,11 @@ static inline unsigned int queue_max_sectors(const struct request_queue *q) return q->limits.max_sectors; } +static inline unsigned int queue_max_bytes(struct request_queue *q) +{ + return min_t(unsigned int, queue_max_sectors(q), INT_MAX >> 9) << 9; +} + static inline unsigned int queue_max_hw_sectors(const struct request_queue *q) { return q->limits.max_hw_sectors; |