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>
This commit is contained in:
committed by
Martin K. Petersen
parent
2e27f576ab
commit
547e2f7093
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user