diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-29 16:38:37 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-05 13:13:18 -0400 |
commit | f07f18dd6f29f11887b8d9cf7ecb736bf2f7dc62 (patch) | |
tree | 069d7fbf4ad2e5a290c27965c7714b2b0e5e8f61 /fs/locks.c | |
parent | 42a2d13eee3c895d22e9d1a52b96d15ca49adabc (diff) |
VFS: Add support for the FL_ACCESS flag to flock_lock_file()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/locks.c')
-rw-r--r-- | fs/locks.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/locks.c b/fs/locks.c index 50cb0a2b74d9..b0b41a64e10b 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -739,6 +739,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) | |||
739 | int found = 0; | 739 | int found = 0; |
740 | 740 | ||
741 | lock_kernel(); | 741 | lock_kernel(); |
742 | if (request->fl_flags & FL_ACCESS) | ||
743 | goto find_conflict; | ||
742 | for_each_lock(inode, before) { | 744 | for_each_lock(inode, before) { |
743 | struct file_lock *fl = *before; | 745 | struct file_lock *fl = *before; |
744 | if (IS_POSIX(fl)) | 746 | if (IS_POSIX(fl)) |
@@ -771,6 +773,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) | |||
771 | if (found) | 773 | if (found) |
772 | cond_resched(); | 774 | cond_resched(); |
773 | 775 | ||
776 | find_conflict: | ||
774 | for_each_lock(inode, before) { | 777 | for_each_lock(inode, before) { |
775 | struct file_lock *fl = *before; | 778 | struct file_lock *fl = *before; |
776 | if (IS_POSIX(fl)) | 779 | if (IS_POSIX(fl)) |
@@ -784,6 +787,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) | |||
784 | locks_insert_block(fl, request); | 787 | locks_insert_block(fl, request); |
785 | goto out; | 788 | goto out; |
786 | } | 789 | } |
790 | if (request->fl_flags & FL_ACCESS) | ||
791 | goto out; | ||
787 | locks_copy_lock(new_fl, request); | 792 | locks_copy_lock(new_fl, request); |
788 | locks_insert_lock(&inode->i_flock, new_fl); | 793 | locks_insert_lock(&inode->i_flock, new_fl); |
789 | new_fl = NULL; | 794 | new_fl = NULL; |