]> Pileus Git - ~andy/linux/blobdiff - include/linux/fs.h
locks: implement delegations
[~andy/linux] / include / linux / fs.h
index 129e150f9e9485f76b3889e1d18a21b027d050a8..8e4be1be1a6257238f99c4ebde0ff8ce26c29c87 100644 (file)
@@ -1022,7 +1022,7 @@ extern int vfs_test_lock(struct file *, struct file_lock *);
 extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
 extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
 extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
-extern int __break_lease(struct inode *inode, unsigned int flags);
+extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
 extern void lease_get_mtime(struct inode *, struct timespec *time);
 extern int generic_setlease(struct file *, long, struct file_lock **);
 extern int vfs_setlease(struct file *, long, struct file_lock **);
@@ -1131,7 +1131,7 @@ static inline int flock_lock_file_wait(struct file *filp,
        return -ENOLCK;
 }
 
-static inline int __break_lease(struct inode *inode, unsigned int mode)
+static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned int type)
 {
        return 0;
 }
@@ -1961,9 +1961,17 @@ static inline int locks_verify_truncate(struct inode *inode,
 static inline int break_lease(struct inode *inode, unsigned int mode)
 {
        if (inode->i_flock)
-               return __break_lease(inode, mode);
+               return __break_lease(inode, mode, FL_LEASE);
        return 0;
 }
+
+static inline int break_deleg(struct inode *inode, unsigned int mode)
+{
+       if (inode->i_flock)
+               return __break_lease(inode, mode, FL_DELEG);
+       return 0;
+}
+
 #else /* !CONFIG_FILE_LOCKING */
 static inline int locks_mandatory_locked(struct inode *inode)
 {
@@ -2003,6 +2011,10 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
        return 0;
 }
 
+static inline int break_deleg(struct inode *inode, unsigned int mode)
+{
+       return 0;
+}
 #endif /* CONFIG_FILE_LOCKING */
 
 /* fs/open.c */