Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\notify\fanotify\fanotify_user.c Create Date:2022-07-28 20:18:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:do_fanotify_mark

Proto:static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask, int dfd, const char __user *pathname)

Type:int

Parameter:

TypeParameterName
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  If mask & 0xffffffff << 32 Then Return -EINVAL
968  If flags & ~FANOTIFY_MARK_FLAGS Then Return -EINVAL
972  Case mark_type == These are NOT bitwise flags. Both bits can be used togther.
973  obj_type = FSNOTIFY_OBJ_TYPE_INODE
974  Break
975  Case mark_type == FAN_MARK_MOUNT
976  obj_type = FSNOTIFY_OBJ_TYPE_VFSMOUNT
977  Break
978  Case mark_type == FAN_MARK_FILESYSTEM
979  obj_type = FSNOTIFY_OBJ_TYPE_SB
980  Break
981  Default
982  Return -EINVAL
986  Case & == lags used for fanotify_modify_mark()
987  Case & == FAN_MARK_REMOVE
988  If Not mask Then Return -EINVAL
990  Break
991  Case & == FAN_MARK_FLUSH
992  If flags & ~(FANOTIFY_MARK_TYPE_BITS | FAN_MARK_FLUSH) Then Return -EINVAL
994  Break
995  Default
996  Return -EINVAL
999  If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_FANOTIFY_ACCESS_PERMISSIONS) Then valid_mask |= Events that require a permission response from user
1002  If mask & ~valid_mask Then Return -EINVAL
1005  f = fdget(fanotify_fd)
1006  If Value for the false possibility is greater at compile time(!file) Then Return -EBADF
1010  ret = -EINVAL
1011  If Value for the false possibility is greater at compile time(f_op != & fanotify_fops) Then Go to fput_and_out
1013  group = needed for tty driver, and maybe others
1019  ret = -EINVAL
1020  If mask & Events that require a permission response from user && priority == rmal notifiers, no permissions Then Go to fput_and_out
1031  If mask & Events that can only be reported with data type FSNOTIFY_EVENT_INODE && ( Not FAN_GROUP_FLAG(group, Report unique file id ) || mark_type == FAN_MARK_MOUNT ) Then Go to fput_and_out
1036  If flags & FAN_MARK_FLUSH Then
1037  ret = 0
1044  Go to fput_and_out
1047  ret = fanotify_find_path(dfd, pathname, & path, flags, (mask & Events that can be reported to backends ), obj_type)
1049  If ret Then Go to fput_and_out
1054  If ret Then Go to path_put_and_out
1060  If ret Then Go to path_put_and_out
1063  fsid = __fsid
1067  If mark_type == These are NOT bitwise flags. Both bits can be used togther. Then inode = Where the name belongs to - NULL is * negative
1069  Else mnt = mnt
1084  Break
1085  Case & == FAN_MARK_REMOVE
1095  Break
1096  Default
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  Return ret
Caller
NameDescribe
SYSCALL_DEFINE5
COMPAT_SYSCALL_DEFINE6