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
8116bf4c
Commit
8116bf4c
authored
Jan 21, 2015
by
Jeff Layton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
locks: update comments that refer to inode->i_flock
Signed-off-by:
Jeff Layton
<
jlayton@primarydata.com
>
parent
3d8e560d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
fs/locks.c
fs/locks.c
+1
-1
include/linux/fs.h
include/linux/fs.h
+10
-9
No files found.
fs/locks.c
View file @
8116bf4c
...
...
@@ -2212,7 +2212,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd,
*/
/*
* we need that spin_lock here - it prevents reordering between
* update of i
node->i_flock
and check for it done in close().
* update of i
_flctx->flc_posix
and check for it done in close().
* rcu_read_lock() wouldn't do.
*/
spin_lock
(
&
current
->
files
->
file_lock
);
...
...
include/linux/fs.h
View file @
8116bf4c
...
...
@@ -925,12 +925,11 @@ int locks_in_grace(struct net *);
* FIXME: should we create a separate "struct lock_request" to help distinguish
* these two uses?
*
* The
i_flock list is
ordered by:
* The
varous i_flctx lists are
ordered by:
*
* 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX
* 2) lock owner
* 3) lock range start
* 4) lock range end
* 1) lock owner
* 2) lock range start
* 3) lock range end
*
* Obviously, the last two criteria only matter for POSIX locks.
*/
...
...
@@ -1992,8 +1991,9 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
{
/*
* Since this check is lockless, we must ensure that any refcounts
* taken are done before checking inode->i_flock. Otherwise, we could
* end up racing with tasks trying to set a new lease on this file.
* taken are done before checking i_flctx->flc_lease. Otherwise, we
* could end up racing with tasks trying to set a new lease on this
* file.
*/
smp_mb
();
if
(
inode
->
i_flctx
&&
!
list_empty_careful
(
&
inode
->
i_flctx
->
flc_lease
))
...
...
@@ -2005,8 +2005,9 @@ static inline int break_deleg(struct inode *inode, unsigned int mode)
{
/*
* Since this check is lockless, we must ensure that any refcounts
* taken are done before checking inode->i_flock. Otherwise, we could
* end up racing with tasks trying to set a new lease on this file.
* taken are done before checking i_flctx->flc_lease. Otherwise, we
* could end up racing with tasks trying to set a new lease on this
* file.
*/
smp_mb
();
if
(
inode
->
i_flctx
&&
!
list_empty_careful
(
&
inode
->
i_flctx
->
flc_lease
))
...
...
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