Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This is the main call to fsnotify. The VFS calls into hook specific functions* in linux/fsnotify.h. Those functions then in turn call here. Here will call* out to all of the registered fsnotify_group. Those groups can then use the

Proto:int fsnotify(struct inode *to_tell, __u32 mask, const void *data, int data_is, const struct qstr *file_name, unsigned int cookie)

Type:int

Parameter:

TypeParameterName
struct inode *to_tell
__u32mask
const void *data
intdata_is
const struct qstr *file_name
unsigned intcookie
321  struct fsnotify_iter_info iter_info = {}
322  sb = i_sb
323  struct mount * mnt = NULL
324  mnt_or_sb_mask = s_fsnotify_mask
325  ret = 0
326  test_mask = mask & Events that can be reported to backends
328  If data_is == FSNOTIFY_EVENT_PATH Then
329  mnt = real_mount(mnt)
330  mnt_or_sb_mask |= mnt_fsnotify_mask
333  If mask & This inode cares about things that happen to its children. Always set for* dnotify and inotify. Then mnt_or_sb_mask = 0
343  If Not i_fsnotify_marks && Not s_fsnotify_marks && ( Not mnt || Not mnt_fsnotify_marks ) Then Return 0
351  If Not (mask & File was modified ) && Not (test_mask & (i_fsnotify_mask | mnt_or_sb_mask)) Then Return 0
355  srcu_idx = srcu_read_lock - register a new reader for an SRCU-protected structure
357  marks[FSNOTIFY_OBJ_TYPE_INODE] = fsnotify_first_mark( & i_fsnotify_marks)
359  marks[FSNOTIFY_OBJ_TYPE_SB] = fsnotify_first_mark( & s_fsnotify_marks)
361  If mnt Then
362  marks[FSNOTIFY_OBJ_TYPE_VFSMOUNT] = fsnotify_first_mark( & mnt_fsnotify_marks)
371  When r_info is a multi head priority queue of marks.* Pick a subset of marks from queue heads, all with the* same group and set the report_mask for selected subset.* Returns the report_mask of the selected subset. cycle
372  ret = send_to_group(to_tell, mask, data, data_is, cookie, file_name, & iter_info)
375  If ret && mask & ALL_FSNOTIFY_PERM_EVENTS Then Go to out
378  Pop from iter_info multi head queue, the marks that were iterated in the* current iteration step.
380  ret = 0
381  out :
382  srcu_read_unlock - unregister a old reader from an SRCU-protected structure.*@ssp: srcu_struct in which to unregister the old reader.*@idx: return value from corresponding srcu_read_lock().* Exit an SRCU read-side critical section.
384  Return ret
Caller
NameDescribe
fsnotify_unmount_inodessnotify_unmount_inodes - an sb is unmounting. handle any watched inodes.*@sb: superblock being unmounted.* Called during unmount with no locks held, so needs to be safe against* concurrent modifiers. We temporarily drop sb->s_inode_list_lock and CAN block.
__fsnotify_parentNotify this dentry's parent about a child's events.