]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
folio_batch: rename PAGEVEC_SIZE to FOLIO_BATCH_SIZE
authorTal Zussman <tz2294@columbia.edu>
Wed, 25 Feb 2026 23:44:28 +0000 (18:44 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:53:07 +0000 (13:53 -0700)
struct pagevec no longer exists.  Rename the macro appropriately.

Link: https://lkml.kernel.org/r/20260225-pagevec_cleanup-v2-4-716868cc2d11@columbia.edu
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Cc: Chris Li <chrisl@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/btrfs/extent_io.c
include/linux/folio_batch.h
include/linux/folio_queue.h
mm/shmem.c
mm/swap.c
mm/swap_state.c
mm/truncate.c

index 89649ef5107a473626d81cf5f35b45f49cd2be23..070c8759b0b4728dd0e3917a0b4b531577cd08e2 100644 (file)
@@ -2095,13 +2095,13 @@ static void buffer_tree_tag_for_writeback(struct btrfs_fs_info *fs_info,
 struct eb_batch {
        unsigned int nr;
        unsigned int cur;
-       struct extent_buffer *ebs[PAGEVEC_SIZE];
+       struct extent_buffer *ebs[FOLIO_BATCH_SIZE];
 };
 
 static inline bool eb_batch_add(struct eb_batch *batch, struct extent_buffer *eb)
 {
        batch->ebs[batch->nr++] = eb;
-       return (batch->nr < PAGEVEC_SIZE);
+       return (batch->nr < FOLIO_BATCH_SIZE);
 }
 
 static inline void eb_batch_init(struct eb_batch *batch)
index a2f3d3043f7e772293a415aad9b8285f917b3201..b45946adc50bba796c2cd6cab8e821d8166d8ada 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/types.h>
 
 /* 31 pointers + header align the folio_batch structure to a power of two */
-#define PAGEVEC_SIZE   31
+#define FOLIO_BATCH_SIZE       31
 
 struct folio;
 
@@ -29,7 +29,7 @@ struct folio_batch {
        unsigned char nr;
        unsigned char i;
        bool percpu_pvec_drained;
-       struct folio *folios[PAGEVEC_SIZE];
+       struct folio *folios[FOLIO_BATCH_SIZE];
 };
 
 /**
@@ -58,7 +58,7 @@ static inline unsigned int folio_batch_count(const struct folio_batch *fbatch)
 
 static inline unsigned int folio_batch_space(const struct folio_batch *fbatch)
 {
-       return PAGEVEC_SIZE - fbatch->nr;
+       return FOLIO_BATCH_SIZE - fbatch->nr;
 }
 
 /**
index 0d3765fa9d1d6641098d1d6fda506912f6135daf..f6d5f1f127c9f3d2dd853d008dc55fb17b1faab9 100644 (file)
  */
 struct folio_queue {
        struct folio_batch      vec;            /* Folios in the queue segment */
-       u8                      orders[PAGEVEC_SIZE]; /* Order of each folio */
+       u8                      orders[FOLIO_BATCH_SIZE]; /* Order of each folio */
        struct folio_queue      *next;          /* Next queue segment or NULL */
        struct folio_queue      *prev;          /* Previous queue segment of NULL */
        unsigned long           marks;          /* 1-bit mark per folio */
        unsigned long           marks2;         /* Second 1-bit mark per folio */
-#if PAGEVEC_SIZE > BITS_PER_LONG
+#if FOLIO_BATCH_SIZE > BITS_PER_LONG
 #error marks is not big enough
 #endif
        unsigned int            rreq_id;
@@ -70,7 +70,7 @@ static inline void folioq_init(struct folio_queue *folioq, unsigned int rreq_id)
  */
 static inline unsigned int folioq_nr_slots(const struct folio_queue *folioq)
 {
-       return PAGEVEC_SIZE;
+       return FOLIO_BATCH_SIZE;
 }
 
 /**
index 149fdb051170639274d13ec5cca9d040d1d25cb0..5e7dcf5bc5d3c9a758b067dac442b83d56f51840 100644 (file)
@@ -1113,7 +1113,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
        pgoff_t start = (lstart + PAGE_SIZE - 1) >> PAGE_SHIFT;
        pgoff_t end = (lend + 1) >> PAGE_SHIFT;
        struct folio_batch fbatch;
-       pgoff_t indices[PAGEVEC_SIZE];
+       pgoff_t indices[FOLIO_BATCH_SIZE];
        struct folio *folio;
        bool same_folio;
        long nr_swaps_freed = 0;
@@ -1510,7 +1510,7 @@ static int shmem_unuse_inode(struct inode *inode, unsigned int type)
        struct address_space *mapping = inode->i_mapping;
        pgoff_t start = 0;
        struct folio_batch fbatch;
-       pgoff_t indices[PAGEVEC_SIZE];
+       pgoff_t indices[FOLIO_BATCH_SIZE];
        int ret = 0;
 
        do {
index 2e517ede6561d906f6dee82b05208c3b25641e21..78b4aa811fc61babc96fa3ce18c96cccd824396b 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -1018,7 +1018,7 @@ EXPORT_SYMBOL(folios_put_refs);
 void release_pages(release_pages_arg arg, int nr)
 {
        struct folio_batch fbatch;
-       int refs[PAGEVEC_SIZE];
+       int refs[FOLIO_BATCH_SIZE];
        struct encoded_page **encoded = arg.encoded_pages;
        int i;
 
index a0c64db2b2750c60106f44411e80e3bf843eeefd..6313b59d7eabcbe5b8bd1c351417644f0c109dff 100644 (file)
@@ -385,7 +385,7 @@ void free_folio_and_swap_cache(struct folio *folio)
 void free_pages_and_swap_cache(struct encoded_page **pages, int nr)
 {
        struct folio_batch folios;
-       unsigned int refs[PAGEVEC_SIZE];
+       unsigned int refs[FOLIO_BATCH_SIZE];
 
        folio_batch_init(&folios);
        for (int i = 0; i < nr; i++) {
index df0b7a7e6aff933dd90b938edc8d3b64a8b776b8..2931d66c16d00638032f50ca908529b883d7ca86 100644 (file)
@@ -369,7 +369,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
        pgoff_t         start;          /* inclusive */
        pgoff_t         end;            /* exclusive */
        struct folio_batch fbatch;
-       pgoff_t         indices[PAGEVEC_SIZE];
+       pgoff_t         indices[FOLIO_BATCH_SIZE];
        pgoff_t         index;
        int             i;
        struct folio    *folio;
@@ -534,7 +534,7 @@ EXPORT_SYMBOL(truncate_inode_pages_final);
 unsigned long mapping_try_invalidate(struct address_space *mapping,
                pgoff_t start, pgoff_t end, unsigned long *nr_failed)
 {
-       pgoff_t indices[PAGEVEC_SIZE];
+       pgoff_t indices[FOLIO_BATCH_SIZE];
        struct folio_batch fbatch;
        pgoff_t index = start;
        unsigned long ret;
@@ -672,7 +672,7 @@ failed:
 int invalidate_inode_pages2_range(struct address_space *mapping,
                                  pgoff_t start, pgoff_t end)
 {
-       pgoff_t indices[PAGEVEC_SIZE];
+       pgoff_t indices[FOLIO_BATCH_SIZE];
        struct folio_batch fbatch;
        pgoff_t index;
        int i;