u64 *orig_start, u64 *orig_block_len,
                              u64 *ram_bytes, bool nowait, bool strict);
 
-void __btrfs_del_delalloc_inode(struct btrfs_inode *inode);
+void btrfs_del_delalloc_inode(struct btrfs_inode *inode);
 struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry);
 int btrfs_set_inode_index(struct btrfs_inode *dir, u64 *index);
 int btrfs_unlink_inode(struct btrfs_trans_handle *trans,
 
                struct inode *inode = NULL;
                btrfs_inode = list_first_entry(&splice, struct btrfs_inode,
                                               delalloc_inodes);
-               __btrfs_del_delalloc_inode(btrfs_inode);
+               btrfs_del_delalloc_inode(btrfs_inode);
                spin_unlock(&root->delalloc_lock);
 
                /*
 
        spin_unlock(&root->delalloc_lock);
 }
 
-void __btrfs_del_delalloc_inode(struct btrfs_inode *inode)
+void btrfs_del_delalloc_inode(struct btrfs_inode *inode)
 {
        struct btrfs_root *root = inode->root;
        struct btrfs_fs_info *fs_info = root->fs_info;
        }
 }
 
-static void btrfs_del_delalloc_inode(struct btrfs_inode *inode)
-{
-       spin_lock(&inode->root->delalloc_lock);
-       __btrfs_del_delalloc_inode(inode);
-       spin_unlock(&inode->root->delalloc_lock);
-}
-
 /*
  * Properly track delayed allocation bytes in the inode and to maintain the
  * list of inodes that have pending delalloc work to be done.
                 * and are therefore protected against concurrent calls of this
                 * function and btrfs_set_delalloc_extent().
                 */
-               if (!btrfs_is_free_space_inode(inode) && new_delalloc_bytes == 0)
+               if (!btrfs_is_free_space_inode(inode) && new_delalloc_bytes == 0) {
+                       spin_lock(&root->delalloc_lock);
                        btrfs_del_delalloc_inode(inode);
+                       spin_unlock(&root->delalloc_lock);
+               }
        }
 
        if ((state->state & EXTENT_DELALLOC_NEW) &&