Commit 2c506943 authored by Gabriel Krisman Bertazi's avatar Gabriel Krisman Bertazi Committed by Jan Kara

fanotify: Wrap object_fh inline space in a creator macro

fanotify_error_event would duplicate this sequence of declarations that
already exist elsewhere with a slight different size.  Create a helper
macro to avoid code duplication.

Link: https://lore.kernel.org/r/20211025192746.66445-23-krisman@collabora.comSuggested-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarAmir Goldstein <amir73il@gmail.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 8a6ae641
......@@ -171,12 +171,18 @@ static inline void fanotify_init_event(struct fanotify_event *event,
event->pid = NULL;
}
#define FANOTIFY_INLINE_FH(name, size) \
struct { \
struct fanotify_fh (name); \
/* Space for object_fh.buf[] - access with fanotify_fh_buf() */ \
unsigned char _inline_fh_buf[(size)]; \
}
struct fanotify_fid_event {
struct fanotify_event fae;
__kernel_fsid_t fsid;
struct fanotify_fh object_fh;
/* Reserve space in object_fh.buf[] - access with fanotify_fh_buf() */
unsigned char _inline_fh_buf[FANOTIFY_INLINE_FH_LEN];
FANOTIFY_INLINE_FH(object_fh, FANOTIFY_INLINE_FH_LEN);
};
static inline struct fanotify_fid_event *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment