From: Tejun Heo <tj@kernel.org>
To: "T.J. Mercier" <tjmercier@google.com>
Cc: gregkh@linuxfoundation.org, driver-core@lists.linux.dev,
linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
shuah@kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 2/3] kernfs: send IN_DELETE_SELF and IN_IGNORED on file deletion
Date: Tue, 10 Feb 2026 12:42:33 -1000 [thread overview]
Message-ID: <aYu0WZ-xCZr-bmsq@slm.duckdns.org> (raw)
In-Reply-To: <20260210003801.2834976-3-tjmercier@google.com>
On Mon, Feb 09, 2026 at 04:38:00PM -0800, T.J. Mercier wrote:
...
> static void __kernfs_remove(struct kernfs_node *kn)
> {
> struct kernfs_node *pos, *parent;
> @@ -1520,6 +1538,9 @@ static void __kernfs_remove(struct kernfs_node *kn)
> struct kernfs_iattrs *ps_iattr =
> parent ? parent->iattr : NULL;
>
> + if (kernfs_type(kn) == KERNFS_FILE)
kernfs_type(pos)?
> + kernfs_notify_file_deleted(pos);
> +
...
> -static void kernfs_notify_workfn(struct work_struct *work)
> +static int fsnotify_self_event(int event)
> +{
> + if (event == FS_DELETE)
> + return FS_DELETE_SELF;
> +
> + return event;
> +}
> +
> +void kernfs_notify_workfn(struct work_struct *work)
> {
> struct kernfs_node *kn;
> struct kernfs_super_info *info;
> struct kernfs_root *root;
> u32 notify_event;
> + u32 self_event;
> repeat:
> /* pop one off the notify_list */
> spin_lock_irq(&kernfs_notify_lock);
> @@ -929,6 +938,8 @@ static void kernfs_notify_workfn(struct work_struct *work)
> kn->attr.notify_event = 0;
> spin_unlock_irq(&kernfs_notify_lock);
>
> + self_event = fsnotify_self_event(notify_event);
Maybe just inline the conversion?
Thanks.
--
tejun
next prev parent reply other threads:[~2026-02-10 22:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 0:37 [PATCH 0/3] kernfs: Add inotify IN_DELETE_SELF, IN_IGNORED support for files T.J. Mercier
2026-02-10 0:37 ` [PATCH 1/3] kernfs: allow passing fsnotify event types T.J. Mercier
2026-02-10 0:38 ` [PATCH 2/3] kernfs: send IN_DELETE_SELF and IN_IGNORED on file deletion T.J. Mercier
2026-02-10 22:42 ` Tejun Heo [this message]
2026-02-10 22:48 ` T.J. Mercier
2026-02-10 0:38 ` [PATCH 3/3] selftests: memcg: Add tests IN_DELETE_SELF and IN_IGNORED on memory.events T.J. Mercier
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=aYu0WZ-xCZr-bmsq@slm.duckdns.org \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=tjmercier@google.com \
/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