Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: mark bio_split_pool static

Since all bio_split calls refer the same single bio_split_pool, the bio_split
function can use bio_split_pool directly instead of the mempool_t parameter;

then the mempool_t parameter can be removed from bio_split param list, and
bio_split_pool is only referred in fs/bio.c file, can be marked static.

Signed-off-by: Denis ChengRq <crquan@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by

Denis ChengRq and committed by
Jens Axboe
6feef531 ad3316bf

+9 -12
+1 -1
drivers/block/pktcdvd.c
··· 2544 2544 if (last_zone != zone) { 2545 2545 BUG_ON(last_zone != zone + pd->settings.size); 2546 2546 first_sectors = last_zone - bio->bi_sector; 2547 - bp = bio_split(bio, bio_split_pool, first_sectors); 2547 + bp = bio_split(bio, first_sectors); 2548 2548 BUG_ON(!bp); 2549 2549 pkt_make_request(q, &bp->bio1); 2550 2550 pkt_make_request(q, &bp->bio2);
+1 -1
drivers/md/linear.c
··· 353 353 * split it. 354 354 */ 355 355 struct bio_pair *bp; 356 - bp = bio_split(bio, bio_split_pool, 356 + bp = bio_split(bio, 357 357 ((tmp_dev->offset + tmp_dev->size)<<1) - bio->bi_sector); 358 358 if (linear_make_request(q, &bp->bio1)) 359 359 generic_make_request(&bp->bio1);
+1 -1
drivers/md/raid0.c
··· 427 427 /* This is a one page bio that upper layers 428 428 * refuse to split for us, so we need to split it. 429 429 */ 430 - bp = bio_split(bio, bio_split_pool, chunk_sects - (bio->bi_sector & (chunk_sects - 1)) ); 430 + bp = bio_split(bio, chunk_sects - (bio->bi_sector & (chunk_sects - 1))); 431 431 if (raid0_make_request(q, &bp->bio1)) 432 432 generic_make_request(&bp->bio1); 433 433 if (raid0_make_request(q, &bp->bio2))
+1 -1
drivers/md/raid10.c
··· 817 817 /* This is a one page bio that upper layers 818 818 * refuse to split for us, so we need to split it. 819 819 */ 820 - bp = bio_split(bio, bio_split_pool, 820 + bp = bio_split(bio, 821 821 chunk_sects - (bio->bi_sector & (chunk_sects - 1)) ); 822 822 if (make_request(q, &bp->bio1)) 823 823 generic_make_request(&bp->bio1);
+4 -5
fs/bio.c
··· 30 30 31 31 static struct kmem_cache *bio_slab __read_mostly; 32 32 33 - mempool_t *bio_split_pool __read_mostly; 33 + static mempool_t *bio_split_pool __read_mostly; 34 34 35 35 /* 36 36 * if you change this list, also change bvec_alloc or things will ··· 1256 1256 * split a bio - only worry about a bio with a single page 1257 1257 * in it's iovec 1258 1258 */ 1259 - struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) 1259 + struct bio_pair *bio_split(struct bio *bi, int first_sectors) 1260 1260 { 1261 - struct bio_pair *bp = mempool_alloc(pool, GFP_NOIO); 1261 + struct bio_pair *bp = mempool_alloc(bio_split_pool, GFP_NOIO); 1262 1262 1263 1263 if (!bp) 1264 1264 return bp; ··· 1292 1292 bp->bio2.bi_end_io = bio_pair_end_2; 1293 1293 1294 1294 bp->bio1.bi_private = bi; 1295 - bp->bio2.bi_private = pool; 1295 + bp->bio2.bi_private = bio_split_pool; 1296 1296 1297 1297 if (bio_integrity(bi)) 1298 1298 bio_integrity_split(bi, bp, first_sectors); ··· 1455 1455 EXPORT_SYMBOL(bio_copy_kern); 1456 1456 EXPORT_SYMBOL(bio_pair_release); 1457 1457 EXPORT_SYMBOL(bio_split); 1458 - EXPORT_SYMBOL(bio_split_pool); 1459 1458 EXPORT_SYMBOL(bio_copy_user); 1460 1459 EXPORT_SYMBOL(bio_uncopy_user); 1461 1460 EXPORT_SYMBOL(bioset_create);
+1 -3
include/linux/bio.h
··· 300 300 atomic_t cnt; 301 301 int error; 302 302 }; 303 - extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, 304 - int first_sectors); 305 - extern mempool_t *bio_split_pool; 303 + extern struct bio_pair *bio_split(struct bio *bi, int first_sectors); 306 304 extern void bio_pair_release(struct bio_pair *dbio); 307 305 308 306 extern struct bio_set *bioset_create(int, int);