linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: John McCutchan <john@johnmccutchan.com>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Eric Paris <eparis@redhat.com>, Robert Love <rlove@rlove.org>,
	<linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
	<linux-nfs@vger.kernel.org>
Subject: [PATCH 3/3] fs: notify: use path_equal() to simply code
Date: Mon, 14 Oct 2013 20:26:02 +0800	[thread overview]
Message-ID: <1381753562-47884-4-git-send-email-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <1381753562-47884-1-git-send-email-wangkefeng.wang@huawei.com>

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 fs/notify/fanotify/fanotify.c        | 3 +--
 fs/notify/inotify/inotify_fsnotify.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
index 0c2f912..777af06 100644
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@ -24,8 +24,7 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new)
 			    (new->mask & FAN_ALL_PERM_EVENTS))
 				return false;
 #endif
-			if ((old->path.mnt == new->path.mnt) &&
-			    (old->path.dentry == new->path.dentry))
+			if (path_equal(&old->path, &new->path))
 				return true;
 			break;
 		case (FSNOTIFY_EVENT_NONE):
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
index 4216308..58b638d 100644
--- a/fs/notify/inotify/inotify_fsnotify.c
+++ b/fs/notify/inotify/inotify_fsnotify.c
@@ -53,8 +53,7 @@ static bool event_compare(struct fsnotify_event *old, struct fsnotify_event *new
 				return true;
 			break;
 		case (FSNOTIFY_EVENT_PATH):
-			if ((old->path.mnt == new->path.mnt) &&
-			    (old->path.dentry == new->path.dentry))
+			if (path_equal(&old->path, &new->path))
 				return true;
 			break;
 		case (FSNOTIFY_EVENT_NONE):
-- 
1.8.2.1

  parent reply	other threads:[~2013-10-14 12:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-14 12:25 [PATCH 0/3] fs: use helper function path_foo() to simpily code Kefeng Wang
2013-10-14 12:26 ` [PATCH 1/3] fs: use path_equal() and path_put() to simplify code Kefeng Wang
2013-10-14 12:26 ` [PATCH 2/3] fs: nfsd: use path_equal() to simply code Kefeng Wang
2013-10-14 12:26 ` Kefeng Wang [this message]
2013-10-26 10:42 ` [PATCH 0/3] fs: use helper function path_foo() to simpily code Kefeng Wang

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=1381753562-47884-4-git-send-email-wangkefeng.wang@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=bfields@fieldses.org \
    --cc=eparis@redhat.com \
    --cc=john@johnmccutchan.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rlove@rlove.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).