summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2023-06-21 17:45:46 +0100
committerAndrew Morton <akpm@linux-foundation.org>2023-06-23 16:59:28 -0700
commit982a7194afc9a58ec55ed174c61869c2722bb918 (patch)
treea08371ec008c4dfb01e0c4ba0632fd9135f84cb7
parentf5f288a023193dddbc612d00abaa8f7353b44c5f (diff)
mm: add __folio_batch_release()
This performs the same role as __pagevec_release(), ie skipping the check for batch length of 0. Link: https://lkml.kernel.org/r/20230621164557.3510324-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--include/linux/pagevec.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
index f582f7213ea5..42aad53e382e 100644
--- a/include/linux/pagevec.h
+++ b/include/linux/pagevec.h
@@ -127,9 +127,15 @@ static inline unsigned folio_batch_add(struct folio_batch *fbatch,
return fbatch_space(fbatch);
}
+static inline void __folio_batch_release(struct folio_batch *fbatch)
+{
+ __pagevec_release((struct pagevec *)fbatch);
+}
+
static inline void folio_batch_release(struct folio_batch *fbatch)
{
- pagevec_release((struct pagevec *)fbatch);
+ if (folio_batch_count(fbatch))
+ __folio_batch_release(fbatch);
}
void folio_batch_remove_exceptionals(struct folio_batch *fbatch);