public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/5][GFS2] Cleanup explicit check for mandatory locks
@ 2007-09-17  7:52 Pavel Emelyanov
  2007-09-19 23:50 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2007-09-17  7:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List, devel, Steven Whitehouse

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)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/5][GFS2] Cleanup explicit check for mandatory locks
  2007-09-17  7:52 [PATCH 2/5][GFS2] Cleanup explicit check for mandatory locks Pavel Emelyanov
@ 2007-09-19 23:50 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2007-09-19 23:50 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: Linux Kernel Mailing List, devel, Steven Whitehouse

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-19 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-17  7:52 [PATCH 2/5][GFS2] Cleanup explicit check for mandatory locks Pavel Emelyanov
2007-09-19 23:50 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox