[PATCH 12/15] md: clean up resync_free_folio

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

The resync_free_folio() helper only wraps a single folio_put() call,
so remove it and call folio_put() directly.

Signed-off-by: Li Nan <[email protected]>
---
 drivers/md/raid1-10.c | 5 -----
 drivers/md/raid1.c    | 4 ++--
 drivers/md/raid10.c   | 4 ++--
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c
index 2ff1f8855900..ffbd7bd0f6e8 100644
--- a/drivers/md/raid1-10.c
+++ b/drivers/md/raid1-10.c
@@ -50,11 +50,6 @@ static inline int resync_alloc_folio(struct resync_folio *rf,
 	return 0;
 }
 
-static inline void resync_free_folio(struct resync_folio *rf)
-{
-	folio_put(rf->folio);
-}
-
 /*
  * 'strct resync_folio' stores actual pages used for doing the resync
  *  IO, and it is per-bio, so make .bi_private points to it.
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index cf87f36fb7d8..38f86de45dea 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -199,7 +199,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
 
 out_free_folio:
 	while (--j >= 0)
-		resync_free_folio(&rfs[j]);
+		folio_put(rfs[j].folio);
 
 out_free_bio:
 	while (++j < conf->raid_disks * 2) {
@@ -222,7 +222,7 @@ static void r1buf_pool_free(void *__r1_bio, void *data)
 
 	for (i = conf->raid_disks * 2; i--; ) {
 		rf = get_resync_folio(r1bio->bios[i]);
-		resync_free_folio(rf);
+		folio_put(rf->folio);
 		bio_uninit(r1bio->bios[i]);
 		kfree(r1bio->bios[i]);
 	}
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 5afe270f6941..c3ef2ea38b08 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -204,7 +204,7 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data)
 
 out_free_pages:
 	while (--j >= 0)
-		resync_free_folio(&rfs[j]);
+		folio_put(rfs[j].folio);
 
 	j = 0;
 out_free_bio:
@@ -234,7 +234,7 @@ static void r10buf_pool_free(void *__r10_bio, void *data)
 
 		if (bio) {
 			rf = get_resync_folio(bio);
-			resync_free_folio(rf);
+			folio_put(rf->folio);
 			bio_uninit(bio);
 			kfree(bio);
 		}
-- 
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.