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:
committed by
J. Bruce Fields
parent
70cc6487a4
commit
9d6a8c5c21
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user