Commit fc5846e5 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by J. Bruce Fields

AFS: clean up explicit check for mandatory locks

The __mandatory_lock(inode) macro makes the same check, but makes the code
more readable.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 66abe5f2
...@@ -524,8 +524,7 @@ int afs_lock(struct file *file, int cmd, struct file_lock *fl) ...@@ -524,8 +524,7 @@ int afs_lock(struct file *file, int cmd, struct file_lock *fl)
(long long) fl->fl_start, (long long) fl->fl_end); (long long) fl->fl_start, (long long) fl->fl_end);
/* AFS doesn't support mandatory locks */ /* AFS doesn't support mandatory locks */
if ((vnode->vfs_inode.i_mode & (S_ISGID | S_IXGRP)) == S_ISGID && if (__mandatory_lock(&vnode->vfs_inode) && fl->fl_type != F_UNLCK)
fl->fl_type != F_UNLCK)
return -ENOLCK; return -ENOLCK;
if (IS_GETLK(cmd)) if (IS_GETLK(cmd))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment