Commit 6feef531 authored by Denis ChengRq's avatar Denis ChengRq Committed by Jens Axboe

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: default avatarDenis ChengRq <crquan@gmail.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent ad3316bf
...@@ -2544,7 +2544,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio) ...@@ -2544,7 +2544,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio)
if (last_zone != zone) { if (last_zone != zone) {
BUG_ON(last_zone != zone + pd->settings.size); BUG_ON(last_zone != zone + pd->settings.size);
first_sectors = last_zone - bio->bi_sector; first_sectors = last_zone - bio->bi_sector;
bp = bio_split(bio, bio_split_pool, first_sectors); bp = bio_split(bio, first_sectors);
BUG_ON(!bp); BUG_ON(!bp);
pkt_make_request(q, &bp->bio1); pkt_make_request(q, &bp->bio1);
pkt_make_request(q, &bp->bio2); pkt_make_request(q, &bp->bio2);
......
...@@ -353,7 +353,7 @@ static int linear_make_request (struct request_queue *q, struct bio *bio) ...@@ -353,7 +353,7 @@ static int linear_make_request (struct request_queue *q, struct bio *bio)
* split it. * split it.
*/ */
struct bio_pair *bp; struct bio_pair *bp;
bp = bio_split(bio, bio_split_pool, bp = bio_split(bio,
((tmp_dev->offset + tmp_dev->size)<<1) - bio->bi_sector); ((tmp_dev->offset + tmp_dev->size)<<1) - bio->bi_sector);
if (linear_make_request(q, &bp->bio1)) if (linear_make_request(q, &bp->bio1))
generic_make_request(&bp->bio1); generic_make_request(&bp->bio1);
......
...@@ -427,7 +427,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio) ...@@ -427,7 +427,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
/* This is a one page bio that upper layers /* This is a one page bio that upper layers
* refuse to split for us, so we need to split it. * refuse to split for us, so we need to split it.
*/ */
bp = bio_split(bio, bio_split_pool, chunk_sects - (bio->bi_sector & (chunk_sects - 1)) ); bp = bio_split(bio, chunk_sects - (bio->bi_sector & (chunk_sects - 1)));
if (raid0_make_request(q, &bp->bio1)) if (raid0_make_request(q, &bp->bio1))
generic_make_request(&bp->bio1); generic_make_request(&bp->bio1);
if (raid0_make_request(q, &bp->bio2)) if (raid0_make_request(q, &bp->bio2))
......
...@@ -817,7 +817,7 @@ static int make_request(struct request_queue *q, struct bio * bio) ...@@ -817,7 +817,7 @@ static int make_request(struct request_queue *q, struct bio * bio)
/* This is a one page bio that upper layers /* This is a one page bio that upper layers
* refuse to split for us, so we need to split it. * refuse to split for us, so we need to split it.
*/ */
bp = bio_split(bio, bio_split_pool, bp = bio_split(bio,
chunk_sects - (bio->bi_sector & (chunk_sects - 1)) ); chunk_sects - (bio->bi_sector & (chunk_sects - 1)) );
if (make_request(q, &bp->bio1)) if (make_request(q, &bp->bio1))
generic_make_request(&bp->bio1); generic_make_request(&bp->bio1);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
static struct kmem_cache *bio_slab __read_mostly; static struct kmem_cache *bio_slab __read_mostly;
mempool_t *bio_split_pool __read_mostly; static mempool_t *bio_split_pool __read_mostly;
/* /*
* if you change this list, also change bvec_alloc or things will * if you change this list, also change bvec_alloc or things will
...@@ -1256,9 +1256,9 @@ static void bio_pair_end_2(struct bio *bi, int err) ...@@ -1256,9 +1256,9 @@ static void bio_pair_end_2(struct bio *bi, int err)
* split a bio - only worry about a bio with a single page * split a bio - only worry about a bio with a single page
* in it's iovec * in it's iovec
*/ */
struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) struct bio_pair *bio_split(struct bio *bi, int first_sectors)
{ {
struct bio_pair *bp = mempool_alloc(pool, GFP_NOIO); struct bio_pair *bp = mempool_alloc(bio_split_pool, GFP_NOIO);
if (!bp) if (!bp)
return bp; return bp;
...@@ -1292,7 +1292,7 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) ...@@ -1292,7 +1292,7 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors)
bp->bio2.bi_end_io = bio_pair_end_2; bp->bio2.bi_end_io = bio_pair_end_2;
bp->bio1.bi_private = bi; bp->bio1.bi_private = bi;
bp->bio2.bi_private = pool; bp->bio2.bi_private = bio_split_pool;
if (bio_integrity(bi)) if (bio_integrity(bi))
bio_integrity_split(bi, bp, first_sectors); bio_integrity_split(bi, bp, first_sectors);
...@@ -1455,7 +1455,6 @@ EXPORT_SYMBOL(bio_map_kern); ...@@ -1455,7 +1455,6 @@ EXPORT_SYMBOL(bio_map_kern);
EXPORT_SYMBOL(bio_copy_kern); EXPORT_SYMBOL(bio_copy_kern);
EXPORT_SYMBOL(bio_pair_release); EXPORT_SYMBOL(bio_pair_release);
EXPORT_SYMBOL(bio_split); EXPORT_SYMBOL(bio_split);
EXPORT_SYMBOL(bio_split_pool);
EXPORT_SYMBOL(bio_copy_user); EXPORT_SYMBOL(bio_copy_user);
EXPORT_SYMBOL(bio_uncopy_user); EXPORT_SYMBOL(bio_uncopy_user);
EXPORT_SYMBOL(bioset_create); EXPORT_SYMBOL(bioset_create);
......
...@@ -300,9 +300,7 @@ struct bio_pair { ...@@ -300,9 +300,7 @@ struct bio_pair {
atomic_t cnt; atomic_t cnt;
int error; int error;
}; };
extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, extern struct bio_pair *bio_split(struct bio *bi, int first_sectors);
int first_sectors);
extern mempool_t *bio_split_pool;
extern void bio_pair_release(struct bio_pair *dbio); extern void bio_pair_release(struct bio_pair *dbio);
extern struct bio_set *bioset_create(int, int); extern struct bio_set *bioset_create(int, int);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment