Merge remote-tracking branch 'wireless-drivers-next/master'
[deliverable/linux.git] / fs / btrfs / inode.c
index e6811c42e41ef34d27119ee5420d4c6653df8519..018e4633029ae8558e5fd6b8992d758618a55888 100644 (file)
@@ -560,8 +560,9 @@ cont:
                         * we don't need to create any more async work items.
                         * Unlock and free up our temp pages.
                         */
-                       extent_clear_unlock_delalloc(inode, start, end, NULL,
-                                                    clear_flags, PAGE_UNLOCK |
+                       extent_clear_unlock_delalloc(inode, start, end, end,
+                                                    NULL, clear_flags,
+                                                    PAGE_UNLOCK |
                                                     PAGE_CLEAR_DIRTY |
                                                     PAGE_SET_WRITEBACK |
                                                     page_error_op |
@@ -835,6 +836,8 @@ retry:
                 * clear dirty, set writeback and unlock the pages.
                 */
                extent_clear_unlock_delalloc(inode, async_extent->start,
+                               async_extent->start +
+                               async_extent->ram_size - 1,
                                async_extent->start +
                                async_extent->ram_size - 1,
                                NULL, EXTENT_LOCKED | EXTENT_DELALLOC,
@@ -856,7 +859,8 @@ retry:
                        tree->ops->writepage_end_io_hook(p, start, end,
                                                         NULL, 0);
                        p->mapping = NULL;
-                       extent_clear_unlock_delalloc(inode, start, end, NULL, 0,
+                       extent_clear_unlock_delalloc(inode, start, end, end,
+                                                    NULL, 0,
                                                     PAGE_END_WRITEBACK |
                                                     PAGE_SET_ERROR);
                        free_async_extent_pages(async_extent);
@@ -871,6 +875,8 @@ out_free_reserve:
        btrfs_free_reserved_extent(root, ins.objectid, ins.offset, 1);
 out_free:
        extent_clear_unlock_delalloc(inode, async_extent->start,
+                                    async_extent->start +
+                                    async_extent->ram_size - 1,
                                     async_extent->start +
                                     async_extent->ram_size - 1,
                                     NULL, EXTENT_LOCKED | EXTENT_DELALLOC |
@@ -966,7 +972,8 @@ static noinline int cow_file_range(struct inode *inode,
                ret = cow_file_range_inline(root, inode, start, end, 0, 0,
                                            NULL);
                if (ret == 0) {
-                       extent_clear_unlock_delalloc(inode, start, end, NULL,
+                       extent_clear_unlock_delalloc(inode, start, end,
+                                    delalloc_end, NULL,
                                     EXTENT_LOCKED | EXTENT_DELALLOC |
                                     EXTENT_DEFRAG, PAGE_UNLOCK |
                                     PAGE_CLEAR_DIRTY | PAGE_SET_WRITEBACK |
@@ -1062,7 +1069,8 @@ static noinline int cow_file_range(struct inode *inode,
                op |= PAGE_SET_PRIVATE2;
 
                extent_clear_unlock_delalloc(inode, start,
-                                            start + ram_size - 1, locked_page,
+                                            start + ram_size - 1,
+                                            delalloc_end, locked_page,
                                             EXTENT_LOCKED | EXTENT_DELALLOC,
                                             op);
                disk_num_bytes -= cur_alloc_size;
@@ -1079,7 +1087,8 @@ out_reserve:
        btrfs_dec_block_group_reservations(root->fs_info, ins.objectid);
        btrfs_free_reserved_extent(root, ins.objectid, ins.offset, 1);
 out_unlock:
-       extent_clear_unlock_delalloc(inode, start, end, locked_page,
+       extent_clear_unlock_delalloc(inode, start, end, delalloc_end,
+                                    locked_page,
                                     EXTENT_LOCKED | EXTENT_DO_ACCOUNTING |
                                     EXTENT_DELALLOC | EXTENT_DEFRAG,
                                     PAGE_UNLOCK | PAGE_CLEAR_DIRTY |
@@ -1258,7 +1267,8 @@ static noinline int run_delalloc_nocow(struct inode *inode,
 
        path = btrfs_alloc_path();
        if (!path) {
-               extent_clear_unlock_delalloc(inode, start, end, locked_page,
+               extent_clear_unlock_delalloc(inode, start, end, end,
+                                            locked_page,
                                             EXTENT_LOCKED | EXTENT_DELALLOC |
                                             EXTENT_DO_ACCOUNTING |
                                             EXTENT_DEFRAG, PAGE_UNLOCK |
@@ -1276,7 +1286,8 @@ static noinline int run_delalloc_nocow(struct inode *inode,
                trans = btrfs_join_transaction(root);
 
        if (IS_ERR(trans)) {
-               extent_clear_unlock_delalloc(inode, start, end, locked_page,
+               extent_clear_unlock_delalloc(inode, start, end, end,
+                                            locked_page,
                                             EXTENT_LOCKED | EXTENT_DELALLOC |
                                             EXTENT_DO_ACCOUNTING |
                                             EXTENT_DEFRAG, PAGE_UNLOCK |
@@ -1490,7 +1501,7 @@ out_check:
                }
 
                extent_clear_unlock_delalloc(inode, cur_offset,
-                                            cur_offset + num_bytes - 1,
+                                            cur_offset + num_bytes - 1, end,
                                             locked_page, EXTENT_LOCKED |
                                             EXTENT_DELALLOC |
                                             EXTENT_CLEAR_DATA_RESV,
@@ -1522,7 +1533,7 @@ error:
                ret = err;
 
        if (ret && cur_offset < end)
-               extent_clear_unlock_delalloc(inode, cur_offset, end,
+               extent_clear_unlock_delalloc(inode, cur_offset, end, end,
                                             locked_page, EXTENT_LOCKED |
                                             EXTENT_DELALLOC | EXTENT_DEFRAG |
                                             EXTENT_DO_ACCOUNTING, PAGE_UNLOCK |
@@ -1988,7 +1999,7 @@ static noinline int add_pending_csums(struct btrfs_trans_handle *trans,
 }
 
 int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end,
-                             struct extent_state **cached_state)
+                             struct extent_state **cached_state, int dedupe)
 {
        WARN_ON((end & (PAGE_SIZE - 1)) == 0);
        return set_extent_delalloc(&BTRFS_I(inode)->io_tree, start, end,
@@ -2052,7 +2063,8 @@ again:
                goto out;
         }
 
-       btrfs_set_extent_delalloc(inode, page_start, page_end, &cached_state);
+       btrfs_set_extent_delalloc(inode, page_start, page_end, &cached_state,
+                                 0);
        ClearPageChecked(page);
        set_page_dirty(page);
 out:
@@ -3936,7 +3948,7 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans,
         */
        if (!btrfs_is_free_space_inode(inode)
            && root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID
-           && !root->fs_info->log_root_recovering) {
+           && !test_bit(BTRFS_FS_LOG_RECOVERING, &root->fs_info->flags)) {
                btrfs_update_root_times(trans, root);
 
                ret = btrfs_delayed_update_inode(trans, root, inode);
@@ -4757,7 +4769,7 @@ again:
                          0, 0, &cached_state, GFP_NOFS);
 
        ret = btrfs_set_extent_delalloc(inode, block_start, block_end,
-                                       &cached_state);
+                                       &cached_state, 0);
        if (ret) {
                unlock_extent_cached(io_tree, block_start, block_end,
                                     &cached_state, GFP_NOFS);
@@ -5223,7 +5235,7 @@ void btrfs_evict_inode(struct inode *inode)
 
        btrfs_free_io_failure_record(inode, 0, (u64)-1);
 
-       if (root->fs_info->log_root_recovering) {
+       if (test_bit(BTRFS_FS_LOG_RECOVERING, &root->fs_info->flags)) {
                BUG_ON(test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
                                 &BTRFS_I(inode)->runtime_flags));
                goto no_delete;
@@ -9054,7 +9066,7 @@ again:
                          0, 0, &cached_state, GFP_NOFS);
 
        ret = btrfs_set_extent_delalloc(inode, page_start, end,
-                                       &cached_state);
+                                       &cached_state, 0);
        if (ret) {
                unlock_extent_cached(io_tree, page_start, page_end,
                                     &cached_state, GFP_NOFS);
@@ -10566,7 +10578,7 @@ static const struct inode_operations btrfs_dir_inode_operations = {
        .link           = btrfs_link,
        .mkdir          = btrfs_mkdir,
        .rmdir          = btrfs_rmdir,
-       .rename2        = btrfs_rename2,
+       .rename         = btrfs_rename2,
        .symlink        = btrfs_symlink,
        .setattr        = btrfs_setattr,
        .mknod          = btrfs_mknod,
This page took 0.029192 seconds and 5 git commands to generate.