函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Look up and maybe create and open the last component

函数原型:static int lookup_open(struct nameidata *nd, struct path *path, struct file *file, const struct open_flags *op, bool got_write)

返回类型:int

参数:

类型参数名称
struct nameidata *nd
struct path *path
struct file *file
const struct open_flags *op
boolgot_write
3076  dir等于dentry
3077  dir_inode等于 Where the name belongs to - NULL is * negative
3078  open_flag等于open_flag
3080  create_error等于0
3081  mode等于mode
3082  DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq)
3084  如果此条件成立可能性小(为编译器优化)(IS_DEADDIR(dir_inode))则返回:负ENOENT
3087  f_mode与等于FMODE_CREATED的反
3088  dentry等于查找目录项
3089  循环
3090  如果非dentry
3091  dentry等于d_alloc_parallel(dir, & last, & wq)
3092  如果是错误则返回:错误
3095  如果d_in_lookup(dentry)则退出
3098  error等于d_revalidate(dentry, flags)
3099  如果此条件成立可能性大(为编译器优化)(error > 0)则退出
3101  如果error则转到:out_dput
3103  废除目录项
3104  dput(dentry)
3105  dentry = NULL
3107  如果 Where the name belongs to - NULL is * negative
3109  转到:out_no_open
3121  如果open_flag按位与O_CREAT
3122  如果非IS_POSIXACL( Where the name belongs to - NULL is * negative )则mode与等于current_umask()的反
3125  create_error等于负EROFS
3126  open_flag与等于O_CREAT的反
3127  如果open_flag按位与O_EXCL按位或O_TRUNC的值则转到:no_open
3130  否则
3132  如果create_error
3133  open_flag与等于O_CREAT的反
3134  如果open_flag按位与O_EXCL则转到:no_open
3138  否则如果open_flag按位与O_TRUNC按位或O_WRONLY按位或O_RDWR的值且此条件成立可能性小(为编译器优化)(!got_write)则
3144  转到:no_open
3147  如果atomic_open
3148  error等于Attempt to atomically look up, create and open a file from a negative* dentry
3150  如果此条件成立可能性小(为编译器优化)(error == - ENOENT)且create_errorerror等于create_error
3152  返回:error
3155  no_open :
3156  如果d_in_lookup(dentry)则
3157  res等于lookup(dir_inode, dentry, flags)
3159  d_lookup_done(dentry)
3161  如果是错误
3162  error等于错误
3163  转到:out_dput
3165  dput(dentry)
3166  dentry等于res
3171  如果非 Where the name belongs to - NULL is * negative open_flag按位与O_CREAT
3172  f_mode或等于FMODE_CREATED
3173  audit_inode_child(dir_inode, dentry, a child being created )
3174  如果非create
3175  error等于负EACCES
3176  转到:out_dput
3178  error等于create(dir_inode, dentry, mode, open_flag & O_EXCL)
3180  如果error则转到:out_dput
3182  snotify_create - 'name' was linked in
3184  如果此条件成立可能性小(为编译器优化)(create_error)且非 Where the name belongs to - NULL is * negative
3185  error等于create_error
3186  转到:out_dput
3188  out_no_open :
3189  dentry等于dentry
3190  mnt等于mnt
3191  返回:0
3193  out_dput :
3194  dput(dentry)
3195  返回:error
调用者
名称描述
do_lastHandle the last step of open()