函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\notify\inotify\inotify_user.c Create Date:2022-07-29 10:49:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:inotify_new_watch

函数原型:static int inotify_new_watch(struct fsnotify_group *group, struct inode *inode, unsigned int arg)

返回类型:int

参数:

类型参数名称
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等于分配高速缓存区
571  如果此条件成立可能性小(为编译器优化)(!tmp_i_mark)则返回:负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  如果ret则转到:out_err
583  如果非inc_inotify_watches(ucounts)则
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  转到:out_err
590  ret等于fsnotify_add_inode_mark_locked( & fsn_mark, inode, 0)
591  如果ret
593  Remove the mark from the idr (if present) and drop the reference* on the mark because it was in the idr.
594  转到:out_err
599  ret等于wd
601  out_err :
603  fsnotify_put_mark( & fsn_mark)
605  返回:ret
调用者
名称描述
inotify_update_watch