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

Name:fanotify_handle_event

Proto: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)

Type:int

Parameter:

TypeParameterName
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  If Not mask Then Return 0
412  pr_debug("%s: group=%p inode=%p mask=%x\n", __func__, group, inode, mask)
415  If fanotify_is_perm_event(mask) Then
420  If Not fsnotify_prepare_user_wait(iter_info) Then Return 0
424  If FAN_GROUP_FLAG(group, Report unique file id ) Then
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  If Not val[0] && Not val[1] Then Return 0
431  event = fanotify_alloc_event(group, inode, mask, data, data_type, & fsid)
433  ret = -ENOMEM
434  If Value for the false possibility is greater at compile time(!event) Then
439  If Not fanotify_is_perm_event(mask) Then fsnotify_queue_overflow(group)
441  Go to finish
444  fsn_event = fse
445  ret = Add an event to the group notification queue
446  If ret Then
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  Else if fanotify_is_perm_event(mask) Then
454  ret = Wait for response to permission event
457  finish :
458  If fanotify_is_perm_event(mask) Then fsnotify_finish_user_wait(iter_info)
461  Return ret