fanotify: use macros to get the offset to fanotify_info buffer
authorAmir Goldstein <amir73il@gmail.com>
Mon, 29 Nov 2021 20:15:31 +0000 (22:15 +0200)
committerJan Kara <jack@suse.cz>
Wed, 15 Dec 2021 13:04:30 +0000 (14:04 +0100)
commit2d9374f095136206a02eb0b6cd9ef94632c1e9f7
tree227ae1a4fcbebe2ad12c945475ad3acd3ae00465
parente54183fa7047c15819bc155f4c58501d9a9a3489
fanotify: use macros to get the offset to fanotify_info buffer

The fanotify_info buffer contains up to two file handles and a name.
Use macros to simplify the code that access the different items within
the buffer.

Add assertions to verify that stored fh len and name len do not overflow
the u8 stored value in fanotify_info header.

Remove the unused fanotify_info_len() helper.

Link: https://lore.kernel.org/r/20211129201537.1932819-6-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.h