Skip to content

Commit fed406f

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: mark bvec_{alloc,free} static
Only used in bio.c these days. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> -ck Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://patch.msgid.link/20260316161144.1607877-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 5d54016 commit fed406f

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

block/bio.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ struct bio_alloc_cache {
3434
unsigned int nr_irq;
3535
};
3636

37+
#define BIO_INLINE_VECS 4
38+
3739
static struct biovec_slab {
3840
int nr_vecs;
3941
char *name;
@@ -159,7 +161,8 @@ static void bio_put_slab(struct bio_set *bs)
159161
mutex_unlock(&bio_slab_lock);
160162
}
161163

162-
void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned short nr_vecs)
164+
static void bvec_free(struct mempool *pool, struct bio_vec *bv,
165+
unsigned short nr_vecs)
163166
{
164167
BUG_ON(nr_vecs > BIO_MAX_VECS);
165168

@@ -179,7 +182,7 @@ static inline gfp_t bvec_alloc_gfp(gfp_t gfp)
179182
__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN;
180183
}
181184

182-
struct bio_vec *bvec_alloc(mempool_t *pool, unsigned short *nr_vecs,
185+
static struct bio_vec *bvec_alloc(struct mempool *pool, unsigned short *nr_vecs,
183186
gfp_t gfp_mask)
184187
{
185188
struct biovec_slab *bvs = biovec_slab(*nr_vecs);

block/blk.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@ static inline void blk_wait_io(struct completion *done)
108108
struct block_device *blkdev_get_no_open(dev_t dev, bool autoload);
109109
void blkdev_put_no_open(struct block_device *bdev);
110110

111-
#define BIO_INLINE_VECS 4
112-
struct bio_vec *bvec_alloc(mempool_t *pool, unsigned short *nr_vecs,
113-
gfp_t gfp_mask);
114-
void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned short nr_vecs);
115-
116111
bool bvec_try_merge_hw_page(struct request_queue *q, struct bio_vec *bv,
117112
struct page *page, unsigned len, unsigned offset);
118113

0 commit comments

Comments
 (0)