Re: [PATCH 2/5][GFS2] Cleanup explicit check for mandatory locks

Previous thread: [PATCH 1/5] Cleanup macros for distinguishing mandatory locks by Pavel Emelyanov on Monday, September 17, 2007 - 12:50 am. (1 message)

Next thread: [PATCH 3/5][9PFS] Cleanup explicit check for mandatory locks by Pavel Emelyanov on Monday, September 17, 2007 - 12:53 am. (2 messages)
From: Pavel Emelyanov
Date: Monday, September 17, 2007 - 12:52 am

The __mandatory_lock(inode) function 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..28773ca 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)

-

From: Andrew Morton
Date: Wednesday, September 19, 2007 - 4:50 pm

On Mon, 17 Sep 2007 11:52:08 +0400

Boring administrivial note: all these patches effectively had the same
title.  Because the text in "[]" is considered to be something which should
be discarded when the patch is applied.

This convention is useful because things like sequence numbering, kernel
version information, etc are only relevant when you sent the patch and are
not relevant when the patches hit the git tree.

Bottom line: please do include the subsystem ideitification as you have
tried to do, but please do not place it inside "[]".

As described in the very fine
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt, better
Subject:s here would have been

Subject: [PATCH 2/5] GFS2: Cleanup explicit check for mandatory locks
Subject: [PATCH 3/5] 9PFS: Cleanup explicit check for mandatory locks
Subject: [PATCH 4/5] AFS: Cleanup explicit check for mandatory locks
Subject: [PATCH 5/5] NFS: Cleanup explicit check for mandatory locks

Extreme trivia: I don't consider a colon to terminate a sentence, so if I
can be bothered I'll convert "Cleanup" there to "cleanup".  And I don't
consider "cleanup" to be a word, so it becomes "clean up".  And I'll
usually remvoe the final "." from the end of the subject because it's
basically just a waste of space.

-

Previous thread: [PATCH 1/5] Cleanup macros for distinguishing mandatory locks by Pavel Emelyanov on Monday, September 17, 2007 - 12:50 am. (1 message)

Next thread: [PATCH 3/5][9PFS] Cleanup explicit check for mandatory locks by Pavel Emelyanov on Monday, September 17, 2007 - 12:53 am. (2 messages)