]> git.ipfire.org Git - people/ms/linux.git/commit - fs/notify/fanotify/fanotify_user.c
fanotify: introduce group flag FAN_REPORT_TARGET_FID
authorAmir Goldstein <amir73il@gmail.com>
Mon, 29 Nov 2021 20:15:29 +0000 (22:15 +0200)
committerJan Kara <jack@suse.cz>
Wed, 15 Dec 2021 13:04:25 +0000 (14:04 +0100)
commitd61fd650e9d206a71fda789f02a1ced4b19944c4
tree7e0cc3f9013fd0cee3f25131fed0f486dc767956
parent1c9007d62bea6fd164285314f7553f73e5308863
fanotify: introduce group flag FAN_REPORT_TARGET_FID

FAN_REPORT_FID is ambiguous in that it reports the fid of the child for
some events and the fid of the parent for create/delete/move events.

The new FAN_REPORT_TARGET_FID flag is an implicit request to report
the fid of the target object of the operation (a.k.a the child inode)
also in create/delete/move events in addition to the fid of the parent
and the name of the child.

To reduce the test matrix for uninteresting use cases, the new
FAN_REPORT_TARGET_FID flag requires both FAN_REPORT_NAME and
FAN_REPORT_FID.  The convenience macro FAN_REPORT_DFID_NAME_TARGET
combines FAN_REPORT_TARGET_FID with all the required flags.

Link: https://lore.kernel.org/r/20211129201537.1932819-4-amir73il@gmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fanotify/fanotify.c
fs/notify/fanotify/fanotify_user.c
include/linux/fanotify.h
include/uapi/linux/fanotify.h