Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\open.c Create Date:2022-07-28 20:00:59
Last Modify:2020-03-18 10:16:03 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:build_open_flags

Proto:static inline int build_open_flags(int flags, umode_t mode, struct open_flags *op)

Type:int

Parameter:

TypeParameterName
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  If flags & (O_CREAT | __O_TMPFILE) Then mode = mode & S_IALLUGO | S_IFREG
971  Else mode = 0
975  flags &= ~File was opened by fanotify and shouldn't generate fanotify events & ~O_CLOEXEC
983  If flags & __O_SYNC Then flags |= O_DSYNC
986  If flags & __O_TMPFILE Then
987  If (flags & O_TMPFILE_MASK) != O_TMPFILE Then Return -EINVAL
989  If Not (acc_mode & MAY_WRITE) Then Return -EINVAL
991  Else if flags & O_PATH Then
996  flags &= O_DIRECTORY | O_NOFOLLOW | O_PATH
997  acc_mode = 0
1000  open_flag = flags
1003  If flags & O_TRUNC Then acc_mode |= MAY_WRITE
1008  If flags & O_APPEND Then acc_mode |= MAY_APPEND
1011  acc_mode = acc_mode
1013  intent = If flags & O_PATH Then 0 Else ... in open
1015  If flags & O_CREAT Then
1016  intent |= ... in object creation
1017  If flags & O_EXCL Then intent |= ... in exclusive creation
1021  If flags & O_DIRECTORY Then lookup_flags |= quire a directory
1023  If Not (flags & O_NOFOLLOW) Then lookup_flags |= llow links at the end
1025  lookup_flags = lookup_flags
1026  Return 0
Caller
NameDescribe
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