#include <linux/fanotify.h>
#include <linux/fdtable.h>
#include <linux/fsnotify_backend.h>
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/mount.h>
#include <linux/sched.h>
#include <linux/sched/user.h>
#include <linux/sched/signal.h>
#include <linux/types.h>
#include <linux/wait.h>
#include <linux/audit.h>
#include <linux/sched/mm.h>
#include <linux/statfs.h>
#include <linux/stringhash.h>
#include "fanotify.h"
static bool fanotify_path_equal(const struct path *p1, const struct path *p2)
{ … }
static unsigned int fanotify_hash_path(const struct path *path)
{ … }
static unsigned int fanotify_hash_fsid(__kernel_fsid_t *fsid)
{ … }
static bool fanotify_fh_equal(struct fanotify_fh *fh1,
struct fanotify_fh *fh2)
{ … }
static unsigned int fanotify_hash_fh(struct fanotify_fh *fh)
{ … }
static bool fanotify_fid_event_equal(struct fanotify_fid_event *ffe1,
struct fanotify_fid_event *ffe2)
{ … }
static bool fanotify_info_equal(struct fanotify_info *info1,
struct fanotify_info *info2)
{ … }
static bool fanotify_name_event_equal(struct fanotify_name_event *fne1,
struct fanotify_name_event *fne2)
{ … }
static bool fanotify_error_event_equal(struct fanotify_error_event *fee1,
struct fanotify_error_event *fee2)
{ … }
static bool fanotify_should_merge(struct fanotify_event *old,
struct fanotify_event *new)
{ … }
#define FANOTIFY_MAX_MERGE_EVENTS …
static int fanotify_merge(struct fsnotify_group *group,
struct fsnotify_event *event)
{ … }
static int fanotify_get_response(struct fsnotify_group *group,
struct fanotify_perm_event *event,
struct fsnotify_iter_info *iter_info)
{ … }
static u32 fanotify_group_event_mask(struct fsnotify_group *group,
struct fsnotify_iter_info *iter_info,
u32 *match_mask, u32 event_mask,
const void *data, int data_type,
struct inode *dir)
{ … }
static int fanotify_encode_fh_len(struct inode *inode)
{ … }
static int fanotify_encode_fh(struct fanotify_fh *fh, struct inode *inode,
unsigned int fh_len, unsigned int *hash,
gfp_t gfp)
{ … }
static inline bool fanotify_report_child_fid(unsigned int fid_mode, u32 mask)
{ … }
static struct inode *fanotify_fid_inode(u32 event_mask, const void *data,
int data_type, struct inode *dir,
unsigned int fid_mode)
{ … }
static struct inode *fanotify_dfid_inode(u32 event_mask, const void *data,
int data_type, struct inode *dir)
{ … }
static struct fanotify_event *fanotify_alloc_path_event(const struct path *path,
unsigned int *hash,
gfp_t gfp)
{ … }
static struct fanotify_event *fanotify_alloc_perm_event(const struct path *path,
gfp_t gfp)
{ … }
static struct fanotify_event *fanotify_alloc_fid_event(struct inode *id,
__kernel_fsid_t *fsid,
unsigned int *hash,
gfp_t gfp)
{ … }
static struct fanotify_event *fanotify_alloc_name_event(struct inode *dir,
__kernel_fsid_t *fsid,
const struct qstr *name,
struct inode *child,
struct dentry *moved,
unsigned int *hash,
gfp_t gfp)
{ … }
static struct fanotify_event *fanotify_alloc_error_event(
struct fsnotify_group *group,
__kernel_fsid_t *fsid,
const void *data, int data_type,
unsigned int *hash)
{ … }
static struct fanotify_event *fanotify_alloc_event(
struct fsnotify_group *group,
u32 mask, const void *data, int data_type,
struct inode *dir, const struct qstr *file_name,
__kernel_fsid_t *fsid, u32 match_mask)
{ … }
static __kernel_fsid_t fanotify_get_fsid(struct fsnotify_iter_info *iter_info)
{ … }
static void fanotify_insert_event(struct fsnotify_group *group,
struct fsnotify_event *fsn_event)
{ … }
static int fanotify_handle_event(struct fsnotify_group *group, u32 mask,
const void *data, int data_type,
struct inode *dir,
const struct qstr *file_name, u32 cookie,
struct fsnotify_iter_info *iter_info)
{ … }
static void fanotify_free_group_priv(struct fsnotify_group *group)
{ … }
static void fanotify_free_path_event(struct fanotify_event *event)
{ … }
static void fanotify_free_perm_event(struct fanotify_event *event)
{ … }
static void fanotify_free_fid_event(struct fanotify_event *event)
{ … }
static void fanotify_free_name_event(struct fanotify_event *event)
{ … }
static void fanotify_free_error_event(struct fsnotify_group *group,
struct fanotify_event *event)
{ … }
static void fanotify_free_event(struct fsnotify_group *group,
struct fsnotify_event *fsn_event)
{ … }
static void fanotify_freeing_mark(struct fsnotify_mark *mark,
struct fsnotify_group *group)
{ … }
static void fanotify_free_mark(struct fsnotify_mark *fsn_mark)
{ … }
const struct fsnotify_ops fanotify_fsnotify_ops = …;