Skip to content

Commit 8116bf4

Browse files
author
Jeff Layton
committed
locks: update comments that refer to inode->i_flock
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
1 parent 3d8e560 commit 8116bf4

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

fs/locks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd,
22122212
*/
22132213
/*
22142214
* we need that spin_lock here - it prevents reordering between
2215-
* update of inode->i_flock and check for it done in close().
2215+
* update of i_flctx->flc_posix and check for it done in close().
22162216
* rcu_read_lock() wouldn't do.
22172217
*/
22182218
spin_lock(&current->files->file_lock);

include/linux/fs.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -925,12 +925,11 @@ int locks_in_grace(struct net *);
925925
* FIXME: should we create a separate "struct lock_request" to help distinguish
926926
* these two uses?
927927
*
928-
* The i_flock list is ordered by:
928+
* The varous i_flctx lists are ordered by:
929929
*
930-
* 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX
931-
* 2) lock owner
932-
* 3) lock range start
933-
* 4) lock range end
930+
* 1) lock owner
931+
* 2) lock range start
932+
* 3) lock range end
934933
*
935934
* Obviously, the last two criteria only matter for POSIX locks.
936935
*/
@@ -1992,8 +1991,9 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
19921991
{
19931992
/*
19941993
* Since this check is lockless, we must ensure that any refcounts
1995-
* taken are done before checking inode->i_flock. Otherwise, we could
1996-
* end up racing with tasks trying to set a new lease on this file.
1994+
* taken are done before checking i_flctx->flc_lease. Otherwise, we
1995+
* could end up racing with tasks trying to set a new lease on this
1996+
* file.
19971997
*/
19981998
smp_mb();
19991999
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)
20052005
{
20062006
/*
20072007
* Since this check is lockless, we must ensure that any refcounts
2008-
* taken are done before checking inode->i_flock. Otherwise, we could
2009-
* end up racing with tasks trying to set a new lease on this file.
2008+
* taken are done before checking i_flctx->flc_lease. Otherwise, we
2009+
* could end up racing with tasks trying to set a new lease on this
2010+
* file.
20102011
*/
20112012
smp_mb();
20122013
if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))

0 commit comments

Comments
 (0)