diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-29 22:38:37 +0200 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-05 19:13:18 +0200 |
commit | f07f18dd6f29f11887b8d9cf7ecb736bf2f7dc62 (patch) | |
tree | 069d7fbf4ad2e5a290c27965c7714b2b0e5e8f61 | |
parent | NFSv4: Ensure nfs4_lock_expired() caches delegated locks (diff) | |
download | linux-f07f18dd6f29f11887b8d9cf7ecb736bf2f7dc62.tar.xz linux-f07f18dd6f29f11887b8d9cf7ecb736bf2f7dc62.zip |
VFS: Add support for the FL_ACCESS flag to flock_lock_file()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-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) int found = 0; lock_kernel(); + if (request->fl_flags & FL_ACCESS) + goto find_conflict; for_each_lock(inode, before) { struct file_lock *fl = *before; if (IS_POSIX(fl)) @@ -771,6 +773,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) if (found) cond_resched(); +find_conflict: for_each_lock(inode, before) { struct file_lock *fl = *before; if (IS_POSIX(fl)) @@ -784,6 +787,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) locks_insert_block(fl, request); goto out; } + if (request->fl_flags & FL_ACCESS) + goto out; locks_copy_lock(new_fl, request); locks_insert_lock(&inode->i_flock, new_fl); new_fl = NULL; |