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:If multiple processes watch the same inode with dnotify there is only one* dnotify mark in inode->i_fsnotify_marks but we chain a dnotify_struct* onto that mark. This function either attaches the new dnotify_struct onto

Proto:static int attach_dn(struct dnotify_struct *dn, struct dnotify_mark *dn_mark, fl_owner_t id, int fd, struct file *filp, __u32 mask)

Type:int

Parameter:

TypeParameterName
struct dnotify_struct *dn
struct dnotify_mark *dn_mark
fl_owner_tid
intfd
struct file *filp
__u32mask
223  odn = dn
224  When (odn != NULL) cycle
226  If dn_owner == id && dn_filp == filp Then
227  dn_fd = fd
228  dn_mask |= mask
229  Return -EEXIST
231  odn = dn_next
234  dn_mask = mask
235  dn_fd = fd
236  dn_filp = filp
237  dn_owner = id
238  dn_next = dn
239  dn = dn
241  Return 0
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.