Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:void dnotify_flush(struct file *filp, fl_owner_t id)

Type:void

Parameter:

TypeParameterName
struct file *filp
fl_owner_tid
148  bool free = false
150  inode = file_inode(filp)
151  If Not S_ISDIR(i_mode) Then Return
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  If Not fsn_mark Then Return
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  spin_lock( & Protects inode / mnt pointers, flags, masks )
162  prev = dn
163  When ((dn = * prev) != NULL) cycle
164  If dn_owner == id && dn_filp == filp Then
165  prev = dn_next
168  Break
170  prev = dn_next
173  spin_unlock( & Protects inode / mnt pointers, flags, masks )
177  If (dn == NULL) Then
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  If free Then Free fsnotify mark
186  fsnotify_put_mark(fsn_mark)
Caller
NameDescribe
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.