From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by kanga.kvack.org (Postfix) with ESMTP id E445B8E0001 for ; Mon, 21 Jan 2019 05:24:20 -0500 (EST) Received: by mail-qk1-f197.google.com with SMTP id v64so18940549qka.5 for ; Mon, 21 Jan 2019 02:24:20 -0800 (PST) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id d12si2593100qtc.207.2019.01.21.02.24.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jan 2019 02:24:20 -0800 (PST) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0LAOE3K144469 for ; Mon, 21 Jan 2019 05:24:19 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2q590y0nju-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 21 Jan 2019 05:24:14 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 Jan 2019 10:23:23 -0000 Date: Mon, 21 Jan 2019 12:23:12 +0200 From: Mike Rapoport Subject: Re: [PATCH RFC 05/24] userfaultfd: wp: add helper for writeprotect check References: <20190121075722.7945-1-peterx@redhat.com> <20190121075722.7945-6-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190121075722.7945-6-peterx@redhat.com> Message-Id: <20190121102312.GD19725@rapoport-lnx> Sender: owner-linux-mm@kvack.org List-ID: To: Peter Xu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hugh Dickins , Maya Gokhale , Jerome Glisse , Johannes Weiner , Martin Cracauer , Denis Plotnikov , Shaohua Li , Andrea Arcangeli , Pavel Emelyanov , Mike Kravetz , Marty McFadden , Mike Rapoport , Mel Gorman , "Kirill A . Shutemov" , "Dr . David Alan Gilbert" , Rik van Riel On Mon, Jan 21, 2019 at 03:57:03PM +0800, Peter Xu wrote: > From: Shaohua Li > > add helper for writeprotect check. Will use it later. I'd merge this with the commit that actually uses this helper. > Cc: Andrea Arcangeli > Cc: Pavel Emelyanov > Cc: Rik van Riel > Cc: Kirill A. Shutemov > Cc: Mel Gorman > Cc: Hugh Dickins > Cc: Johannes Weiner > Signed-off-by: Shaohua Li > Signed-off-by: Andrea Arcangeli > Signed-off-by: Peter Xu > --- > 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.