From 7e0b7d5112611e398ac147c159256e0f93cc4e53 Mon Sep 17 00:00:00 2001 From: Marc Eshel Date: Thu, 18 Jan 2007 17:52:58 -0500 Subject: [PATCH] --- yaml --- r: 54490 b: refs/heads/master c: 9b9d2ab4154a42ea4a119f7d3e4e0288bfe0bb79 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/locks.c | 16 ++++++++++++++++ trunk/include/linux/fcntl.h | 4 ++++ trunk/include/linux/fs.h | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6476f367f601..57fdbd4c9956 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 150b393456e5a23513cace286a019e87151e47f0 +refs/heads/master: 9b9d2ab4154a42ea4a119f7d3e4e0288bfe0bb79 diff --git a/trunk/fs/locks.c b/trunk/fs/locks.c index ee46584c1a40..242328e17f32 100644 --- a/trunk/fs/locks.c +++ b/trunk/fs/locks.c @@ -2028,6 +2028,22 @@ posix_unblock_lock(struct file *filp, struct file_lock *waiter) EXPORT_SYMBOL(posix_unblock_lock); +/** + * vfs_cancel_lock - file byte range unblock lock + * @filp: The file to apply the unblock to + * @fl: The lock to be unblocked + * + * Used by lock managers to cancel blocked requests + */ +int vfs_cancel_lock(struct file *filp, struct file_lock *fl) +{ + if (filp->f_op && filp->f_op->lock) + return filp->f_op->lock(filp, F_CANCELLK, fl); + return 0; +} + +EXPORT_SYMBOL_GPL(vfs_cancel_lock); + static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx) { struct inode *inode = NULL; diff --git a/trunk/include/linux/fcntl.h b/trunk/include/linux/fcntl.h index 996f5611cd59..40b93265d4ba 100644 --- a/trunk/include/linux/fcntl.h +++ b/trunk/include/linux/fcntl.h @@ -3,6 +3,10 @@ #include +/* Cancel a blocking posix lock; internal use only until we expose an + * asynchronous lock api to userspace: */ +#define F_CANCELLK (F_LINUX_SPECIFIC_BASE+5) + #define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0) #define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1) diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index c92d0bdff39f..64b8ae205309 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -857,6 +857,7 @@ extern int posix_lock_file_wait(struct file *, struct file_lock *); extern int posix_unblock_lock(struct file *, struct file_lock *); 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 void lease_get_mtime(struct inode *, struct timespec *time);