diff options
author | Ming Lei <ming.lei@redhat.com> | 2017-12-18 20:22:10 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-01-06 09:18:00 -0700 |
commit | 25d8be77e19224d8f21b363d77b5283c5dc21a57 (patch) | |
tree | 4a07629635d9e2109caca1c0418208fc167f8082 /block/bio.c | |
parent | c2421edf5f9151d0eb28affbf76e9e4f8ddd03c6 (diff) | |
download | linux-stable-25d8be77e19224d8f21b363d77b5283c5dc21a57.tar.gz linux-stable-25d8be77e19224d8f21b363d77b5283c5dc21a57.tar.bz2 linux-stable-25d8be77e19224d8f21b363d77b5283c5dc21a57.zip |
block: move bio_alloc_pages() to bcache
bcache is the only user of bio_alloc_pages(), so move this function into
bcache, and avoid it being misused in the future.
Also rename it to bch_bio_allo_pages() since it is bcache only.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio.c')
-rw-r--r-- | block/bio.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/block/bio.c b/block/bio.c index 8bfdea58159b..fe1efbeaf4aa 100644 --- a/block/bio.c +++ b/block/bio.c @@ -969,34 +969,6 @@ void bio_advance(struct bio *bio, unsigned bytes) EXPORT_SYMBOL(bio_advance); /** - * bio_alloc_pages - allocates a single page for each bvec in a bio - * @bio: bio to allocate pages for - * @gfp_mask: flags for allocation - * - * Allocates pages up to @bio->bi_vcnt. - * - * Returns 0 on success, -ENOMEM on failure. On failure, any allocated pages are - * freed. - */ -int bio_alloc_pages(struct bio *bio, gfp_t gfp_mask) -{ - int i; - struct bio_vec *bv; - - bio_for_each_segment_all(bv, bio, i) { - bv->bv_page = alloc_page(gfp_mask); - if (!bv->bv_page) { - while (--bv >= bio->bi_io_vec) - __free_page(bv->bv_page); - return -ENOMEM; - } - } - - return 0; -} -EXPORT_SYMBOL(bio_alloc_pages); - -/** * bio_copy_data - copy contents of data buffers from one chain of bios to * another * @src: source bio list |