函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\notify\fanotify\fanotify_user.c Create Date:2022-07-29 10:50:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:static struct fsnotify_event *get_one_event(struct fsnotify_group *group, size_t count)

返回类型:struct fsnotify_event

参数:

类型参数名称
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  加自旋锁
79  如果rn true if the notify queue is empty, false otherwise 则转到:out
82  如果FAN_GROUP_FLAG(group, Report unique file id )则
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  如果event_size大于count
88  fsn_event等于错误号
89  转到: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  如果fanotify_is_perm_event(mask)则state of the event 等于FAN_EVENT_REPORTED
94  out :
95  自旋锁解锁
96  返回:fsn_event
调用者
名称描述
fanotify_read
inotify_read