Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
529787ea
Commit
529787ea
authored
Aug 27, 2002
by
Matthew Wilcox
Committed by
Linus Torvalds
Aug 27, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] push the BKL down in setfl
Just pushes the BKL down a little, no big deal.
parent
25aef71f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
+17
-20
fs/fcntl.c
fs/fcntl.c
+17
-20
No files found.
fs/fcntl.c
View file @
529787ea
...
@@ -227,23 +227,16 @@ asmlinkage long sys_dup(unsigned int fildes)
...
@@ -227,23 +227,16 @@ asmlinkage long sys_dup(unsigned int fildes)
static
int
setfl
(
int
fd
,
struct
file
*
filp
,
unsigned
long
arg
)
static
int
setfl
(
int
fd
,
struct
file
*
filp
,
unsigned
long
arg
)
{
{
struct
inode
*
inode
=
filp
->
f_dentry
->
d_inode
;
struct
inode
*
inode
=
filp
->
f_dentry
->
d_inode
;
int
error
;
int
error
=
0
;
/*
/* O_APPEND cannot be cleared if the file is marked as append-only */
* In the case of an append-only file, O_APPEND
* cannot be cleared
*/
if
(
!
(
arg
&
O_APPEND
)
&&
IS_APPEND
(
inode
))
if
(
!
(
arg
&
O_APPEND
)
&&
IS_APPEND
(
inode
))
return
-
EPERM
;
return
-
EPERM
;
/* Did FASYNC state change? */
/* required for strict SunOS emulation */
if
((
arg
^
filp
->
f_flags
)
&
FASYNC
)
{
if
(
O_NONBLOCK
!=
O_NDELAY
)
if
(
filp
->
f_op
&&
filp
->
f_op
->
fasync
)
{
if
(
arg
&
O_NDELAY
)
error
=
filp
->
f_op
->
fasync
(
fd
,
filp
,
(
arg
&
FASYNC
)
!=
0
);
arg
|=
O_NONBLOCK
;
if
(
error
<
0
)
return
error
;
}
}
if
(
arg
&
O_DIRECT
)
{
if
(
arg
&
O_DIRECT
)
{
if
(
!
inode
->
i_mapping
||
!
inode
->
i_mapping
->
a_ops
||
if
(
!
inode
->
i_mapping
||
!
inode
->
i_mapping
->
a_ops
||
...
@@ -251,13 +244,19 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
...
@@ -251,13 +244,19 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
return
-
EINVAL
;
return
-
EINVAL
;
}
}
/* required for strict SunOS emulation */
lock_kernel
();
if
(
O_NONBLOCK
!=
O_NDELAY
)
if
((
arg
^
filp
->
f_flags
)
&
FASYNC
)
{
if
(
arg
&
O_NDELAY
)
if
(
filp
->
f_op
&&
filp
->
f_op
->
fasync
)
{
arg
|=
O_NONBLOCK
;
error
=
filp
->
f_op
->
fasync
(
fd
,
filp
,
(
arg
&
FASYNC
)
!=
0
);
if
(
error
<
0
)
goto
out
;
}
}
filp
->
f_flags
=
(
arg
&
SETFL_MASK
)
|
(
filp
->
f_flags
&
~
SETFL_MASK
);
filp
->
f_flags
=
(
arg
&
SETFL_MASK
)
|
(
filp
->
f_flags
&
~
SETFL_MASK
);
return
0
;
out:
unlock_kernel
();
return
error
;
}
}
static
long
do_fcntl
(
unsigned
int
fd
,
unsigned
int
cmd
,
static
long
do_fcntl
(
unsigned
int
fd
,
unsigned
int
cmd
,
...
@@ -283,9 +282,7 @@ static long do_fcntl(unsigned int fd, unsigned int cmd,
...
@@ -283,9 +282,7 @@ static long do_fcntl(unsigned int fd, unsigned int cmd,
err
=
filp
->
f_flags
;
err
=
filp
->
f_flags
;
break
;
break
;
case
F_SETFL
:
case
F_SETFL
:
lock_kernel
();
err
=
setfl
(
fd
,
filp
,
arg
);
err
=
setfl
(
fd
,
filp
,
arg
);
unlock_kernel
();
break
;
break
;
case
F_GETLK
:
case
F_GETLK
:
err
=
fcntl_getlk
(
filp
,
(
struct
flock
*
)
arg
);
err
=
fcntl_getlk
(
filp
,
(
struct
flock
*
)
arg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment