OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 2/5][GFS2] Cleanup explicit check for mandatory locks
[PATCH 2/5][GFS2] Cleanup explicit check for mandatory locks [message #20349] Mon, 17 September 2007 07:52 Go to next message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
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)
Re: [PATCH 2/5][GFS2] Cleanup explicit check for mandatory locks [message #20528 is a reply to message #20349] Wed, 19 September 2007 23:50 Go to previous message
akpm is currently offline  akpm
Messages: 224
Registered: March 2007
Senior Member
On Mon, 17 Sep 2007 11:52:08 +0400
Pavel Emelyanov <xemul@openvz.org> wrote:

> 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

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 Topic: [PATCH] Use list_first_entry in locks_wake_up_blocks
Next Topic: [PATCH] Rework /proc/locks via seq_files and seq_list helpers
Goto Forum:
  


Current Time: Sun Jul 21 10:34:35 GMT 2024

Total time taken to generate the page: 0.02330 seconds