block: introduce bio_copy_data_partial

Turns out we can use bio_copy_data in raid1's write behind,
and we can make alloc_behind_pages() more clean/efficient,
but we need to partial version of bio_copy_data().

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Reviewed-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
This commit is contained in:
Ming Lei
2017-03-17 00:12:29 +08:00
committed by Shaohua Li
parent 60928a91b0
commit 6f8802852f
2 changed files with 49 additions and 13 deletions

View File

@@ -468,6 +468,8 @@ static inline void bio_flush_dcache_pages(struct bio *bi)
#endif
extern void bio_copy_data(struct bio *dst, struct bio *src);
extern void bio_copy_data_partial(struct bio *dst, struct bio *src,
int offset, int size);
extern int bio_alloc_pages(struct bio *bio, gfp_t gfp);
extern void bio_free_pages(struct bio *bio);