函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

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

返回类型:int

参数:

类型参数名称
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  如果data_is恒等于FSNOTIFY_EVENT_PATH
329  mnt等于real_mount(mnt)
330  mnt_or_sb_mask或等于mnt_fsnotify_mask
333  如果mask按位与This inode cares about things that happen to its children. Always set for* dnotify and inotify. mnt_or_sb_mask等于0
343  如果非i_fsnotify_marks且非s_fsnotify_marks且非mnt或非mnt_fsnotify_marks的值则返回:0
351  如果非mask按位与File was modified 的值且非test_mask按位与i_fsnotify_mask按位或mnt_or_sb_mask的值的值则返回: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  如果mnt
362  marks[FSNOTIFY_OBJ_TYPE_VFSMOUNT]等于fsnotify_first_mark( & mnt_fsnotify_marks)
371 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.循环
372  ret等于send_to_group(to_tell, mask, data, data_is, cookie, file_name, & iter_info)
375  如果retmask按位与ALL_FSNOTIFY_PERM_EVENTS则转到: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  注销过期读锁
384  返回:ret
调用者
名称描述
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.