fanotify: copy event fid info to user
authorAmir Goldstein <amir73il@gmail.com>
Thu, 10 Jan 2019 17:04:35 +0000 (19:04 +0200)
committerJan Kara <jack@suse.cz>
Thu, 7 Feb 2019 15:38:35 +0000 (16:38 +0100)
commit5e469c830fdb5a1ebaa69b375b87f583326fd296
tree0c3ca43d6626960107108b2db0c93a17300ee0d9
parente9e0c8903009477b630e37a8b6364b26a00720da
fanotify: copy event fid info to user

If group requested FAN_REPORT_FID and event has file identifier,
copy that information to user reading the event after event metadata.

fid information is formatted as struct fanotify_event_info_fid
that includes a generic header struct fanotify_event_info_header,
so that other info types could be defined in the future using the
same header.

metadata->event_len includes the length of the fid information.

The fid information includes the filesystem's fsid (see statfs(2))
followed by an NFS file handle of the file that could be passed as
an argument to open_by_handle_at(2).

Cc: <linux-api@vger.kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fanotify/fanotify.h
fs/notify/fanotify/fanotify_user.c
include/uapi/linux/fanotify.h