fanotify: use helpers to parcel fanotify_info buffer
authorAmir Goldstein <amir73il@gmail.com>
Mon, 29 Nov 2021 20:15:32 +0000 (22:15 +0200)
committerJan Kara <jack@suse.cz>
Wed, 15 Dec 2021 13:04:33 +0000 (14:04 +0100)
commit1a9515ac9e55e68d733bab81bd408463ab1e25b1
tree74d8e8e0208b12e7ce7ce6061a9667b40733bb81
parent2d9374f095136206a02eb0b6cd9ef94632c1e9f7
fanotify: use helpers to parcel fanotify_info buffer

fanotify_info buffer is parceled into variable sized records, so the
records must be written in order: dir_fh, file_fh, name.

Use helpers to assert that order and make fanotify_alloc_name_event()
a bit more generic to allow empty dir_fh record and to allow expanding
to more records (i.e. name2) soon.

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