Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Attach an initialized mark to a given group and fs object.* These marks may be used for the fsnotify backend to determine which* event types should be delivered to which group.

Proto:int fsnotify_add_mark_locked(struct fsnotify_mark *mark, fsnotify_connp_t *connp, unsigned int type, int allow_dups, __kernel_fsid_t *fsid)

Type:int

Parameter:

TypeParameterName
struct fsnotify_mark *mark
fsnotify_connp_t *connp
unsigned inttype
intallow_dups
__kernel_fsid_t *fsid
640  group = Group this mark is for. Set on mark creation, stable until last ref * is dropped
641  ret = 0
643  BUG_ON(!mutex_is_locked( & protect marks_list ))
651  spin_lock( & Protects inode / mnt pointers, flags, masks )
652  flags [mark->lock] |= FSNOTIFY_MARK_FLAG_ALIVE | FSNOTIFY_MARK_FLAG_ATTACHED
654  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
655  atomic_inc( & 1 for each mark and 1 for not being * past the point of no return when freeing * a group )
656  fsnotify_get_mark(mark)
657  spin_unlock( & Protects inode / mnt pointers, flags, masks )
659  ret = Add mark into proper place in given list of marks. These marks may be used* for the fsnotify backend to determine which event types should be delivered* to which group and for which inodes. These marks are ordered according to
660  If ret Then Go to err
663  If Mask this mark is for [mark->lock, group->mark_mutex] 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.
666  Return ret
667  err :
668  spin_lock( & Protects inode / mnt pointers, flags, masks )
669  flags [mark->lock] &= ~(FSNOTIFY_MARK_FLAG_ALIVE | FSNOTIFY_MARK_FLAG_ATTACHED)
671  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
672  spin_unlock( & Protects inode / mnt pointers, flags, masks )
673  atomic_dec( & 1 for each mark and 1 for not being * past the point of no return when freeing * a group )
675  fsnotify_put_mark(mark)
676  Return ret
Caller
NameDescribe
fsnotify_add_mark
fanotify_add_new_mark