locks: give posix_test_lock same interface as ->lock

posix_test_lock() and ->lock() do the same job but have gratuitously
different interfaces.  Modify posix_test_lock() so the two agree,
simplifying some code in the process.

Signed-off-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
This commit is contained in:
Marc Eshel
2007-02-21 00:55:18 -05:00
committed by J. Bruce Fields
parent 70cc6487a4
commit 9d6a8c5c21
8 changed files with 32 additions and 51 deletions

View File

@@ -391,17 +391,12 @@ out_swapfile:
static int do_getlk(struct file *filp, int cmd, struct file_lock *fl)
{
struct file_lock cfl;
struct inode *inode = filp->f_mapping->host;
int status = 0;
lock_kernel();
/* Try local locking first */
if (posix_test_lock(filp, fl, &cfl)) {
fl->fl_start = cfl.fl_start;
fl->fl_end = cfl.fl_end;
fl->fl_type = cfl.fl_type;
fl->fl_pid = cfl.fl_pid;
if (posix_test_lock(filp, fl)) {
goto out;
}