Browse Source

locks: reverse order of posix_locks_conflict() arguments

The first argument to posix_locks_conflict() is meant to be a lock request,
and the second a lock from an inode's lock request.  It doesn't really
make a difference which order you call them in, since the only
asymmetric test in posix_lock_conflict() is the check whether the second
argument is a posix lock--and every caller already does that check for
some reason.

But may as well fix posix_test_lock() to call posix_locks_conflict()
with the arguments in the same order as everywhere else.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
J. Bruce Fields 18 năm trước cách đây
mục cha
commit
b842e240f2
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      fs/locks.c

+ 1 - 1
fs/locks.c

@@ -668,7 +668,7 @@ posix_test_lock(struct file *filp, struct file_lock *fl)
 	for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) {
 	for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) {
 		if (!IS_POSIX(cfl))
 		if (!IS_POSIX(cfl))
 			continue;
 			continue;
-		if (posix_locks_conflict(cfl, fl))
+		if (posix_locks_conflict(fl, cfl))
 			break;
 			break;
 	}
 	}
 	if (cfl)
 	if (cfl)