函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:When a process starts or stops watching an inode the set of events which* dnotify cares about for that inode may change. This function runs the* list of everything receiving dnotify events about this directory and calculates* the set of all those events

函数原型:static void dnotify_recalc_inode_mask(struct fsnotify_mark *fsn_mark)

返回类型:void

参数:

类型参数名称
struct fsnotify_mark *fsn_mark
48  new_mask等于0
50  dn_mark等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(fsn_mark, structdnotify_mark, fsn_mark)
54  assert_spin_locked( & Protects inode / mnt pointers, flags, masks )
56 dn != NULL循环new_mask或等于dn_mask按位与dnotify multishot 的反
58  如果 Mask this mark is for [mark->lock, group->mark_mutex] 恒等于new_mask则返回
60  Mask this mark is for [mark->lock, group->mark_mutex] 等于new_mask
62  Calculate mask of events for a list of marks. The caller must make sure* connector and connector->obj cannot disappear under us. Callers achieve* this by holding a mark->lock or mark->group->mark_mutex for a mark on this* list.
调用者
名称描述
dnotify_handle_eventMains fsnotify call where events are delivered to dnotify.* Find the dnotify mark on the relevant inode, run the list of dnotify structs* on that mark and determine which of them has expressed interest in receiving* events of this type
dnotify_flushCalled every time a file is closed. Looks first for a dnotify mark on the* inode. If one is found run all of the ->dn structures attached to that* mark for one relevant to this process closing the file and remove that* dnotify_struct
fcntl_dirnotifyWhen a process calls fcntl to attach a dnotify watch to a directory it ends* up here. Allocate both a mark for fsnotify to add and a dnotify_struct to be* attached to the fsnotify_mark.