Skip to content

Commit 8c56ef1

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: make max_integrity_io_size public
File systems that generate integrity will need this, so move it out of the block private or blk-mq specific headers. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Anuj Gupta <[email protected]> Reviewed-by: Kanchan Joshi <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Tested-by: Anuj Gupta <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 3f00626 commit 8c56ef1

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

block/blk-settings.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,6 @@ static int blk_validate_zoned_limits(struct queue_limits *lim)
123123
return 0;
124124
}
125125

126-
/*
127-
* Maximum size of I/O that needs a block layer integrity buffer. Limited
128-
* by the number of intervals for which we can fit the integrity buffer into
129-
* the buffer size. Because the buffer is a single segment it is also limited
130-
* by the maximum segment size.
131-
*/
132-
static inline unsigned int max_integrity_io_size(struct queue_limits *lim)
133-
{
134-
return min_t(unsigned int, lim->max_segment_size,
135-
(BLK_INTEGRITY_MAX_SIZE / lim->integrity.metadata_size) <<
136-
lim->integrity.interval_exp);
137-
}
138-
139126
static int blk_validate_integrity_limits(struct queue_limits *lim)
140127
{
141128
struct blk_integrity *bi = &lim->integrity;

include/linux/blk-integrity.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88

99
struct request;
1010

11-
/*
12-
* Maximum contiguous integrity buffer allocation.
13-
*/
14-
#define BLK_INTEGRITY_MAX_SIZE SZ_2M
15-
1611
enum blk_integrity_flags {
1712
BLK_INTEGRITY_NOVERIFY = 1 << 0,
1813
BLK_INTEGRITY_NOGENERATE = 1 << 1,

include/linux/blkdev.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,24 @@ static inline int bio_split_rw_at(struct bio *bio,
18811881
return bio_split_io_at(bio, lim, segs, max_bytes, lim->dma_alignment);
18821882
}
18831883

1884+
/*
1885+
* Maximum contiguous integrity buffer allocation.
1886+
*/
1887+
#define BLK_INTEGRITY_MAX_SIZE SZ_2M
1888+
1889+
/*
1890+
* Maximum size of I/O that needs a block layer integrity buffer. Limited
1891+
* by the number of intervals for which we can fit the integrity buffer into
1892+
* the buffer size. Because the buffer is a single segment it is also limited
1893+
* by the maximum segment size.
1894+
*/
1895+
static inline unsigned int max_integrity_io_size(struct queue_limits *lim)
1896+
{
1897+
return min_t(unsigned int, lim->max_segment_size,
1898+
(BLK_INTEGRITY_MAX_SIZE / lim->integrity.metadata_size) <<
1899+
lim->integrity.interval_exp);
1900+
}
1901+
18841902
#define DEFINE_IO_COMP_BATCH(name) struct io_comp_batch name = { }
18851903

18861904
#endif /* _LINUX_BLKDEV_H */

0 commit comments

Comments
 (0)