Cleanup explicit check for mandatory locks
PATCH 3/5 Cleanup explicit check for mandatory locks
The __mandatory_lock(inode) macro makes the same check, but makes the code more readable.
Signed-off-by Pavel Emelyanov <[email protected]>
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
@@ -105,7 +105,7 @@ static int v9fs_file_lock(struct file *fP9_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 ) {
Quoted 26 lines · Pavel Emelyanov
The
__mandatory_lock(inode)macro makes the same check, but makes the code more readable.Signed-off-by Pavel Emelyanov <[email protected]>---
fs/9p/vfs_file.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)fs/9p/vfs_file.c +1
-1@@ -105,7 +105,7 @@ static int v9fs_file_lock(struct file *fP9_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 ) {