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

Eugene Teo
2007-07-19T09:06:54Z

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