locks: add a dedicated spinlock to protect i_flctx lists
[linux-2.6-block.git] / fs / nfs / delegation.c
index 3fb1caa3874d6c8b056be429800e86c69de39f8c..8cdb2b28a104c89216125c1c274ef94895121f07 100644 (file)
@@ -93,22 +93,22 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
                goto out;
 
        list = &flctx->flc_posix;
-       spin_lock(&inode->i_lock);
+       spin_lock(&flctx->flc_lock);
 restart:
        list_for_each_entry(fl, list, fl_list) {
                if (nfs_file_open_context(fl->fl_file) != ctx)
                        continue;
-               spin_unlock(&inode->i_lock);
+               spin_unlock(&flctx->flc_lock);
                status = nfs4_lock_delegation_recall(fl, state, stateid);
                if (status < 0)
                        goto out;
-               spin_lock(&inode->i_lock);
+               spin_lock(&flctx->flc_lock);
        }
        if (list == &flctx->flc_posix) {
                list = &flctx->flc_flock;
                goto restart;
        }
-       spin_unlock(&inode->i_lock);
+       spin_unlock(&flctx->flc_lock);
 out:
        return status;
 }