locks: protect most of the file_lock handling with i_lock
[linux-2.6-block.git] / fs / nfs / nfs4state.c
index 1fab140764c42756867f064a81b61903b8858a91..ff10b4aa534c0d855408ac5ec0dbb2a8c7cf92ba 100644 (file)
@@ -1373,13 +1373,13 @@ static int nfs4_reclaim_locks(struct nfs4_state *state, const struct nfs4_state_
        /* Guard against delegation returns and new lock/unlock calls */
        down_write(&nfsi->rwsem);
        /* Protect inode->i_flock using the BKL */
-       lock_flocks();
+       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)->state != state)
                        continue;
-               unlock_flocks();
+               spin_unlock(&inode->i_lock);
                status = ops->recover_lock(state, fl);
                switch (status) {
                        case 0:
@@ -1406,9 +1406,9 @@ static int nfs4_reclaim_locks(struct nfs4_state *state, const struct nfs4_state_
                                /* kill_proc(fl->fl_pid, SIGLOST, 1); */
                                status = 0;
                }
-               lock_flocks();
+               spin_lock(&inode->i_lock);
        }
-       unlock_flocks();
+       spin_unlock(&inode->i_lock);
 out:
        up_write(&nfsi->rwsem);
        return status;