OSDN Git Service

btrfs: Remove leftover of in-band dedupe
authorNikolay Borisov <nborisov@suse.com>
Wed, 17 Jul 2019 13:18:17 +0000 (16:18 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:58:59 +0000 (14:58 +0200)
It's unlikely in-band dedupe is going to land so just remove any
leftovers - dedupe.h header as well as the 'dedupe' parameter to
btrfs_set_extent_delalloc.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/dedupe.h [deleted file]
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/relocation.c
fs/btrfs/tests/inode-tests.c

index 6709730..d2807b9 100644 (file)
@@ -3147,7 +3147,7 @@ int btrfs_start_delalloc_snapshot(struct btrfs_root *root);
 int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, int nr);
 int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end,
                              unsigned int extra_bits,
-                             struct extent_state **cached_state, int dedupe);
+                             struct extent_state **cached_state);
 int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
                             struct btrfs_root *new_root,
                             struct btrfs_root *parent_root,
diff --git a/fs/btrfs/dedupe.h b/fs/btrfs/dedupe.h
deleted file mode 100644 (file)
index 90281a7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright (C) 2016 Fujitsu.  All rights reserved.
- */
-
-#ifndef BTRFS_DEDUPE_H
-#define BTRFS_DEDUPE_H
-
-/* later in-band dedupe will expand this struct */
-struct btrfs_dedupe_hash;
-
-#endif
index 474ff1c..b31991f 100644 (file)
@@ -559,7 +559,7 @@ int btrfs_dirty_pages(struct inode *inode, struct page **pages,
        }
 
        err = btrfs_set_extent_delalloc(inode, start_pos, end_of_last_block,
-                                       extra_bits, cached, 0);
+                                       extra_bits, cached);
        if (err)
                return err;
 
index d038fc6..c3feb53 100644 (file)
@@ -46,7 +46,6 @@
 #include "backref.h"
 #include "props.h"
 #include "qgroup.h"
-#include "dedupe.h"
 #include "delalloc-space.h"
 
 struct btrfs_iget_args {
@@ -81,8 +80,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent);
 static noinline int cow_file_range(struct inode *inode,
                                   struct page *locked_page,
                                   u64 start, u64 end, int *page_started,
-                                  unsigned long *nr_written, int unlock,
-                                  struct btrfs_dedupe_hash *hash);
+                                  unsigned long *nr_written, int unlock);
 static struct extent_map *create_io_em(struct inode *inode, u64 start, u64 len,
                                       u64 orig_start, u64 block_start,
                                       u64 block_len, u64 orig_block_len,
@@ -762,8 +760,7 @@ retry:
                                             async_extent->start,
                                             async_extent->start +
                                             async_extent->ram_size - 1,
-                                            &page_started, &nr_written, 0,
-                                            NULL);
+                                            &page_started, &nr_written, 0);
 
                        /* JDM XXX */
 
@@ -948,8 +945,7 @@ static u64 get_extent_allocation_hint(struct inode *inode, u64 start,
 static noinline int cow_file_range(struct inode *inode,
                                   struct page *locked_page,
                                   u64 start, u64 end, int *page_started,
-                                  unsigned long *nr_written, int unlock,
-                                  struct btrfs_dedupe_hash *hash)
+                                  unsigned long *nr_written, int unlock)
 {
        struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
        struct btrfs_root *root = BTRFS_I(inode)->root;
@@ -1506,8 +1502,7 @@ out_check:
                if (cow_start != (u64)-1) {
                        ret = cow_file_range(inode, locked_page,
                                             cow_start, found_key.offset - 1,
-                                            page_started, nr_written, 1,
-                                            NULL);
+                                            page_started, nr_written, 1);
                        if (ret) {
                                if (nocow)
                                        btrfs_dec_nocow_writers(fs_info,
@@ -1586,7 +1581,7 @@ out_check:
        if (cow_start != (u64)-1) {
                cur_offset = end;
                ret = cow_file_range(inode, locked_page, cow_start, end,
-                                    page_started, nr_written, 1, NULL);
+                                    page_started, nr_written, 1);
                if (ret)
                        goto error;
        }
@@ -1645,7 +1640,7 @@ int btrfs_run_delalloc_range(struct inode *inode, struct page *locked_page,
        } else if (!inode_can_compress(inode) ||
                   !inode_need_compress(inode, start, end)) {
                ret = cow_file_range(inode, locked_page, start, end,
-                                     page_started, nr_written, 1, NULL);
+                                     page_started, nr_written, 1);
        } else {
                set_bit(BTRFS_INODE_HAS_ASYNC_EXTENT,
                        &BTRFS_I(inode)->runtime_flags);
@@ -2080,7 +2075,7 @@ static noinline int add_pending_csums(struct btrfs_trans_handle *trans,
 
 int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end,
                              unsigned int extra_bits,
-                             struct extent_state **cached_state, int dedupe)
+                             struct extent_state **cached_state)
 {
        WARN_ON(PAGE_ALIGNED(end));
        return set_extent_delalloc(&BTRFS_I(inode)->io_tree, start, end,
@@ -2146,7 +2141,7 @@ again:
         }
 
        ret = btrfs_set_extent_delalloc(inode, page_start, page_end, 0,
-                                       &cached_state, 0);
+                                       &cached_state);
        if (ret) {
                mapping_set_error(page->mapping, ret);
                end_extent_writepage(page, ret, page_start, page_end);
@@ -4941,7 +4936,7 @@ again:
                          0, 0, &cached_state);
 
        ret = btrfs_set_extent_delalloc(inode, block_start, block_end, 0,
-                                       &cached_state, 0);
+                                       &cached_state);
        if (ret) {
                unlock_extent_cached(io_tree, block_start, block_end,
                                     &cached_state);
@@ -8992,7 +8987,7 @@ again:
                          0, 0, &cached_state);
 
        ret2 = btrfs_set_extent_delalloc(inode, page_start, end, 0,
-                                       &cached_state, 0);
+                                       &cached_state);
        if (ret2) {
                unlock_extent_cached(io_tree, page_start, page_end,
                                     &cached_state);
index 7f21985..7ec632d 100644 (file)
@@ -3311,7 +3311,7 @@ static int relocate_file_extent_cluster(struct inode *inode,
                }
 
                ret = btrfs_set_extent_delalloc(inode, page_start, page_end, 0,
-                                               NULL, 0);
+                                               NULL);
                if (ret) {
                        unlock_page(page);
                        put_page(page);
index bc6dbd1..b363fb9 100644 (file)
@@ -957,7 +957,7 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
 
        /* [BTRFS_MAX_EXTENT_SIZE] */
        ret = btrfs_set_extent_delalloc(inode, 0, BTRFS_MAX_EXTENT_SIZE - 1, 0,
-                                       NULL, 0);
+                                       NULL);
        if (ret) {
                test_err("btrfs_set_extent_delalloc returned %d", ret);
                goto out;
@@ -972,7 +972,7 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
        /* [BTRFS_MAX_EXTENT_SIZE][sectorsize] */
        ret = btrfs_set_extent_delalloc(inode, BTRFS_MAX_EXTENT_SIZE,
                                        BTRFS_MAX_EXTENT_SIZE + sectorsize - 1,
-                                       0, NULL, 0);
+                                       0, NULL);
        if (ret) {
                test_err("btrfs_set_extent_delalloc returned %d", ret);
                goto out;
@@ -1005,7 +1005,7 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
        ret = btrfs_set_extent_delalloc(inode, BTRFS_MAX_EXTENT_SIZE >> 1,
                                        (BTRFS_MAX_EXTENT_SIZE >> 1)
                                        + sectorsize - 1,
-                                       0, NULL, 0);
+                                       0, NULL);
        if (ret) {
                test_err("btrfs_set_extent_delalloc returned %d", ret);
                goto out;
@@ -1023,7 +1023,7 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
        ret = btrfs_set_extent_delalloc(inode,
                        BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize,
                        (BTRFS_MAX_EXTENT_SIZE << 1) + 3 * sectorsize - 1,
-                       0, NULL, 0);
+                       0, NULL);
        if (ret) {
                test_err("btrfs_set_extent_delalloc returned %d", ret);
                goto out;
@@ -1040,7 +1040,7 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
        */
        ret = btrfs_set_extent_delalloc(inode,
                        BTRFS_MAX_EXTENT_SIZE + sectorsize,
-                       BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL, 0);
+                       BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL);
        if (ret) {
                test_err("btrfs_set_extent_delalloc returned %d", ret);
                goto out;
@@ -1075,7 +1075,7 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
         */
        ret = btrfs_set_extent_delalloc(inode,
                        BTRFS_MAX_EXTENT_SIZE + sectorsize,
-                       BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL, 0);
+                       BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL);
        if (ret) {
                test_err("btrfs_set_extent_delalloc returned %d", ret);
                goto out;