[01/15] block: bio: rename page_is_mergeable to bio_page_is_mergeable and make non-static
Commit Message
page_is_meargeable() can be used to merge the page to the bio_vec of
bio's integrity payload. For this, the static was removed.
There is a page_is_mergeable() in F2FS filesystem, so the name was changed
to bio_page_is_mergeable.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jinyoung Choi <j-young.choi@samsung.com>
---
block/bio.c | 8 ++++----
include/linux/bio.h | 3 +++
2 files changed, 7 insertions(+), 4 deletions(-)
Comments
> +bool bio_page_is_mergeable(const struct bio_vec *bv, struct page *page,
> + unsigned int len, unsigned int off,
> + bool *same_page)
No bio involved here, just a bvec. But I don't really see the need
to rename it, just declare it in block/blk.h where f2fs has no chance
of ever seeing it.
>> +bool bio_page_is_mergeable(const struct bio_vec *bv, struct page *page,
>> + unsigned int len, unsigned int off,
>> + bool *same_page)
>
>No bio involved here, just a bvec. But I don't really see the need
>to rename it, just declare it in block/blk.h where f2fs has no chance
>of ever seeing it.
Oh. You are right.
I will declare where you mentioned without changing the name.
It's better.
Best Regards,
Jinyoung
@@ -903,9 +903,9 @@ static inline bool bio_full(struct bio *bio, unsigned len)
return false;
}
-static inline bool page_is_mergeable(const struct bio_vec *bv,
- struct page *page, unsigned int len, unsigned int off,
- bool *same_page)
+bool bio_page_is_mergeable(const struct bio_vec *bv, struct page *page,
+ unsigned int len, unsigned int off,
+ bool *same_page)
{
size_t bv_end = bv->bv_offset + bv->bv_len;
phys_addr_t vec_end_addr = page_to_phys(bv->bv_page) + bv_end - 1;
@@ -951,7 +951,7 @@ static bool __bio_try_merge_page(struct bio *bio, struct page *page,
if (bio->bi_vcnt > 0) {
struct bio_vec *bv = &bio->bi_io_vec[bio->bi_vcnt - 1];
- if (page_is_mergeable(bv, page, len, off, same_page)) {
+ if (bio_page_is_mergeable(bv, page, len, off, same_page)) {
if (bio->bi_iter.bi_size > UINT_MAX - len) {
*same_page = false;
return false;
@@ -418,6 +418,9 @@ struct bio *bio_alloc_clone(struct block_device *bdev, struct bio *bio_src,
gfp_t gfp, struct bio_set *bs);
int bio_init_clone(struct block_device *bdev, struct bio *bio,
struct bio *bio_src, gfp_t gfp);
+bool bio_page_is_mergeable(const struct bio_vec *bv, struct page *page,
+ unsigned int len, unsigned int off,
+ bool *same_page);
extern struct bio_set fs_bio_set;