locks: add a dedicated spinlock to protect i_flctx lists
[linux-2.6-block.git] / fs / cifs / file.c
index ea78f6f81ce299532939c28bb4e2b031b10a687e..b65166eb111ee7b8c2f538c68440c37469e2d39d 100644 (file)
@@ -1136,11 +1136,11 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
        if (!flctx)
                goto out;
 
-       spin_lock(&inode->i_lock);
+       spin_lock(&flctx->flc_lock);
        list_for_each(el, &flctx->flc_posix) {
                count++;
        }
-       spin_unlock(&inode->i_lock);
+       spin_unlock(&flctx->flc_lock);
 
        INIT_LIST_HEAD(&locks_to_send);
 
@@ -1159,7 +1159,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
        }
 
        el = locks_to_send.next;
-       spin_lock(&inode->i_lock);
+       spin_lock(&flctx->flc_lock);
        list_for_each_entry(flock, &flctx->flc_posix, fl_list) {
                if (el == &locks_to_send) {
                        /*
@@ -1181,7 +1181,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
                lck->type = type;
                lck->offset = flock->fl_start;
        }
-       spin_unlock(&inode->i_lock);
+       spin_unlock(&flctx->flc_lock);
 
        list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) {
                int stored_rc;