btrfs: use folio_next_index() helper in extent_write_cache_pages
authorMinjie Du <duminjie@vivo.com>
Mon, 17 Jul 2023 07:16:22 +0000 (15:16 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2023 12:52:13 +0000 (14:52 +0200)
Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using
the existing helper folio_next_index().

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Minjie Du <duminjie@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c

index 90ad300..91fba78 100644 (file)
@@ -2150,7 +2150,7 @@ retry:
                for (i = 0; i < nr_folios; i++) {
                        struct folio *folio = fbatch.folios[i];
 
-                       done_index = folio->index + folio_nr_pages(folio);
+                       done_index = folio_next_index(folio);
                        /*
                         * At this point we hold neither the i_pages lock nor
                         * the page lock: the page may be truncated or