函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\open.c Create Date:2022-07-29 10:31:01
Last Modify:2020-03-18 10:16:03 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:build_open_flags

函数原型:static inline int build_open_flags(int flags, umode_t mode, struct open_flags *op)

返回类型:int

参数:

类型参数名称
intflags
umode_tmode
struct open_flags *op
960  lookup_flags等于0
961  acc_mode等于ACC_MODE(flags)
967  flags与等于list of all valid flags for the open/openat flags argument:
969  如果flags按位与O_CREAT按位或__O_TMPFILE的值则mode等于mode按位与S_IALLUGO按位或S_IFREG
971  否则mode等于0
975  flags与等于File was opened by fanotify and shouldn't generate fanotify events 的反按位与O_CLOEXEC的反
983  如果flags按位与__O_SYNCflags或等于O_DSYNC
986  如果flags按位与__O_TMPFILE
987  如果flags按位与O_TMPFILE_MASK的值不等于O_TMPFILE则返回:负EINVAL
989  如果非acc_mode按位与MAY_WRITE的值则返回:负EINVAL
991  否则如果flags按位与O_PATH
996  flags与等于O_DIRECTORY按位或O_NOFOLLOW按位或O_PATH
997  acc_mode等于0
1000  open_flag等于flags
1003  如果flags按位与O_TRUNCacc_mode或等于MAY_WRITE
1008  如果flags按位与O_APPENDacc_mode或等于MAY_APPEND
1011  acc_mode等于acc_mode
1013  intent等于如果flags按位与O_PATH则0否则... in open
1015  如果flags按位与O_CREAT
1016  intent或等于... in object creation
1017  如果flags按位与O_EXCLintent或等于... in exclusive creation
1021  如果flags按位与O_DIRECTORYlookup_flags或等于quire a directory
1023  如果非flags按位与O_NOFOLLOW的值则lookup_flags或等于llow links at the end
1025  lookup_flags等于lookup_flags
1026  返回:0
调用者
名称描述
file_open_namele_open_name - open file and return file pointer*@name: struct filename containing path to open*@flags: open flags as per the open(2) second argument*@mode: mode for the new file if O_CREAT is set, else ignored* This is the helper to open a file from
file_open_root
do_sys_open