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_new_watch

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

Type:int

Parameter:

TypeParameterName
struct fsnotify_group *group
struct inode *inode
unsigned intarg
565  idr = idr
566  idr_lock = idr_lock
568  mask = inotify_arg_to_mask(arg)
570  tmp_i_mark = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL)
571  If Value for the false possibility is greater at compile time(!tmp_i_mark) Then Return -ENOMEM
574  Nothing fancy, just initialize lists and locks and counters.
575  Mask this mark is for [mark->lock, group->mark_mutex] = mask
576  wd = -1
578  ret = inotify_add_to_idr(idr, idr_lock, tmp_i_mark)
579  If ret Then Go to out_err
583  If Not inc_inotify_watches(ucounts) Then
584  Remove the mark from the idr (if present) and drop the reference* on the mark because it was in the idr.
585  ret = -ENOSPC
586  Go to out_err
590  ret = fsnotify_add_inode_mark_locked( & fsn_mark, inode, 0)
591  If ret Then
593  Remove the mark from the idr (if present) and drop the reference* on the mark because it was in the idr.
594  Go to out_err
599  ret = wd
601  out_err :
603  fsnotify_put_mark( & fsn_mark)
605  Return ret
Caller
NameDescribe
inotify_update_watch