On Mon, Jan 21, 2019 at 03:57:03PM +0800, Peter Xu wrote:
> From: Shaohua Li <s...@fb.com>
> 
> add helper for writeprotect check. Will use it later.

I'd merge this with the commit that actually uses this helper.
 
> Cc: Andrea Arcangeli <aarca...@redhat.com>
> Cc: Pavel Emelyanov <xe...@parallels.com>
> Cc: Rik van Riel <r...@redhat.com>
> Cc: Kirill A. Shutemov <kir...@shutemov.name>
> Cc: Mel Gorman <mgor...@suse.de>
> Cc: Hugh Dickins <hu...@google.com>
> Cc: Johannes Weiner <han...@cmpxchg.org>
> Signed-off-by: Shaohua Li <s...@fb.com>
> Signed-off-by: Andrea Arcangeli <aarca...@redhat.com>
> Signed-off-by: Peter Xu <pet...@redhat.com>
> ---
>  include/linux/userfaultfd_k.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/linux/userfaultfd_k.h b/include/linux/userfaultfd_k.h
> index 37c9eba75c98..38f748e7186e 100644
> --- a/include/linux/userfaultfd_k.h
> +++ b/include/linux/userfaultfd_k.h
> @@ -50,6 +50,11 @@ static inline bool userfaultfd_missing(struct 
> vm_area_struct *vma)
>       return vma->vm_flags & VM_UFFD_MISSING;
>  }
> 
> +static inline bool userfaultfd_wp(struct vm_area_struct *vma)
> +{
> +     return vma->vm_flags & VM_UFFD_WP;
> +}
> +
>  static inline bool userfaultfd_armed(struct vm_area_struct *vma)
>  {
>       return vma->vm_flags & (VM_UFFD_MISSING | VM_UFFD_WP);
> @@ -94,6 +99,11 @@ static inline bool userfaultfd_missing(struct 
> vm_area_struct *vma)
>       return false;
>  }
> 
> +static inline bool userfaultfd_wp(struct vm_area_struct *vma)
> +{
> +     return false;
> +}
> +
>  static inline bool userfaultfd_armed(struct vm_area_struct *vma)
>  {
>       return false;
> -- 
> 2.17.1
> 

-- 
Sincerely yours,
Mike.

Reply via email to