Skip to contentSkip to conversation

fs/afs/flock.c: posix_test_lock() returns void

PATCH In review Eugene Teo 2 participants 2 messages Jul 19, 2007 Afs filesystem

lore
Share & tools
lore

Eugene Teo

author
#0 lore raw

PATCH 1/1 fs/afs/flock.c: posix_test_lock() returns void

posix_test_lock() returns void, so there is no need to test the return value. Checking fl->fl_type for F_UNLCK instead.

---
 fs/afs/flock.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/afs/flock.c +2 -1
index 8f07f8d..4f77f3c 100644
@@ -456,7 +456,8 @@ static int afs_do_getlk(struct file *file, struct file_lock *fl)
 
 	/* check local lock records first */
 	ret = 0;
-	if (posix_test_lock(file, fl) == 0) {
+	posix_test_lock(file, fl);
+	if (fl->fl_type == F_UNLCK) {
 		/* no local locks; consult the server */
 		ret = afs_vnode_fetch_status(vnode, NULL, key);
 		if (ret < 0)
Signature · 1 line
1.5.2.2
maintainer
#1 lore raw
Quoted 2 lines · Eugene Teo

posix_test_lock() returns void, so there is no need to test the return value. Checking fl->fl_type for F_UNLCK instead.

Yep, thanks. Andrew Morton already has a patch for this.

David