drm/radeon: fix PM on non-vram cards.
[safe/jmp/linux-2.6] / fs / afs / flock.c
index af6952e..0931bc1 100644 (file)
@@ -21,7 +21,7 @@ static void afs_fl_release_private(struct file_lock *fl);
 static struct workqueue_struct *afs_lock_manager;
 static DEFINE_MUTEX(afs_lock_manager_mutex);
 
-static struct file_lock_operations afs_lock_ops = {
+static const struct file_lock_operations afs_lock_ops = {
        .fl_copy_lock           = afs_fl_copy_lock,
        .fl_release_private     = afs_fl_release_private,
 };
@@ -432,7 +432,6 @@ vfs_rejected_lock:
        list_del_init(&fl->fl_u.afs.link);
        if (list_empty(&vnode->granted_locks))
                afs_defer_unlock(vnode, key);
-       spin_unlock(&vnode->lock);
        goto abort_attempt;
 }
 
@@ -524,8 +523,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))