From: Max Kellermann <max.kellermann@ionos.com>
To: jack@suse.cz, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: amir73il@gmail.com, max.kellermann@ionos.com
Subject: [PATCH 2/4] inotify_user: move code to do_inotify_add_watch()
Date: Mon, 18 Sep 2023 14:32:15 +0200 [thread overview]
Message-ID: <20230918123217.932179-2-max.kellermann@ionos.com> (raw)
In-Reply-To: <20230918123217.932179-1-max.kellermann@ionos.com>
Preparing for inotify_add_watch_at().
To: Jan Kara <jack@suse.cz>
Cc: Amir Goldstein <amir73il@gmail.com>
To: linux-fsdevel@vger.kernel.org
To: linux-kernel@vger.kernel.org
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
fs/notify/inotify/inotify_user.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index 1853439a24f6..b6e6f6ab21f8 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -727,8 +727,8 @@ SYSCALL_DEFINE0(inotify_init)
return do_inotify_init(0);
}
-SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
- u32, mask)
+static int do_inotify_add_watch(int fd, int dfd, const char __user *pathname,
+ u32 mask)
{
struct fsnotify_group *group;
struct inode *inode;
@@ -774,7 +774,7 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
if (mask & IN_ONLYDIR)
flags |= LOOKUP_DIRECTORY;
- ret = inotify_find_inode(AT_FDCWD, pathname, &path, flags,
+ ret = inotify_find_inode(dfd, pathname, &path, flags,
(mask & IN_ALL_EVENTS));
if (ret)
goto fput_and_out;
@@ -791,6 +791,12 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
return ret;
}
+SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
+ u32, mask)
+{
+ return do_inotify_add_watch(fd, AT_FDCWD, pathname, mask);
+}
+
SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd)
{
struct fsnotify_group *group;
--
2.39.2
next prev parent reply other threads:[~2023-09-18 12:33 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 12:32 [PATCH 1/4] inotify_user: pass directory fd to inotify_find_inode() Max Kellermann
2023-09-18 12:32 ` Max Kellermann [this message]
2023-09-18 12:32 ` [PATCH 3/4] inotify_user: add system call inotify_add_watch_at() Max Kellermann
2023-09-18 12:40 ` Jan Kara
2023-09-18 13:57 ` Max Kellermann
2023-09-18 14:23 ` Jan Kara
2023-09-18 15:28 ` Amir Goldstein
2023-09-18 18:05 ` inotify maintenance status Amir Goldstein
2023-09-19 7:16 ` Amir Goldstein
2023-09-19 9:08 ` Max Kellermann
2023-09-19 10:01 ` Jan Kara
2023-09-19 10:42 ` Amir Goldstein
2023-09-19 10:48 ` Max Kellermann
2023-09-19 10:42 ` Max Kellermann
2023-09-19 10:58 ` Amir Goldstein
2023-09-19 11:21 ` Max Kellermann
2023-09-19 12:21 ` Amir Goldstein
2023-09-19 12:51 ` Max Kellermann
2023-09-19 13:01 ` Amir Goldstein
2023-09-19 13:11 ` Max Kellermann
2023-09-19 13:22 ` Amir Goldstein
2023-09-19 13:41 ` Max Kellermann
2023-09-19 13:56 ` Amir Goldstein
2023-09-19 13:28 ` Jan Kara
2023-09-19 13:48 ` Max Kellermann
2023-09-19 9:26 ` Christian Brauner
2023-09-19 9:48 ` Jan Kara
2023-09-19 14:55 ` Amir Goldstein
2023-09-18 19:45 ` [PATCH 3/4] inotify_user: add system call inotify_add_watch_at() Max Kellermann
2023-09-18 12:32 ` [PATCH 4/4] arch: register inotify_add_watch_at Max Kellermann
2023-09-18 20:24 ` kernel test robot
2023-09-18 20:24 ` kernel test robot
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=20230918123217.932179-2-max.kellermann@ionos.com \
--to=max.kellermann@ionos.com \
--cc=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).