Function report | 
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 activity | Download SCCT | Chinese | 
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:
| Type | Parameter | Name | 
|---|---|---|
| int | fanotify_fd | |
| unsigned int | flags | |
| __u64 | mask | |
| int | dfd | |
| const char __user * | pathname | 
| 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) | 
| 968 | If flags & ~FANOTIFY_MARK_FLAGS Then Return -EINVAL | 
| 974 | Break | 
| 975 | Case mark_type == FAN_MARK_MOUNT | 
| 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 | 
| 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 | 
| 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 | 
| 1011 | If Value for the false possibility is greater at compile time(f_op != & fanotify_fops) Then Go to fput_and_out | 
| 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 | 
| 1038 | If mark_type == FAN_MARK_MOUNT Then fsnotify_clear_vfsmount_marks_by_group(group) | 
| 1040 | Else if mark_type == FAN_MARK_FILESYSTEM Then fsnotify_clear_sb_marks_by_group(group) | 
| 1042 | Else fsnotify_clear_inode_marks_by_group(group) | 
| 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 | 
| 1052 | If flags & lags used for fanotify_modify_mark() Then | 
| 1053 | ret = fanotify_events_supported( & path, mask) | 
| 1054 | If ret Then Go to path_put_and_out | 
| 1058 | If FAN_GROUP_FLAG(group, Report unique file id ) Then | 
| 1060 | If ret Then Go to path_put_and_out | 
| 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 | 
| 1074 | Case & == lags used for fanotify_modify_mark() | 
| 1075 | If mark_type == FAN_MARK_MOUNT Then ret = fanotify_add_vfsmount_mark(group, mnt, mask, flags, fsid) | 
| 1078 | Else if mark_type == FAN_MARK_FILESYSTEM Then ret = fanotify_add_sb_mark(group, pointer to superblock , mask, flags, fsid) | 
| 1084 | Break | 
| 1085 | Case & == FAN_MARK_REMOVE | 
| 1086 | If mark_type == FAN_MARK_MOUNT Then ret = fanotify_remove_vfsmount_mark(group, mnt, mask, flags) | 
| 1089 | Else if mark_type == FAN_MARK_FILESYSTEM Then ret = fanotify_remove_sb_mark(group, pointer to superblock , mask, flags) | 
| 1095 | Break | 
| 1096 | Default | 
| 1100 | path_put_and_out : | 
| 1102 | fput_and_out : | 
| 1104 | Return ret | 
| Name | Describe | 
|---|---|
| SYSCALL_DEFINE5 | |
| COMPAT_SYSCALL_DEFINE6 | 
| Source code conversion tool public plug-in interface  | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion  |