Re: [PATCH v2 11/14] md: clean up resync_free_folio

"Yu Kuai" <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.raid
Message-ID <[email protected]>
Hi,

在 2026/1/28 15:57, [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(-)

Same as patch 10, I think this patch should be merged into patch 5.

>
> 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 a303349eeff4..b5239b5cb4e9 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 d8a5fadfc933..b728131bdad4 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_folio:
>   	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);
>   		}

-- 
Thansk,
Kuai
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.