Linux block layer
 help / color / mirror / Atom feed
From: Jinyoung CHOI <j-young.choi@samsung.com>
To: Jinyoung CHOI <j-young.choi@samsung.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>, "hch@lst.de" <hch@lst.de>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH 01/15] block: bio: rename page_is_mergeable to bio_page_is_mergeable and make non-static
Date: Wed, 03 May 2023 19:00:49 +0900	[thread overview]
Message-ID: <20230503100049epcms2p2c830ebb7b50beaa2663abd0cd274293c@epcms2p2> (raw)
In-Reply-To: <20230503094912epcms2p4bef206eab1c41a92eba2583a69c74323@epcms2p4>

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(-)

diff --git a/block/bio.c b/block/bio.c
index fd11614bba4d..3e5ab59502e2 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -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;
diff --git a/include/linux/bio.h b/include/linux/bio.h
index d766be7152e1..b53a595b519a 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -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;
 
-- 
2.34.1

  reply	other threads:[~2023-05-03 10:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230503094912epcms2p4bef206eab1c41a92eba2583a69c74323@epcms2p4>
2023-05-03  9:49 ` [PATCH 00/15] Change the integrity configuration method in block Jinyoung CHOI
2023-05-03 10:00   ` Jinyoung CHOI [this message]
2023-05-03 15:52     ` [PATCH 01/15] block: bio: rename page_is_mergeable to bio_page_is_mergeable and make non-static hch
2023-05-04  6:24       ` Jinyoung CHOI
2023-05-03 10:02   ` [PATCH 02/15] block: blk-integiry: add helper functions for bio_integrity_add_page Jinyoung CHOI
2023-05-03 15:55     ` hch
2023-05-04  6:46       ` Jinyoung CHOI
2023-05-03 10:06   ` [PATCH 03/15] block: bio-integrity: modify bio_integrity_add_page() Jinyoung CHOI
2023-05-03 10:09   ` [PATCH 04/15] block: bio-integiry: cleanup bio_integrity_prep Jinyoung CHOI
2023-05-03 15:55     ` hch
2023-05-03 10:10   ` [PATCH 05/15] block: fix not to apply bip information in blk_rq_bio_prep() Jinyoung CHOI
2023-05-03 12:56     ` kernel test robot
2023-05-03 15:57     ` hch
2023-05-04  6:10       ` Jinyoung CHOI
2023-05-03 17:23     ` kernel test robot
2023-05-03 19:06     ` kernel test robot
2023-05-03 10:12   ` [PATCH 06/15] block: blk-merge: fix to add the number of integrity segments to the request twice Jinyoung CHOI
2023-05-03 10:13   ` [PATCH 07/15] block: blk-merge: fix merging two requests in ll_merge_requests_fn Jinyoung CHOI
2023-05-03 10:16   ` [PATCH 08/15] block: add helper function to get the number of integrity segments Jinyoung CHOI
2023-05-03 10:18   ` [PATCH 09/15] scsi: add scsi_alloc_integrity_sgtables() for integrity process Jinyoung CHOI
2023-05-03 10:20   ` [PATCH 10/15] scsi: change to use blk_rq_nr_integrity_segments() instead of blk_rq_count_integrity_sg() Jinyoung CHOI
2023-05-03 10:21   ` [PATCH 11/15] block: blk-integrity: change how to find the number of integrity of bio Jinyoung CHOI
2023-05-03 10:23   ` [PATCH 12/15] nvme: rdma: change how to find the number of integrity of request Jinyoung CHOI
2023-05-03 10:25   ` [PATCH 13/15] block: add helper function for iteration of bip's bvec Jinyoung CHOI
2023-05-03 10:27   ` [PATCH 14/15] block: blk-integrity: change sg-table configuration method for integrity Jinyoung CHOI
2023-05-03 14:29     ` kernel test robot
2023-05-03 20:07     ` kernel test robot
2023-05-03 10:28   ` [PATCH 15/15] block: blk-integrity: remove blk_rq_count_integrity_sg() Jinyoung CHOI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230503100049epcms2p2c830ebb7b50beaa2663abd0cd274293c@epcms2p2 \
    --to=j-young.choi@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox