Skip to contentSkip to conversation

Use macro instead of explicit check for mandatory locks

PATCH In review Pavel Emelyanov 1 participant 1 message Sep 12, 2007 9P file system

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 Use macro instead of explicit check for mandatory locks

The __MANDATORY_LOCK(inode) macro makes the same check, but makes the code more readable.

Cc Eric Van Hensbergen <[email protected]>
Cc Ron Minnich <[email protected]>
Cc Latchesar Ionkov <[email protected]>

---

 fs/9p/vfs_file.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
fs/9p/vfs_file.c +1 -1
index 2a40c29..7e75309 100644
@@ -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) {