fanotify: divorce fanotify_path_event and fanotify_fid_event
authorJan Kara <jack@suse.cz>
Tue, 24 Mar 2020 16:04:20 +0000 (17:04 +0100)
committerJan Kara <jack@suse.cz>
Wed, 25 Mar 2020 09:27:16 +0000 (10:27 +0100)
commit7088f35720a55b99624ea36091538baec7ec611f
tree6e6d3eecaa9d3c239204477f6ab227dc4d8ee860
parentafc894c784c84cb3bb85a235feca2cb278f7b023
fanotify: divorce fanotify_path_event and fanotify_fid_event

Breakup the union and make them both inherit from abstract fanotify_event.

fanotify_path_event, fanotify_fid_event and fanotify_perm_event inherit
from fanotify_event.

type field in abstract fanotify_event determines the concrete event type.

fanotify_path_event, fanotify_fid_event and fanotify_perm_event are
allocated from separate memcache pools.

Rename fanotify_perm_event casting macro to FANOTIFY_PERM(), so that
FANOTIFY_PE() and FANOTIFY_FE() can be used as casting macros to
fanotify_path_event and fanotify_fid_event.

[JK: Cleanup FANOTIFY_PE() and FANOTIFY_FE() to be proper inline
functions and remove requirement that fanotify_event is the first in
event structures]

Link: https://lore.kernel.org/r/20200319151022.31456-11-amir73il@gmail.com
Suggested-by: Jan Kara <jack@suse.cz>
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
fs/notify/fanotify/fanotify_user.c