函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:void dnotify_flush(struct file *filp, fl_owner_t id)

返回类型:void

参数:

类型参数名称
struct file *filp
fl_owner_tid
148  bool free = false
150  inode等于file_inode(filp)
151  如果非S_ISDIR(i_mode)则返回
154  fsn_mark等于Given a list of marks, find the mark associated with given group. If found* take a reference to that mark and return it, else return NULL.
155  如果非fsn_mark则返回
157  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)
159  mutex_lock( & protect marks_list )
161  加自旋锁
162  prev等于dn
163  当((dn = * prev) != NULL)循环
164  如果dn_owner恒等于iddn_filp恒等于filp
165  prev等于dn_next
168  退出
170  prev等于dn_next
173  自旋锁解锁
177  如果(dn == NULL)则
178  Mark mark as detached, remove it from group list
179  free = true
182  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
184  如果freeFree fsnotify mark
186  fsnotify_put_mark(fsn_mark)
调用者
名称描述
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.