linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richardw.yang@linux.intel.com>
To: Wei Yang <richardw.yang@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs/userfaultfd.c: simplify the calculation of new_flags
Date: Thu, 12 Sep 2019 10:54:24 +0800	[thread overview]
Message-ID: <20190912025424.GB25169@richard> (raw)
In-Reply-To: <20190806053859.2374-1-richardw.yang@linux.intel.com>

Ping~

On Tue, Aug 06, 2019 at 01:38:59PM +0800, Wei Yang wrote:
>Finally new_flags equals old vm_flags *OR* vm_flags.
>
>It is not necessary to mask them first.
>
>Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>---
> fs/userfaultfd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
>index ccbdbd62f0d8..653d8f7c453c 100644
>--- a/fs/userfaultfd.c
>+++ b/fs/userfaultfd.c
>@@ -1457,7 +1457,7 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx,
> 			start = vma->vm_start;
> 		vma_end = min(end, vma->vm_end);
> 
>-		new_flags = (vma->vm_flags & ~vm_flags) | vm_flags;
>+		new_flags = vma->vm_flags | vm_flags;
> 		prev = vma_merge(mm, prev, start, vma_end, new_flags,
> 				 vma->anon_vma, vma->vm_file, vma->vm_pgoff,
> 				 vma_policy(vma),
>-- 
>2.17.1

-- 
Wei Yang
Help you, Help me

  reply	other threads:[~2019-09-12  2:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06  5:38 [PATCH] fs/userfaultfd.c: simplify the calculation of new_flags Wei Yang
2019-09-12  2:54 ` Wei Yang [this message]
2019-10-03  0:45 ` Andrea Arcangeli
2019-10-04 22:46   ` Wei Yang
2019-10-04 23:28     ` Andrea Arcangeli
2019-10-04 23:38       ` Wei Yang
2019-10-09  3:51       ` Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190912025424.GB25169@richard \
    --to=richardw.yang@linux.intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).