diff mbox series

[v3,1/5] mm: pagevec: add folio_batch_reinit()

Message ID b75d577d0994229f142bcca8ff330c4c587389dd.1672043615.git.lstoakes@gmail.com (mailing list archive)
State New
Headers show
Series update mlock to use folios | expand

Commit Message

Lorenzo Stoakes Dec. 26, 2022, 8:44 a.m. UTC
This performs the same task as pagevec_reinit(), only modifying a folio
batch rather than a pagevec.

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
---
 include/linux/pagevec.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Vlastimil Babka Jan. 12, 2023, 9:57 a.m. UTC | #1
On 12/26/22 09:44, Lorenzo Stoakes wrote:
> This performs the same task as pagevec_reinit(), only modifying a folio
> batch rather than a pagevec.
> 
> Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  include/linux/pagevec.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
> index 215eb6c3bdc9..2a6f61a0c10a 100644
> --- a/include/linux/pagevec.h
> +++ b/include/linux/pagevec.h
> @@ -103,6 +103,11 @@ static inline void folio_batch_init(struct folio_batch *fbatch)
>  	fbatch->percpu_pvec_drained = false;
>  }
>  
> +static inline void folio_batch_reinit(struct folio_batch *fbatch)
> +{
> +	fbatch->nr = 0;
> +}
> +
>  static inline unsigned int folio_batch_count(struct folio_batch *fbatch)
>  {
>  	return fbatch->nr;
diff mbox series

Patch

diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
index 215eb6c3bdc9..2a6f61a0c10a 100644
--- a/include/linux/pagevec.h
+++ b/include/linux/pagevec.h
@@ -103,6 +103,11 @@  static inline void folio_batch_init(struct folio_batch *fbatch)
 	fbatch->percpu_pvec_drained = false;
 }
 
+static inline void folio_batch_reinit(struct folio_batch *fbatch)
+{
+	fbatch->nr = 0;
+}
+
 static inline unsigned int folio_batch_count(struct folio_batch *fbatch)
 {
 	return fbatch->nr;