Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54490
b: refs/heads/master
c: 9b9d2ab
h: refs/heads/master
v: v3
  • Loading branch information
Marc Eshel authored and J. Bruce Fields committed May 7, 2007
1 parent c7d123f commit 7e0b7d5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 150b393456e5a23513cace286a019e87151e47f0
refs/heads/master: 9b9d2ab4154a42ea4a119f7d3e4e0288bfe0bb79
16 changes: 16 additions & 0 deletions trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

#include <asm/fcntl.h>

/* 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)

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7e0b7d5

Please sign in to comment.