Re: [PATCH v5 02/16] mm: provide vma_[flags_]is_cow_mapping() and remove is_cow_mapping()

"Lorenzo Stoakes (ARM)" <[email protected]>
Newsgroups org.kvack.linux-mm,org.kernel.vger.linux-kernel
Message-ID <aob1goSSPH6sTN9y@gremlin>
(trim cc-list)

On Thu, Aug 13, 2026 at 06:32:19PM +0100, Lorenzo Stoakes (ARM) wrote:
...
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index df78847f5f07..199d0a64b14a 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2271,17 +2271,76 @@ void unpin_user_pages(struct page **pages, unsigned long npages);
>  void unpin_user_folio(struct folio *folio, unsigned long npages);
>  void unpin_folios(struct folio **folios, unsigned long nfolios);
>
...
> +/**
> + * vma_is_cow_mapping() - Is this VMA a CoW mapping?
> + * @desc: The VMA to check.

Andrew - a small typo here, this should be @vma not @desc, are you still to fix
this in place? If not can always send a fixup patch next cycle :))

(Credit to David's scripts for finding this! :)

> + *
> + * See vma_flags_is_cow_mapping() for details.
> + *
> + * Returns: true if the VMA is a CoW mapping, otherwise false.
> + */
> +static inline bool vma_is_cow_mapping(const struct vm_area_struct *vma)
>  {
> -	return (flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE;
> +	return vma_flags_is_cow_mapping(&vma->flags);
>  }
>


--
Cheers, Lorenzo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.