[PATCH v1] gfs2: increase usage of folio_next_index() helper

Minjie Du posted 1 patch 2 years, 6 months ago
fs/gfs2/aops.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH v1] gfs2: increase usage of folio_next_index() helper
Posted by Minjie Du 2 years, 6 months ago
Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using
the existing helper folio_next_index().

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 fs/gfs2/aops.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index ae49256b7..5f0254237 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -272,8 +272,7 @@ static int gfs2_write_jdata_batch(struct address_space *mapping,
 				 * not be suitable for data integrity
 				 * writeout).
 				 */
-				*done_index = folio->index +
-					folio_nr_pages(folio);
+				*done_index = folio_next_index(folio);
 				ret = 1;
 				break;
 			}
-- 
2.39.0
Re: [PATCH v1] gfs2: increase usage of folio_next_index() helper
Posted by Andreas Gruenbacher 2 years, 6 months ago
Minjie,

On Mon, Jul 17, 2023 at 9:20 AM Minjie Du <duminjie@vivo.com> wrote:
> Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using
> the existing helper folio_next_index().
>
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> ---
>  fs/gfs2/aops.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
> index ae49256b7..5f0254237 100644
> --- a/fs/gfs2/aops.c
> +++ b/fs/gfs2/aops.c
> @@ -272,8 +272,7 @@ static int gfs2_write_jdata_batch(struct address_space *mapping,
>                                  * not be suitable for data integrity
>                                  * writeout).
>                                  */
> -                               *done_index = folio->index +
> -                                       folio_nr_pages(folio);
> +                               *done_index = folio_next_index(folio);
>                                 ret = 1;
>                                 break;
>                         }
> --
> 2.39.0
>

Applied, thanks.

Email addresses like '"open list:GFS2 FILE SYSTEM"
<cluster-devel@redhat.com>' and 'open list
<linux-kernel@vger.kernel.org>' are not helpful though, so could you
please avoid using addresses like that in the future?

Thanks,
Andreas