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: Pavel Emelyanov <xemul@openvz.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Pavel Emelyanov 2007-10-01 14:41:14 -07:00 коммит произвёл J. Bruce Fields
Родитель 66abe5f257
Коммит fc5846e555
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -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);
/* AFS doesn't support mandatory locks */
if ((vnode->vfs_inode.i_mode & (S_ISGID | S_IXGRP)) == S_ISGID &&
fl->fl_type != F_UNLCK)
if (__mandatory_lock(&vnode->vfs_inode) && fl->fl_type != F_UNLCK)
return -ENOLCK;
if (IS_GETLK(cmd))