OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 2/5][GFS2] Use macro instead of explicit check for mandatory locks
[PATCH 2/5][GFS2] Use macro instead of explicit check for mandatory locks [message #20117] Wed, 12 September 2007 11:20
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
The __MANDATORY_LOCK(inode) macro makes the same check, but
makes the code more readable.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Steven Whitehouse <swhiteho@redhat.com>

---

 fs/gfs2/ops_file.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index 94d76ac..7e814f4 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -535,7 +535,7 @@ static int gfs2_lock(struct file *file, 
 
 	if (!(fl->fl_flags & FL_POSIX))
 		return -ENOLCK;
-	if ((ip->i_inode.i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
+	if (__MANDATORY_LOCK(ip->i_inode))
 		return -ENOLCK;
 
 	if (sdp->sd_args.ar_localflocks) {
@@ -637,7 +637,7 @@ static int gfs2_flock(struct file *file,
 
 	if (!(fl->fl_flags & FL_FLOCK))
 		return -ENOLCK;
-	if ((ip->i_inode.i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
+	if (__MANDATORY_LOCK(ip->i_inode))
 		return -ENOLCK;
 
 	if (sdp->sd_args.ar_localflocks)
Previous Topic: [-mm PATCH 0/9] Memory controller introduction (v6)
Next Topic: [PATCH 3/5][9PFS] Use macro instead of explicit check for mandatory locks
Goto Forum:
  


Current Time: Sun Jul 14 02:20:47 GMT 2024

Total time taken to generate the page: 0.02163 seconds