lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230503100049epcms2p2c830ebb7b50beaa2663abd0cd274293c@epcms2p2>
Date:   Wed, 03 May 2023 19:00:49 +0900
From:   Jinyoung CHOI <j-young.choi@...sung.com>
To:     Jinyoung CHOI <j-young.choi@...sung.com>,
        "axboe@...nel.dk" <axboe@...nel.dk>, "hch@....de" <hch@....de>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH 01/15] block: bio: rename page_is_mergeable to
 bio_page_is_mergeable and make non-static

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@....de>
Cc: Martin K. Petersen <martin.petersen@...cle.com>

Signed-off-by: Jinyoung Choi <j-young.choi@...sung.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ