From: Pavel Emelyanov <xemul@openvz.org>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
devel@openvz.org
Subject: Re: [PATCH 5/5][NFS] Cleanup explicit check for mandatory locks
Date: Tue, 18 Sep 2007 10:20:08 +0400 [thread overview]
Message-ID: <46EF6E18.90801@openvz.org> (raw)
In-Reply-To: <1190048620.6700.100.camel@heimdal.trondhjem.org>
Trond Myklebust wrote:
> On Mon, 2007-09-17 at 11:57 +0400, Pavel Emelyanov wrote:
>> The __mandatory_lock(inode) macro makes the same check, but
>> makes the code more readable.
>
> Could we please avoid using underscores in macros. Also, why are we
> breaking the usual convention of capitalising macro names?
Sorry, I've forgot to change all the log - this is not a macro,
but a static inline function. The underscores are here, because
the mandatory_lock() one already exists and additionally checks
for "if (IS_MANDLOCK(inode))"
Thanks,
Pavel
> Cheers
> Trond
>
>> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
>> Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
>>
>> ---
>>
>> fs/nfs/file.c | 3 +--
>> 1 files changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/fs/nfs/file.c b/fs/nfs/file.c
>> index 73ddd2e..7a07be1 100644
>> --- a/fs/nfs/file.c
>> +++ b/fs/nfs/file.c
>> @@ -605,8 +605,7 @@ static int nfs_lock(struct file *filp, i
>> nfs_inc_stats(inode, NFSIOS_VFSLOCK);
>>
>> /* No mandatory locks over NFS */
>> - if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID &&
>> - fl->fl_type != F_UNLCK)
>> + if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
>> return -ENOLCK;
>>
>> if (IS_GETLK(cmd))
>>
>
>
next prev parent reply other threads:[~2007-09-18 6:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-17 7:57 [PATCH 5/5][NFS] Cleanup explicit check for mandatory locks Pavel Emelyanov
2007-09-17 17:03 ` Trond Myklebust
2007-09-18 6:20 ` Pavel Emelyanov [this message]
2007-09-18 13:27 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46EF6E18.90801@openvz.org \
--to=xemul@openvz.org \
--cc=akpm@osdl.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox