summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2015-01-16 15:05:55 -0500
committerJeff Layton <jeff.layton@primarydata.com>2015-01-16 16:08:17 -0500
commit8634b51f6ca298fb8b07aa4847340764903533ab (patch)
treee3c32514f05317bacc40aba8782a9912f887cebd /include/linux/fs.h
parentbd61e0a9c852de2d705b6f1bb2cc54c5774db570 (diff)
locks: convert lease handling to file_lock_context
Signed-off-by: Jeff Layton <jlayton@primarydata.com> Acked-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 571f113588e9..2ddec3cf81b9 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -969,6 +969,7 @@ struct file_lock {
969struct file_lock_context { 969struct file_lock_context {
970 struct list_head flc_flock; 970 struct list_head flc_flock;
971 struct list_head flc_posix; 971 struct list_head flc_posix;
972 struct list_head flc_lease;
972}; 973};
973 974
974/* The following constant reflects the upper bound of the file/locking space */ 975/* The following constant reflects the upper bound of the file/locking space */
@@ -1990,7 +1991,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
1990 * end up racing with tasks trying to set a new lease on this file. 1991 * end up racing with tasks trying to set a new lease on this file.
1991 */ 1992 */
1992 smp_mb(); 1993 smp_mb();
1993 if (inode->i_flock) 1994 if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
1994 return __break_lease(inode, mode, FL_LEASE); 1995 return __break_lease(inode, mode, FL_LEASE);
1995 return 0; 1996 return 0;
1996} 1997}
@@ -2003,7 +2004,7 @@ static inline int break_deleg(struct inode *inode, unsigned int mode)
2003 * end up racing with tasks trying to set a new lease on this file. 2004 * end up racing with tasks trying to set a new lease on this file.
2004 */ 2005 */
2005 smp_mb(); 2006 smp_mb();
2006 if (inode->i_flock) 2007 if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
2007 return __break_lease(inode, mode, FL_DELEG); 2008 return __break_lease(inode, mode, FL_DELEG);
2008 return 0; 2009 return 0;
2009} 2010}