diff options
-rw-r--r-- | fs/locks.c | 16 | ||||
-rw-r--r-- | include/linux/fcntl.h | 4 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/fs/locks.c b/fs/locks.c index ee46584c1a40..242328e17f32 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -2028,6 +2028,22 @@ posix_unblock_lock(struct file *filp, struct file_lock *waiter) | |||
2028 | 2028 | ||
2029 | EXPORT_SYMBOL(posix_unblock_lock); | 2029 | EXPORT_SYMBOL(posix_unblock_lock); |
2030 | 2030 | ||
2031 | /** | ||
2032 | * vfs_cancel_lock - file byte range unblock lock | ||
2033 | * @filp: The file to apply the unblock to | ||
2034 | * @fl: The lock to be unblocked | ||
2035 | * | ||
2036 | * Used by lock managers to cancel blocked requests | ||
2037 | */ | ||
2038 | int vfs_cancel_lock(struct file *filp, struct file_lock *fl) | ||
2039 | { | ||
2040 | if (filp->f_op && filp->f_op->lock) | ||
2041 | return filp->f_op->lock(filp, F_CANCELLK, fl); | ||
2042 | return 0; | ||
2043 | } | ||
2044 | |||
2045 | EXPORT_SYMBOL_GPL(vfs_cancel_lock); | ||
2046 | |||
2031 | static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx) | 2047 | static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx) |
2032 | { | 2048 | { |
2033 | struct inode *inode = NULL; | 2049 | struct inode *inode = NULL; |
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index 996f5611cd59..40b93265d4ba 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h | |||
@@ -3,6 +3,10 @@ | |||
3 | 3 | ||
4 | #include <asm/fcntl.h> | 4 | #include <asm/fcntl.h> |
5 | 5 | ||
6 | /* Cancel a blocking posix lock; internal use only until we expose an | ||
7 | * asynchronous lock api to userspace: */ | ||
8 | #define F_CANCELLK (F_LINUX_SPECIFIC_BASE+5) | ||
9 | |||
6 | #define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0) | 10 | #define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0) |
7 | #define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1) | 11 | #define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1) |
8 | 12 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index c92d0bdff39f..64b8ae205309 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -857,6 +857,7 @@ extern int posix_lock_file_wait(struct file *, struct file_lock *); | |||
857 | extern int posix_unblock_lock(struct file *, struct file_lock *); | 857 | extern int posix_unblock_lock(struct file *, struct file_lock *); |
858 | extern int vfs_test_lock(struct file *, struct file_lock *); | 858 | extern int vfs_test_lock(struct file *, struct file_lock *); |
859 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); | 859 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); |
860 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | ||
860 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 861 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); |
861 | extern int __break_lease(struct inode *inode, unsigned int flags); | 862 | extern int __break_lease(struct inode *inode, unsigned int flags); |
862 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 863 | extern void lease_get_mtime(struct inode *, struct timespec *time); |