[Devel] [PATCH 3/5][9PFS] Cleanup explicit check for mandatory locks
Pavel Emelyanov
xemul at openvz.org
Mon Sep 17 00:53:50 PDT 2007
The __mandatory_lock(inode) macro makes the same check, but
makes the code more readable.
Signed-off-by: Pavel Emelyanov <xemul at openvz.org>
Cc: Eric Van Hensbergen <ericvh at gmail.com>
Cc: Ron Minnich <rminnich at sandia.gov>
Cc: Latchesar Ionkov <lucho at ionkov.net>
---
fs/9p/vfs_file.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 2a40c29..7166916 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -105,7 +105,7 @@ static int v9fs_file_lock(struct file *f
P9_DPRINTK(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl);
/* No mandatory locks */
- if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
+ if (__mandatory_lock(inode))
return -ENOLCK;
if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) {
More information about the Devel
mailing list