public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: linan666@huaweicloud.com
To: song@kernel.org, yukuai@fnnas.com
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	linan666@huaweicloud.com, yangerkun@huawei.com,
	yi.zhang@huawei.com
Subject: [PATCH v3 3/8] md: introduce safe_put_folio for folio support in RAID
Date: Thu, 16 Apr 2026 11:37:56 +0800	[thread overview]
Message-ID: <20260416033801.786415-4-linan666@huaweicloud.com> (raw)
In-Reply-To: <20260416033801.786415-1-linan666@huaweicloud.com>

From: Li Nan <linan122@huawei.com>

safe_put_page() will be removed after the last reference to it in RAID5
is removed.

Signed-off-by: Li Nan <linan122@huawei.com>
---
 drivers/md/md.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/md/md.h b/drivers/md/md.h
index 914b992a073b..7c0c38f09cc3 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -888,6 +888,12 @@ struct md_io_clone {
 	rcu_read_unlock();                  \
 } while (0)
 
+static inline void safe_folio_put(struct folio *folio)
+{
+	if (folio)
+		folio_put(folio);
+}
+
 static inline void safe_put_page(struct page *p)
 {
 	if (p) put_page(p);
-- 
2.39.2


  parent reply	other threads:[~2026-04-16  3:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16  3:37 [PATCH v3 0/8] folio support for sync I/O in RAID linan666
2026-04-16  3:37 ` [PATCH v3 1/8] md/raid1,raid10: clean up of RESYNC_SECTORS linan666
2026-04-16  3:37 ` [PATCH v3 2/8] md: introduce sync_folio_io for folio support in RAID linan666
2026-04-16  3:37 ` linan666 [this message]
2026-04-16  3:37 ` [PATCH v3 4/8] md/raid1: use folio for tmppage linan666
2026-04-16  3:37 ` [PATCH v3 5/8] md/raid10: " linan666
2026-04-16  3:37 ` [PATCH v3 6/8] md/raid1,raid10: use folio for sync path IO linan666
2026-04-16  3:38 ` [PATCH v3 7/8] md/raid1: fix IO error at logical block size granularity linan666
2026-04-16  3:38 ` [PATCH v3 8/8] md/raid10: " linan666

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=20260416033801.786415-4-linan666@huaweicloud.com \
    --to=linan666@huaweicloud.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai@fnnas.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