locks: protect most of the file_lock handling with i_lock
[linux-2.6-block.git] / fs / nfs / delegation.c
index 57db3244f4d967dd5479dbf3ab883c6d28cc2cbd..7ec4814e298d4d957fd4bfa17cb59de20e429ba9 100644 (file)
@@ -73,20 +73,20 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
        if (inode->i_flock == NULL)
                goto out;
 
-       /* Protect inode->i_flock using the file locks lock */
-       lock_flocks();
+       /* Protect inode->i_flock using the i_lock */
+       spin_lock(&inode->i_lock);
        for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
                if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
                        continue;
                if (nfs_file_open_context(fl->fl_file) != ctx)
                        continue;
-               unlock_flocks();
+               spin_unlock(&inode->i_lock);
                status = nfs4_lock_delegation_recall(fl, state, stateid);
                if (status < 0)
                        goto out;
-               lock_flocks();
+               spin_lock(&inode->i_lock);
        }
-       unlock_flocks();
+       spin_unlock(&inode->i_lock);
 out:
        return status;
 }