Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Add an event to the group notification queue

Proto:int fsnotify_add_event(struct fsnotify_group *group, struct fsnotify_event *event, int (*merge)(struct list_head *, struct fsnotify_event *))

Type:int

Parameter:

TypeParameterName
struct fsnotify_group *group
struct fsnotify_event *event
int (*merge
89  ret = 0
90  list = list of event_holder this group needs to send to userspace
92  pr_debug("%s: group=%p event=%p\n", __func__, group, event)
94  spin_lock( & protect the notification_list )
96  If group is being shut down, don't queue more events Then
97  spin_unlock( & protect the notification_list )
98  Return 2
101  If event == Event we queue when the * notification list is too * full || events on the queue >= maximum events allowed on the list Then
103  ret = 2
107  Return ret
109  event = Event we queue when the * notification list is too * full
110  Go to queue
113  If Not list_empty - tests whether a list is empty*@head: the list to test. && merge Then
114  ret = merge(list, event)
115  If ret Then
117  Return ret
121  queue :
122  events on the queue ++
123  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
124  spin_unlock( & protect the notification_list )
126  wake_up( & read() on the notification file blocks on this waitq )
127  kill_fasync( & async notification , SIGIO, data input available )
128  Return ret
Caller
NameDescribe
inotify_handle_event
fanotify_handle_event