Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:inotify_update_existing_watch

Proto:static int inotify_update_existing_watch(struct fsnotify_group *group, struct inode *inode, unsigned int arg)

Type:int

Parameter:

TypeParameterName
struct fsnotify_group *group
struct inode *inode
unsigned intarg
511  add = arg & add to the mask of an already existing watch
512  create = arg & ly create watches
515  mask = inotify_arg_to_mask(arg)
517  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.
518  If Not fsn_mark Then Return -ENOENT
520  Else if create Then
521  ret = -EEXIST
522  Go to out
525  i_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, structinotify_inode_mark, fsn_mark)
527  spin_lock( & Protects inode / mnt pointers, flags, masks )
528  old_mask = Mask this mark is for [mark->lock, group->mark_mutex]
529  If add Then Mask this mark is for [mark->lock, group->mark_mutex] |= mask
531  Else Mask this mark is for [mark->lock, group->mark_mutex] = mask
533  new_mask = Mask this mark is for [mark->lock, group->mark_mutex]
534  spin_unlock( & Protects inode / mnt pointers, flags, masks )
536  If old_mask != new_mask Then
538  dropped = old_mask & ~new_mask
540  do_inode = new_mask & ~i_fsnotify_mask
543  If dropped || do_inode Then 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.
549  ret = wd
551  out :
553  fsnotify_put_mark(fsn_mark)
555  Return ret
Caller
NameDescribe
inotify_update_watch