[PATCH v3 3/8] md: introduce safe_put_folio for folio support in RAID

[email protected]
Newsgroups gmane.linux.raid,gmane.linux.kernel
Message-ID <[email protected]>
From: Li Nan <[email protected]>

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

Signed-off-by: Li Nan <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.