linux/fs/notify/fanotify/fanotify.h

/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/fsnotify_backend.h>
#include <linux/path.h>
#include <linux/slab.h>
#include <linux/exportfs.h>
#include <linux/hashtable.h>

extern struct kmem_cache *fanotify_mark_cache;
extern struct kmem_cache *fanotify_fid_event_cachep;
extern struct kmem_cache *fanotify_path_event_cachep;
extern struct kmem_cache *fanotify_perm_event_cachep;

/* Possible states of the permission event */
enum {};

/*
 * 3 dwords are sufficient for most local fs (64bit ino, 32bit generation).
 * fh buf should be dword aligned. On 64bit arch, the ext_buf pointer is
 * stored in either the first or last 2 dwords.
 */
#define FANOTIFY_INLINE_FH_LEN
#define FANOTIFY_FH_HDR_LEN

/* Fixed size struct for file handle */
struct fanotify_fh {} __aligned();

/* Variable size struct for dir file handle + child file handle + name */
struct fanotify_info {} __aligned();

static inline bool fanotify_fh_has_ext_buf(struct fanotify_fh *fh)
{}

static inline char **fanotify_fh_ext_buf_ptr(struct fanotify_fh *fh)
{}

static inline void *fanotify_fh_ext_buf(struct fanotify_fh *fh)
{}

static inline void *fanotify_fh_buf(struct fanotify_fh *fh)
{}

static inline int fanotify_info_dir_fh_len(struct fanotify_info *info)
{}

static inline struct fanotify_fh *fanotify_info_dir_fh(struct fanotify_info *info)
{}

static inline int fanotify_info_dir2_fh_len(struct fanotify_info *info)
{}

static inline struct fanotify_fh *fanotify_info_dir2_fh(struct fanotify_info *info)
{}

static inline int fanotify_info_file_fh_len(struct fanotify_info *info)
{}

static inline struct fanotify_fh *fanotify_info_file_fh(struct fanotify_info *info)
{}

static inline char *fanotify_info_name(struct fanotify_info *info)
{}

static inline char *fanotify_info_name2(struct fanotify_info *info)
{}

static inline void fanotify_info_init(struct fanotify_info *info)
{}

/* These set/copy helpers MUST be called by order */
static inline void fanotify_info_set_dir_fh(struct fanotify_info *info,
					    unsigned int totlen)
{}

static inline void fanotify_info_set_dir2_fh(struct fanotify_info *info,
					     unsigned int totlen)
{}

static inline void fanotify_info_set_file_fh(struct fanotify_info *info,
					     unsigned int totlen)
{}

static inline void fanotify_info_copy_name(struct fanotify_info *info,
					   const struct qstr *name)
{}

static inline void fanotify_info_copy_name2(struct fanotify_info *info,
					    const struct qstr *name)
{}

/*
 * Common structure for fanotify events. Concrete structs are allocated in
 * fanotify_handle_event() and freed when the information is retrieved by
 * userspace. The type of event determines how it was allocated, how it will
 * be freed and which concrete struct it may be cast to.
 */
enum fanotify_event_type {};

#define FANOTIFY_EVENT_TYPE_BITS
#define FANOTIFY_EVENT_HASH_BITS

struct fanotify_event {};

static inline void fanotify_init_event(struct fanotify_event *event,
				       unsigned int hash, u32 mask)
{}

#define FANOTIFY_INLINE_FH(name, size)

struct fanotify_fid_event {};

static inline struct fanotify_fid_event *
FANOTIFY_FE(struct fanotify_event *event)
{}

struct fanotify_name_event {};

static inline struct fanotify_name_event *
FANOTIFY_NE(struct fanotify_event *event)
{}

struct fanotify_error_event {};

static inline struct fanotify_error_event *
FANOTIFY_EE(struct fanotify_event *event)
{}

static inline __kernel_fsid_t *fanotify_event_fsid(struct fanotify_event *event)
{}

static inline struct fanotify_fh *fanotify_event_object_fh(
						struct fanotify_event *event)
{}

static inline struct fanotify_info *fanotify_event_info(
						struct fanotify_event *event)
{}

static inline int fanotify_event_object_fh_len(struct fanotify_event *event)
{}

static inline int fanotify_event_dir_fh_len(struct fanotify_event *event)
{}

static inline int fanotify_event_dir2_fh_len(struct fanotify_event *event)
{}

static inline bool fanotify_event_has_object_fh(struct fanotify_event *event)
{}

static inline bool fanotify_event_has_dir_fh(struct fanotify_event *event)
{}

static inline bool fanotify_event_has_dir2_fh(struct fanotify_event *event)
{}

static inline bool fanotify_event_has_any_dir_fh(struct fanotify_event *event)
{}

struct fanotify_path_event {};

static inline struct fanotify_path_event *
FANOTIFY_PE(struct fanotify_event *event)
{}

/*
 * Structure for permission fanotify events. It gets allocated and freed in
 * fanotify_handle_event() since we wait there for user response. When the
 * information is retrieved by userspace the structure is moved from
 * group->notification_list to group->fanotify_data.access_list to wait for
 * user response.
 */
struct fanotify_perm_event {};

static inline struct fanotify_perm_event *
FANOTIFY_PERM(struct fanotify_event *event)
{}

static inline bool fanotify_is_perm_event(u32 mask)
{}

static inline struct fanotify_event *FANOTIFY_E(struct fsnotify_event *fse)
{}

static inline bool fanotify_is_error_event(u32 mask)
{}

static inline const struct path *fanotify_event_path(struct fanotify_event *event)
{}

/*
 * Use 128 size hash table to speed up events merge.
 */
#define FANOTIFY_HTABLE_BITS
#define FANOTIFY_HTABLE_SIZE
#define FANOTIFY_HTABLE_MASK

/*
 * Permission events and overflow event do not get merged - don't hash them.
 */
static inline bool fanotify_is_hashed_event(u32 mask)
{}

static inline unsigned int fanotify_event_hash_bucket(
						struct fsnotify_group *group,
						struct fanotify_event *event)
{}

struct fanotify_mark {};

static inline struct fanotify_mark *FANOTIFY_MARK(struct fsnotify_mark *mark)
{}

static inline bool fanotify_fsid_equal(__kernel_fsid_t *fsid1,
				       __kernel_fsid_t *fsid2)
{}

static inline unsigned int fanotify_mark_user_flags(struct fsnotify_mark *mark)
{}