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)
downloadlinux-8634b51f6ca298fb8b07aa4847340764903533ab.tar.gz
linux-8634b51f6ca298fb8b07aa4847340764903533ab.tar.bz2
linux-8634b51f6ca298fb8b07aa4847340764903533ab.zip
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 {
struct file_lock_context {
struct list_head flc_flock;
struct list_head flc_posix;
+ struct list_head flc_lease;
};
/* 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)
* end up racing with tasks trying to set a new lease on this file.
*/
smp_mb();
- if (inode->i_flock)
+ if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
return __break_lease(inode, mode, FL_LEASE);
return 0;
}
@@ -2003,7 +2004,7 @@ static inline int break_deleg(struct inode *inode, unsigned int mode)
* end up racing with tasks trying to set a new lease on this file.
*/
smp_mb();
- if (inode->i_flock)
+ if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease))
return __break_lease(inode, mode, FL_DELEG);
return 0;
}