OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 3/5][9PFS] Cleanup explicit check for mandatory locks
[PATCH 3/5][9PFS] Cleanup explicit check for mandatory locks [message #20350] Mon, 17 September 2007 07:53 Go to next message
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: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@sandia.gov>
Cc: Latchesar Ionkov <lucho@ionkov.net>

---

 fs/9p/vfs_file.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 2a40c29..7166916 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -105,7 +105,7 @@ static int v9fs_file_lock(struct file *f
 	P9_DPRINTK(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl);
 
 	/* No mandatory locks */
-	if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
+	if (__mandatory_lock(inode))
 		return -ENOLCK;
 
 	if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) {
Re: [PATCH 3/5][9PFS] Cleanup explicit check for mandatory locks [message #20382 is a reply to message #20350] Mon, 17 September 2007 14:51 Go to previous message
Eric Van Hensbergen is currently offline  Eric Van Hensbergen
Messages: 3
Registered: January 2007
Junior Member
On 9/17/07, Pavel Emelyanov <xemul@openvz.org> wrote:
> The __mandatory_lock(inode) macro makes the same check, but
> makes the code more readable.
>
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
>
> ---
>
>  fs/9p/vfs_file.c |    2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
> index 2a40c29..7166916 100644
> --- a/fs/9p/vfs_file.c
> +++ b/fs/9p/vfs_file.c
> @@ -105,7 +105,7 @@ static int v9fs_file_lock(struct file *f
>         P9_DPRINTK(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl);
>
>         /* No mandatory locks */
> -       if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
> +       if (__mandatory_lock(inode))
>                 return -ENOLCK;
>
>         if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) {
>
>
Previous Topic: [PATCH 4/5][AFS] Cleanup explicit check for mandatory locks
Next Topic: [PATCH 01/33] task containersv11 basic task container framework
Goto Forum:
  


Current Time: Sat Jul 13 16:29:19 GMT 2024

Total time taken to generate the page: 0.02277 seconds