函数逻辑报告 |
Source Code:fs\namei.c |
Create Date:2022-07-29 10:35:05 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Handle the last step of open()
函数原型:static int do_last(struct nameidata *nd, struct file *file, const struct open_flags *op)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct nameidata * | nd | |
struct file * | file | |
const struct open_flags * | op |
3208 | will_truncate等于open_flag按位与O_TRUNC的值不等于0 |
3209 | bool got_write = false |
3216 | flags与等于rnal use only 的反 |
3227 | 如果name[len]则flags或等于llow links at the end 按位或quire a directory |
3231 | 如果此条件成立可能性大(为编译器优化)(error > 0)则转到:finish_lookup |
3238 | BUG_ON(flags & RCU pathwalk mode; semi-internal ) |
3239 | 否则 |
3250 | audit_inode(name, dir, dentry represents the parent ) |
3252 | 如果此条件成立可能性小(为编译器优化)(name[len])则返回:负EISDIR |
3257 | error等于mnt_want_write(mnt) |
3279 | 如果f_mode按位与FMODE_OPENED则 |
3280 | 如果f_mode按位与FMODE_CREATED或非S_ISREG(i_mode)则will_truncate = false |
3284 | audit_inode(name, dentry, 0) |
3285 | 转到:opened |
3288 | 如果f_mode按位与FMODE_CREATED则 |
3291 | will_truncate = false |
3292 | acc_mode等于0 |
3293 | path_to_nameidata( & path, nd) |
3294 | 转到:finish_open_created |
3302 | 如果got_write则 |
3303 | mnt_drop_write(mnt) |
3304 | got_write = false |
3308 | 如果此条件成立可能性小(为编译器优化)(error < 0)则返回:error |
3314 | audit_inode(name, dentry, 0) |
3317 | path_to_nameidata( & path, nd) |
3318 | 返回:负EEXIST |
3321 | seq等于0 |
3323 | finish_lookup : |
3325 | 如果此条件成立可能性小(为编译器优化)(error)则返回:error |
3327 | finish_open : |
3332 | audit_inode(name, dentry, 0) |
3337 | error等于may_create_in_sticky - Check whether an O_CREAT open in a sticky directory* should be allowed, or not, on files that already* exist |
3339 | 如果此条件成立可能性小(为编译器优化)(error)则转到:out |
3343 | 如果flags按位与quire a directory 且非d_can_lookup(dentry)则转到:out |
3345 | 如果非d_is_reg(dentry)则will_truncate = false |
3348 | 如果will_truncate则 |
3354 | finish_open_created : |
3358 | BUG_ON(f_mode & FMODE_OPENED) |
3359 | error等于vfs_open - open the file at the given path*@path: path to open*@file: newly allocated file with f_flag initialized*@cred: credentials to use |
3362 | opened : |
3363 | error等于ima_file_check(file, acc_mode) |
3364 | 如果非error且will_truncate则error等于handle_truncate(file) |
3366 | out : |
3367 | 如果此条件成立可能性小(为编译器优化)(error > 0)则 |
3371 | 如果got_write则mnt_drop_write(mnt) |
3373 | 返回:error |
名称 | 描述 |
---|---|
path_openat |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |