public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/afs/flock.c: posix_test_lock() returns void
@ 2007-07-19  9:06 Eugene Teo
  2007-07-19 12:55 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Eugene Teo @ 2007-07-19  9:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Howells

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

Signed-off-by: Eugene Teo <eugeneteo@kernel.sg>
---
 fs/afs/flock.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/afs/flock.c b/fs/afs/flock.c
index 8f07f8d..4f77f3c 100644
--- a/fs/afs/flock.c
+++ b/fs/afs/flock.c
@@ -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)
-- 
1.5.2.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs/afs/flock.c: posix_test_lock() returns void
  2007-07-19  9:06 [PATCH] fs/afs/flock.c: posix_test_lock() returns void Eugene Teo
@ 2007-07-19 12:55 ` David Howells
  0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2007-07-19 12:55 UTC (permalink / raw)
  To: Eugene Teo; +Cc: linux-kernel

Eugene Teo <eugeneteo@kernel.sg> wrote:

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-19 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-19  9:06 [PATCH] fs/afs/flock.c: posix_test_lock() returns void Eugene Teo
2007-07-19 12:55 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox