Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This function returns a mask for an event that only contains the flags* that have been specifically requested by the user. Flags that may have* been included within the event mask, but have not been explicitly

Proto:static unsigned int fanotify_group_event_mask(struct fsnotify_group *group, struct fsnotify_iter_info *iter_info, unsigned int event_mask, const void *data, int data_type)

Type:unsigned int

Parameter:

TypeParameterName
struct fsnotify_group *group
struct fsnotify_iter_info *iter_info
unsigned intevent_mask
const void *data
intdata_type
152  marks_mask = 0 , marks_ignored_mask = 0
153  user_mask = Events that may be reported to user
154  path = data
158  pr_debug("%s: report_mask=%x mask=%x data=%p data_type=%d\n", __func__, report_mask, event_mask, data, data_type)
161  If Not FAN_GROUP_FLAG(group, Report unique file id ) Then
163  If data_type != FSNOTIFY_EVENT_PATH Then Return 0
166  If Not d_is_reg(dentry) && Not d_can_lookup(dentry) Then Return 0
171  If Not fsnotify_iter_should_report_type(iter_info, type) Then Continue
173  mark = marks[type]
178  If event_mask & This inode cares about things that happen to its children. Always set for* dnotify and inotify. && ( type != FSNOTIFY_OBJ_TYPE_INODE || Not ( Mask this mark is for [mark->lock, group->mark_mutex] & This inode cares about things that happen to its children. Always set for* dnotify and inotify. ) ) Then Continue
183  marks_mask |= Mask this mark is for [mark->lock, group->mark_mutex]
184  marks_ignored_mask |= Events types to ignore [mark->lock, group->mark_mutex]
187  test_mask = event_mask & marks_mask & ~marks_ignored_mask
198  If FAN_GROUP_FLAG(group, Report unique file id ) Then
200  If Not (test_mask & ~vent occurred against dir ) Then Return 0
202  Else
203  user_mask &= ~vent occurred against dir
206  If event_mask & vent occurred against dir && Not ( marks_mask & vent occurred against dir & ~marks_ignored_mask) Then Return 0
210  Return test_mask & user_mask
Caller
NameDescribe
fanotify_handle_event