btrfs-progs: mkfs: delete un-used parameter fd
[platform/upstream/btrfs-progs.git] / btrfs-corrupt-block.c
index 5649a00..3269de5 100644 (file)
@@ -47,9 +47,8 @@ static int debug_corrupt_block(struct extent_buffer *eb,
 
        length = blocksize;
        while (1) {
-               ret = btrfs_map_block(&root->fs_info->mapping_tree, READ,
-                                     eb->start, &length, &multi,
-                                     mirror_num, NULL);
+               ret = btrfs_map_block(root->fs_info, READ, eb->start, &length,
+                                     &multi, mirror_num, NULL);
                if (ret) {
                        error("cannot map block %llu length %llu mirror %d: %d",
                                        (unsigned long long)eb->start,
@@ -89,8 +88,8 @@ static int debug_corrupt_block(struct extent_buffer *eb,
                        fsync(eb->fd);
                }
 
-               num_copies = btrfs_num_copies(&root->fs_info->mapping_tree,
-                                             eb->start, eb->len);
+               num_copies = btrfs_num_copies(root->fs_info, eb->start,
+                                             eb->len);
                if (num_copies == 1)
                        break;
 
@@ -169,7 +168,7 @@ static int corrupt_keys_in_block(struct btrfs_fs_info *fs_info, u64 bytenr)
 {
        struct extent_buffer *eb;
 
-       eb = read_tree_block_fs_info(fs_info, bytenr, fs_info->nodesize, 0);
+       eb = read_tree_block(fs_info, bytenr, fs_info->nodesize, 0);
        if (!extent_buffer_uptodate(eb))
                return -EIO;;
 
@@ -278,6 +277,7 @@ static void btrfs_corrupt_extent_tree(struct btrfs_trans_handle *trans,
                                      struct btrfs_root *root,
                                      struct extent_buffer *eb)
 {
+       struct btrfs_fs_info *fs_info = root->fs_info;
        int i;
 
        if (!eb)
@@ -296,8 +296,8 @@ static void btrfs_corrupt_extent_tree(struct btrfs_trans_handle *trans,
        for (i = 0; i < btrfs_header_nritems(eb); i++) {
                struct extent_buffer *next;
 
-               next = read_tree_block(root, btrfs_node_blockptr(eb, i),
-                                      root->fs_info->nodesize,
+               next = read_tree_block(fs_info, btrfs_node_blockptr(eb, i),
+                                      fs_info->nodesize,
                                       btrfs_node_ptr_generation(eb, i));
                if (!extent_buffer_uptodate(next))
                        continue;
@@ -765,7 +765,7 @@ static int corrupt_metadata_block(struct btrfs_fs_info *fs_info, u64 block,
                return -EINVAL;
        }
 
-       eb = read_tree_block_fs_info(fs_info, block, fs_info->nodesize, 0);
+       eb = read_tree_block(fs_info, block, fs_info->nodesize, 0);
        if (!extent_buffer_uptodate(eb)) {
                fprintf(stderr, "Couldn't read in tree block %s\n", field);
                return -EINVAL;