]> www.infradead.org Git - users/hch/block.git/commitdiff
block: move blk_queue_get_max_sectors to blk.h block-blk_max_size_offset
authorChristoph Hellwig <hch@lst.de>
Tue, 14 Jun 2022 08:44:17 +0000 (10:44 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 14 Jun 2022 08:44:17 +0000 (10:44 +0200)
blk_queue_get_max_sectors is private to the block layer, so move it out
of blkdev.h.

Signed-off-by: Christoph Hellwig <hch@lst.de>
block/blk.h
include/linux/blkdev.h

index 434017701403fb699668ec4db2a6a467b2b6ae9f..8e79296ee97a2c37d4a0589e72388d67892e0242 100644 (file)
@@ -159,6 +159,19 @@ static inline bool blk_discard_mergable(struct request *req)
        return false;
 }
 
+static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q,
+                                                    int op)
+{
+       if (unlikely(op == REQ_OP_DISCARD || op == REQ_OP_SECURE_ERASE))
+               return min(q->limits.max_discard_sectors,
+                          UINT_MAX >> SECTOR_SHIFT);
+
+       if (unlikely(op == REQ_OP_WRITE_ZEROES))
+               return q->limits.max_write_zeroes_sectors;
+
+       return q->limits.max_sectors;
+}
+
 #ifdef CONFIG_BLK_DEV_INTEGRITY
 void blk_flush_integrity(void);
 bool __bio_integrity_endio(struct bio *);
index 05e60ee269d91c17ad0210067cc337e04d47f463..5ef2f061feb082eb32bd94f0e212dcb8e05d7321 100644 (file)
@@ -920,19 +920,6 @@ static inline unsigned int bio_zone_is_seq(struct bio *bio)
 }
 #endif /* CONFIG_BLK_DEV_ZONED */
 
-static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q,
-                                                    int op)
-{
-       if (unlikely(op == REQ_OP_DISCARD || op == REQ_OP_SECURE_ERASE))
-               return min(q->limits.max_discard_sectors,
-                          UINT_MAX >> SECTOR_SHIFT);
-
-       if (unlikely(op == REQ_OP_WRITE_ZEROES))
-               return q->limits.max_write_zeroes_sectors;
-
-       return q->limits.max_sectors;
-}
-
 /*
  * Return how much of the chunk is left to be used for I/O at a given offset.
  */