From 4f6563677ae833baad8003e14353241bc25da4fc Mon Sep 17 00:00:00 2001 From: Benjamin Coddington Date: Thu, 22 Oct 2015 13:38:14 -0400 Subject: Move locks API users to locks_lock_inode_wait() Instead of having users check for FL_POSIX or FL_FLOCK to call the correct locks API function, use the check within locks_lock_inode_wait(). This allows for some later cleanup. Signed-off-by: Benjamin Coddington Signed-off-by: Jeff Layton --- drivers/staging/lustre/lustre/llite/file.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index dcd0c6d65efb..4edbf46869d4 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -2763,13 +2763,9 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock) rc = md_enqueue(sbi->ll_md_exp, &einfo, NULL, op_data, &lockh, &flock, 0, NULL /* req */, flags); - if ((file_lock->fl_flags & FL_FLOCK) && - (rc == 0 || file_lock->fl_type == F_UNLCK)) - rc2 = flock_lock_file_wait(file, file_lock); - if ((file_lock->fl_flags & FL_POSIX) && - (rc == 0 || file_lock->fl_type == F_UNLCK) && + if ((rc == 0 || file_lock->fl_type == F_UNLCK) && !(flags & LDLM_FL_TEST_LOCK)) - rc2 = posix_lock_file_wait(file, file_lock); + rc2 = locks_lock_file_wait(file, file_lock); if (rc2 && file_lock->fl_type != F_UNLCK) { einfo.ei_mode = LCK_NL; -- cgit v1.2.3-59-g8ed1b