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:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Get an fsnotify notification event if one exists and is small* enough to fit in "count". Return an error pointer if the count* is not large enough. When permission event is dequeued, its state is* updated accordingly.

Proto:static struct fsnotify_event *get_one_event(struct fsnotify_group *group, size_t count)

Type:struct fsnotify_event

Parameter:

TypeParameterName
struct fsnotify_group *group
size_tcount
73  event_size = Helper functions to deal with fanotify_event_metadata buffers
74  struct fsnotify_event * fsn_event = NULL
76  pr_debug("%s: group=%p count=%zd\n", __func__, group, count)
78  spin_lock( & protect the notification_list )
79  If rn true if the notify queue is empty, false otherwise Then Go to out
82  If FAN_GROUP_FLAG(group, Report unique file id ) Then
83  event_size += fanotify_event_info_len(FANOTIFY_E(This will not remove the event, that must be done with* fsnotify_remove_first_event()))
87  If event_size > count Then
88  fsn_event = ERR_PTR( - EINVAL)
89  Go to out
91  fsn_event = Remove and return the first event from the notification list. It is the* responsibility of the caller to destroy the obtained event
92  If fanotify_is_perm_event(mask) Then state of the event = FAN_EVENT_REPORTED
94  out :
95  spin_unlock( & protect the notification_list )
96  Return fsn_event
Caller
NameDescribe
fanotify_read
inotify_read