diff options
author | Marc Eshel <eshel@almaden.ibm.com> | 2007-01-18 17:52:58 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2007-05-06 20:38:28 -0400 |
commit | 9b9d2ab4154a42ea4a119f7d3e4e0288bfe0bb79 (patch) | |
tree | 62af6b2eff0885c26aa2af4b01890cc02cf0b2f0 /include | |
parent | 150b393456e5a23513cace286a019e87151e47f0 (diff) |
locks: add lock cancel command
Lock managers need to be able to cancel pending lock requests. In the case
where the exported filesystem manages its own locks, it's not sufficient just
to call posix_unblock_lock(); we need to let the filesystem know what's
happening too.
We do this by adding a new fcntl lock command: FL_CANCELLK. Some day this
might also be made available to userspace applications that could benefit from
an asynchronous locking api.
Signed-off-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fcntl.h | 4 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
2 files changed, 5 insertions, 0 deletions
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); |