From: Li Nan <[email protected]>
The helper resync_fetch_folio() only returns the folio member without
any additional logic. Clean it up by accessing rf->folio directly.
Signed-off-by: Li Nan <[email protected]>
---
drivers/md/raid1-10.c | 7 +------
drivers/md/raid1.c | 2 +-
drivers/md/raid10.c | 3 +--
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c
index 568ab002691f..2ff1f8855900 100644
--- a/drivers/md/raid1-10.c
+++ b/drivers/md/raid1-10.c
@@ -55,11 +55,6 @@ static inline void resync_free_folio(struct resync_folio *rf)
folio_put(rf->folio);
}
-static inline struct folio *resync_fetch_folio(struct resync_folio *rf)
-{
- return 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.
@@ -74,7 +69,7 @@ static void md_bio_reset_resync_folio(struct bio *bio, struct resync_folio *rf,
int size)
{
/* initialize bvec table again */
- if (WARN_ON(!bio_add_folio(bio, resync_fetch_folio(rf),
+ if (WARN_ON(!bio_add_folio(bio, rf->folio,
min_t(int, size, RESYNC_BLOCK_SIZE),
0))) {
bio->bi_status = BLK_STS_RESOURCE;
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index c1580aea4189..cf87f36fb7d8 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2992,7 +2992,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
bio = r1_bio->bios[i];
rf = get_resync_folio(bio);
if (bio->bi_end_io) {
- folio = resync_fetch_folio(rf);
+ folio = rf->folio;
/*
* won't fail because the vec table is big
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 4beea6ee9dfc..5afe270f6941 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3630,9 +3630,8 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
break;
for (bio= biolist ; bio ; bio=bio->bi_next) {
struct resync_folio *rf = get_resync_folio(bio);
- struct folio *folio = resync_fetch_folio(rf);
- if (WARN_ON(!bio_add_folio(bio, folio, len, 0))) {
+ if (WARN_ON(!bio_add_folio(bio, rf->folio, len, 0))) {
bio->bi_status = BLK_STS_RESOURCE;
bio_endio(bio);
*skipped = 1;
--
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.