函数逻辑报告 |
Source Code:fs\notify\dnotify\dnotify.c |
Create Date:2022-07-29 10:48:47 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:When 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.
函数原型:int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| int | fd | |
| struct file * | filp | |
| unsigned long | arg |
| 261 | new_fsn_mark = NULL |
| 262 | dn = NULL |
| 264 | 如果非dir_notify_enable则 |
| 270 | 如果arg按位与Don't remove notifier 的反的值恒等于0则 |
| 277 | inode等于file_inode(filp) |
| 289 | error等于security_path_notify( & f_path, mask, FSNOTIFY_OBJ_TYPE_INODE) |
| 296 | 如果非dn则 |
| 302 | new_dn_mark等于分配高速缓存区 |
| 303 | 如果非new_dn_mark则 |
| 309 | new_fsn_mark等于fsn_mark |
| 312 | dn = NULL |
| 315 | mutex_lock( & protect marks_list ) |
| 318 | 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. |
| 319 | 如果fsn_mark则 |
| 321 | 加自旋锁 |
| 322 | 否则 |
| 323 | error等于fsnotify_add_inode_mark_locked(new_fsn_mark, inode, 0) |
| 324 | 如果error则 |
| 326 | 转到:out_err |
| 328 | 加自旋锁 |
| 329 | fsn_mark等于new_fsn_mark |
| 330 | dn_mark等于new_dn_mark |
| 332 | new_fsn_mark = NULL |
| 357 | __f_setown(filp, task_pid(当前进程), PIDTYPE_TGID, 0) |
| 369 | out : |
| 370 | 自旋锁解锁 |
| 375 | 如果destroy则Free fsnotify mark |
| 378 | out_err : |
| 381 | 如果dn则kmem_cache_free(dnotify_struct_cache, dn) |
| 383 | 返回:error |
| 名称 | 描述 |
|---|---|
| do_fcntl |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |