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
Kirill Smelkov
linux
Commits
f07f18dd
Commit
f07f18dd
authored
Jun 29, 2006
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VFS: Add support for the FL_ACCESS flag to flock_lock_file()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
42a2d13e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
fs/locks.c
fs/locks.c
+5
-0
No files found.
fs/locks.c
View file @
f07f18dd
...
@@ -739,6 +739,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
...
@@ -739,6 +739,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
int
found
=
0
;
int
found
=
0
;
lock_kernel
();
lock_kernel
();
if
(
request
->
fl_flags
&
FL_ACCESS
)
goto
find_conflict
;
for_each_lock
(
inode
,
before
)
{
for_each_lock
(
inode
,
before
)
{
struct
file_lock
*
fl
=
*
before
;
struct
file_lock
*
fl
=
*
before
;
if
(
IS_POSIX
(
fl
))
if
(
IS_POSIX
(
fl
))
...
@@ -771,6 +773,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
...
@@ -771,6 +773,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
if
(
found
)
if
(
found
)
cond_resched
();
cond_resched
();
find_conflict:
for_each_lock
(
inode
,
before
)
{
for_each_lock
(
inode
,
before
)
{
struct
file_lock
*
fl
=
*
before
;
struct
file_lock
*
fl
=
*
before
;
if
(
IS_POSIX
(
fl
))
if
(
IS_POSIX
(
fl
))
...
@@ -784,6 +787,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
...
@@ -784,6 +787,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
locks_insert_block
(
fl
,
request
);
locks_insert_block
(
fl
,
request
);
goto
out
;
goto
out
;
}
}
if
(
request
->
fl_flags
&
FL_ACCESS
)
goto
out
;
locks_copy_lock
(
new_fl
,
request
);
locks_copy_lock
(
new_fl
,
request
);
locks_insert_lock
(
&
inode
->
i_flock
,
new_fl
);
locks_insert_lock
(
&
inode
->
i_flock
,
new_fl
);
new_fl
=
NULL
;
new_fl
=
NULL
;
...
...
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