函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:fanotify_handle_event

函数原型:static int fanotify_handle_event(struct fsnotify_group *group, struct inode *inode, unsigned int mask, const void *data, int data_type, const struct qstr *file_name, unsigned int cookie, struct fsnotify_iter_info *iter_info)

返回类型:int

参数:

类型参数名称
struct fsnotify_group *group
struct inode *inode
unsigned intmask
const void *data
intdata_type
const struct qstr *file_name
unsigned intcookie
struct fsnotify_iter_info *iter_info
380  ret等于0
383  __kernel_fsid_t fsid = {}
385  BUILD_BUG_ON - break compile if a condition is true(File was accessed != File was accessed )
386  BUILD_BUG_ON - break compile if a condition is true(File was modified != File was modified )
387  BUILD_BUG_ON - break compile if a condition is true(Metadata changed != Metadata changed )
388  BUILD_BUG_ON - break compile if a condition is true(Unwrittable file closed != Unwrittable file closed )
389  BUILD_BUG_ON - break compile if a condition is true(Writtable file closed != Writtable file was closed )
390  BUILD_BUG_ON - break compile if a condition is true(File was opened != File was opened )
391  BUILD_BUG_ON - break compile if a condition is true(File was moved to Y != File was moved to Y )
392  BUILD_BUG_ON - break compile if a condition is true(File was moved from X != File was moved from X )
393  BUILD_BUG_ON - break compile if a condition is true(Subfile was created != Subfile was created )
394  BUILD_BUG_ON - break compile if a condition is true(Subfile was deleted != Subfile was deleted )
395  BUILD_BUG_ON - break compile if a condition is true(Self was deleted != Self was deleted )
396  BUILD_BUG_ON - break compile if a condition is true(Self was moved != Self was moved )
397  BUILD_BUG_ON - break compile if a condition is true(rested in child events != This inode cares about things that happen to its children. Always set for* dnotify and inotify. )
398  BUILD_BUG_ON - break compile if a condition is true(Event queued overflowed != Event queued overflowed )
399  BUILD_BUG_ON - break compile if a condition is true(File open in perm check != pen event in an permission hook )
400  BUILD_BUG_ON - break compile if a condition is true(File accessed in perm check != access event in a permissions hook )
401  BUILD_BUG_ON - break compile if a condition is true(vent occurred against dir != vent occurred against dir )
402  BUILD_BUG_ON - break compile if a condition is true(File was opened for exec != File was opened for exec )
403  BUILD_BUG_ON - break compile if a condition is true(File open/exec in perm check != pen/exec event in a permission hook )
405  BUILD_BUG_ON - break compile if a condition is true(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 19)
407  mask等于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
409  如果非mask则返回:0
412  pr_debug("%s: group=%p inode=%p mask=%x\n", __func__, group, inode, mask)
415  如果fanotify_is_perm_event(mask)则
420  如果非fsnotify_prepare_user_wait(iter_info)则返回:0
424  如果FAN_GROUP_FLAG(group, Report unique file id )则
425  fsid等于Get cached fsid of the filesystem containing the object from any connector.* All connectors are supposed to have the same fsid, but we do not verify that* here.
427  如果非val[0]且非val[1]则返回:0
431  event等于fanotify_alloc_event(group, inode, mask, data, data_type, & fsid)
433  ret等于负ENOMEM
434  如果此条件成立可能性小(为编译器优化)(!event)则
439  如果非fanotify_is_perm_event(mask)则fsnotify_queue_overflow(group)
441  转到:finish
444  fsn_event等于fse
445  ret等于Add an event to the group notification queue
446  如果ret
448  BUG_ON(ret == 1 && mask & Events that require a permission response from user )
450  fsnotify_destroy_event(group, fsn_event)
452  ret等于0
453  否则如果fanotify_is_perm_event(mask)则
454  ret等于Wait for response to permission event
457  finish :
458  如果fanotify_is_perm_event(mask)则fsnotify_finish_user_wait(iter_info)
461  返回:ret