VFS: Add support for the FL_ACCESS flag to flock_lock_file()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

+5
+5
fs/locks.c
··· 739 int found = 0; 740 741 lock_kernel(); 742 for_each_lock(inode, before) { 743 struct file_lock *fl = *before; 744 if (IS_POSIX(fl)) ··· 773 if (found) 774 cond_resched(); 775 776 for_each_lock(inode, before) { 777 struct file_lock *fl = *before; 778 if (IS_POSIX(fl)) ··· 787 locks_insert_block(fl, request); 788 goto out; 789 } 790 locks_copy_lock(new_fl, request); 791 locks_insert_lock(&inode->i_flock, new_fl); 792 new_fl = NULL;
··· 739 int found = 0; 740 741 lock_kernel(); 742 + if (request->fl_flags & FL_ACCESS) 743 + goto find_conflict; 744 for_each_lock(inode, before) { 745 struct file_lock *fl = *before; 746 if (IS_POSIX(fl)) ··· 771 if (found) 772 cond_resched(); 773 774 + find_conflict: 775 for_each_lock(inode, before) { 776 struct file_lock *fl = *before; 777 if (IS_POSIX(fl)) ··· 784 locks_insert_block(fl, request); 785 goto out; 786 } 787 + if (request->fl_flags & FL_ACCESS) 788 + goto out; 789 locks_copy_lock(new_fl, request); 790 locks_insert_lock(&inode->i_flock, new_fl); 791 new_fl = NULL;