Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\fcntl.c Create Date:2022-07-28 20:05:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:setfl

Proto:static int setfl(int fd, struct file *filp, unsigned long arg)

Type:int

Parameter:

TypeParameterName
intfd
struct file *filp
unsigned longarg
37  inode = file_inode(filp)
38  error = 0
44  If (arg ^ f_flags) & O_APPEND && IS_APPEND(inode) Then Return -EPERM
48  If arg & O_NOATIME && Not (f_flags & O_NOATIME) Then If Not inode_owner_or_capable(inode) Then
50  Return -EPERM
53  If O_NONBLOCK != O_NDELAY Then If arg & O_NDELAY Then
55  arg |= O_NONBLOCK
58  If Not S_ISFIFO(i_mode) && arg & O_DIRECT Then
59  If Not f_mapping || Not a_ops || Not direct_IO Then Return -EINVAL
64  If check_flags Then error = check_flags(arg)
66  If error Then Return error
72  If (arg ^ f_flags) & FASYNC && fasync Then
73  error = fasync(fd, filp, (arg & FASYNC) != 0)
74  If error < 0 Then Go to out
76  If error > 0 Then error = 0
79  spin_lock( & * Protects f_ep_links, f_flags. * Must not be taken from IRQ context.)
80  f_flags = arg & SETFL_MASK | f_flags & ~SETFL_MASK
81  spin_unlock( & * Protects f_ep_links, f_flags. * Must not be taken from IRQ context.)
83  out :
84  Return error
Caller
NameDescribe
do_fcntl