函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\notify\fanotify\fanotify_user.c Create Date:2022-07-29 10:50:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:do_fanotify_mark

函数原型:static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask, int dfd, const char __user *pathname)

返回类型:int

参数:

类型参数名称
intfanotify_fd
unsigned intflags
__u64mask
intdfd
const char __user *pathname
950  struct inode * inode = NULL
951  struct vfsmount * mnt = NULL
955  __kernel_fsid_t __fsid, * fsid = NULL
956  valid_mask等于Events that user can request to be notified on 按位或Extra flags that may be reported with event or control handling of events
957  mark_type等于flags按位与FANOTIFY_MARK_TYPE_BITS
961  pr_debug("%s: fanotify_fd=%d flags=%x dfd=%d pathname=%p mask=%llx\n", __func__, fanotify_fd, flags, dfd, pathname, mask)
965  如果mask按位与0xffffffff左移32位则返回:负EINVAL
968  如果flags按位与FANOTIFY_MARK_FLAGS的反则返回:负EINVAL
972  :mark_type恒等于These are NOT bitwise flags. Both bits can be used togther.
973  obj_type等于FSNOTIFY_OBJ_TYPE_INODE
974  退出
975  :mark_type恒等于FAN_MARK_MOUNT
976  obj_type等于FSNOTIFY_OBJ_TYPE_VFSMOUNT
977  退出
978  :mark_type恒等于FAN_MARK_FILESYSTEM
979  obj_type等于FSNOTIFY_OBJ_TYPE_SB
980  退出
981  默认
982  返回:负EINVAL
986  : & == lags used for fanotify_modify_mark()
987  : & == FAN_MARK_REMOVE
988  如果非mask则返回:负EINVAL
990  退出
991  : & == FAN_MARK_FLUSH
992  如果flags按位与FANOTIFY_MARK_TYPE_BITS按位或FAN_MARK_FLUSH的值的反则返回:负EINVAL
994  退出
995  默认
996  返回:负EINVAL
999  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_FANOTIFY_ACCESS_PERMISSIONS)则valid_mask或等于Events that require a permission response from user
1002  如果mask按位与valid_mask的反则返回:负EINVAL
1005  f等于fdget(fanotify_fd)
1006  如果此条件成立可能性小(为编译器优化)(!file)则返回:负EBADF
1010  ret等于负EINVAL
1011  如果此条件成立可能性小(为编译器优化)(f_op != & fanotify_fops)则转到:fput_and_out
1013  group等于 needed for tty driver, and maybe others
1019  ret等于负EINVAL
1020  如果mask按位与Events that require a permission response from user priority恒等于rmal notifiers, no permissions 则转到:fput_and_out
1031  如果mask按位与Events that can only be reported with data type FSNOTIFY_EVENT_INODE 且非FAN_GROUP_FLAG(group, Report unique file id )或mark_type恒等于FAN_MARK_MOUNT的值则转到:fput_and_out
1036  如果flags按位与FAN_MARK_FLUSH
1037  ret等于0
1044  转到:fput_and_out
1047  ret等于fanotify_find_path(dfd, pathname, & path, flags, (mask & Events that can be reported to backends ), obj_type)
1049  如果ret则转到:fput_and_out
1054  如果ret则转到:path_put_and_out
1060  如果ret则转到:path_put_and_out
1063  fsid等于__fsid
1067  如果mark_type恒等于These are NOT bitwise flags. Both bits can be used togther. inode等于 Where the name belongs to - NULL is * negative
1069  否则mnt等于mnt
1084  退出
1085  : & == FAN_MARK_REMOVE
1095  退出
1096  默认
1097  ret等于负EINVAL
1100  path_put_and_out :
1101  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
1102  fput_and_out :
1103  fdput(f)
1104  返回:ret
调用者
名称描述
SYSCALL_DEFINE5
COMPAT_SYSCALL_DEFINE6