]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
VFS: Add support for the FL_ACCESS flag to flock_lock_file()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 29 Jun 2006 20:38:37 +0000 (16:38 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 5 Jul 2006 17:13:18 +0000 (13:13 -0400)
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/locks.c

index 50cb0a2b74d9848d5a1e4e84cd203f8214479850..b0b41a64e10bd86482b10a7ba44b36613a6d25e8 100644 (file)
@@ -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;