aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis ChengRq <crquan@gmail.com>2008-10-09 02:57:05 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:57:05 -0400
commit6feef531f55cf4a20fd9eb39f5352e5745203603 (patch)
tree2c52b800edcbdf01abefcf27e900985c087f1b36
parentad3316bf4eeb53c89164f759767f911072b56203 (diff)
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>
-rw-r--r--drivers/block/pktcdvd.c2
-rw-r--r--drivers/md/linear.c2
-rw-r--r--drivers/md/raid0.c2
-rw-r--r--drivers/md/raid10.c2
-rw-r--r--fs/bio.c9
-rw-r--r--include/linux/bio.h4
6 files changed, 9 insertions, 12 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index e1a90bbb4747..0e077150568b 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2544,7 +2544,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio)
2544 if (last_zone != zone) { 2544 if (last_zone != zone) {
2545 BUG_ON(last_zone != zone + pd->settings.size); 2545 BUG_ON(last_zone != zone + pd->settings.size);
2546 first_sectors = last_zone - bio->bi_sector; 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 BUG_ON(!bp); 2548 BUG_ON(!bp);
2549 pkt_make_request(q, &bp->bio1); 2549 pkt_make_request(q, &bp->bio1);
2550 pkt_make_request(q, &bp->bio2); 2550 pkt_make_request(q, &bp->bio2);
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index c80ea90593d3..b9cbee688fae 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -353,7 +353,7 @@ static int linear_make_request (struct request_queue *q, struct bio *bio)
353 * split it. 353 * split it.
354 */ 354 */
355 struct bio_pair *bp; 355 struct bio_pair *bp;
356 bp = bio_split(bio, bio_split_pool, 356 bp = bio_split(bio,
357 ((tmp_dev->offset + tmp_dev->size)<<1) - bio->bi_sector); 357 ((tmp_dev->offset + tmp_dev->size)<<1) - bio->bi_sector);
358 if (linear_make_request(q, &bp->bio1)) 358 if (linear_make_request(q, &bp->bio1))
359 generic_make_request(&bp->bio1); 359 generic_make_request(&bp->bio1);
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index f52f442a735f..53508a8a981d 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -427,7 +427,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
427 /* This is a one page bio that upper layers 427 /* This is a one page bio that upper layers
428 * refuse to split for us, so we need to split it. 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 if (raid0_make_request(q, &bp->bio1)) 431 if (raid0_make_request(q, &bp->bio1))
432 generic_make_request(&bp->bio1); 432 generic_make_request(&bp->bio1);
433 if (raid0_make_request(q, &bp->bio2)) 433 if (raid0_make_request(q, &bp->bio2))
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 5f990133f5ef..8bdc9bfc2887 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -817,7 +817,7 @@ static int make_request(struct request_queue *q, struct bio * bio)
817 /* This is a one page bio that upper layers 817 /* This is a one page bio that upper layers
818 * refuse to split for us, so we need to split it. 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 chunk_sects - (bio->bi_sector & (chunk_sects - 1)) ); 821 chunk_sects - (bio->bi_sector & (chunk_sects - 1)) );
822 if (make_request(q, &bp->bio1)) 822 if (make_request(q, &bp->bio1))
823 generic_make_request(&bp->bio1); 823 generic_make_request(&bp->bio1);
diff --git a/fs/bio.c b/fs/bio.c
index a5af5809f566..77a55bcceedb 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -30,7 +30,7 @@
30 30
31static struct kmem_cache *bio_slab __read_mostly; 31static struct kmem_cache *bio_slab __read_mostly;
32 32
33mempool_t *bio_split_pool __read_mostly; 33static mempool_t *bio_split_pool __read_mostly;
34 34
35/* 35/*
36 * if you change this list, also change bvec_alloc or things will 36 * 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 * split a bio - only worry about a bio with a single page 1256 * split a bio - only worry about a bio with a single page
1257 * in it's iovec 1257 * in it's iovec
1258 */ 1258 */
1259struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) 1259struct 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 if (!bp) 1263 if (!bp)
1264 return bp; 1264 return bp;
@@ -1292,7 +1292,7 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors)
1292 bp->bio2.bi_end_io = bio_pair_end_2; 1292 bp->bio2.bi_end_io = bio_pair_end_2;
1293 1293
1294 bp->bio1.bi_private = bi; 1294 bp->bio1.bi_private = bi;
1295 bp->bio2.bi_private = pool; 1295 bp->bio2.bi_private = bio_split_pool;
1296 1296
1297 if (bio_integrity(bi)) 1297 if (bio_integrity(bi))
1298 bio_integrity_split(bi, bp, first_sectors); 1298 bio_integrity_split(bi, bp, first_sectors);
@@ -1455,7 +1455,6 @@ EXPORT_SYMBOL(bio_map_kern);
1455EXPORT_SYMBOL(bio_copy_kern); 1455EXPORT_SYMBOL(bio_copy_kern);
1456EXPORT_SYMBOL(bio_pair_release); 1456EXPORT_SYMBOL(bio_pair_release);
1457EXPORT_SYMBOL(bio_split); 1457EXPORT_SYMBOL(bio_split);
1458EXPORT_SYMBOL(bio_split_pool);
1459EXPORT_SYMBOL(bio_copy_user); 1458EXPORT_SYMBOL(bio_copy_user);
1460EXPORT_SYMBOL(bio_uncopy_user); 1459EXPORT_SYMBOL(bio_uncopy_user);
1461EXPORT_SYMBOL(bioset_create); 1460EXPORT_SYMBOL(bioset_create);
diff --git a/include/linux/bio.h b/include/linux/bio.h
index fe12d0f9ebaa..fb97221d7c30 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -300,9 +300,7 @@ struct bio_pair {
300 atomic_t cnt; 300 atomic_t cnt;
301 int error; 301 int error;
302}; 302};
303extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, 303extern struct bio_pair *bio_split(struct bio *bi, int first_sectors);
304 int first_sectors);
305extern mempool_t *bio_split_pool;
306extern void bio_pair_release(struct bio_pair *dbio); 304extern void bio_pair_release(struct bio_pair *dbio);
307 305
308extern struct bio_set *bioset_create(int, int); 306extern struct bio_set *bioset_create(int, int);