btrfs-progs: Remove devid parameter from btrfs_rmap_block

This parameter was introduced with the original implementation of the
function but has never really been used, so just remove it.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Nikolay Borisov 2018-05-04 10:47:25 +03:00 committed by David Sterba
parent 402ac7a140
commit 873fba7101
4 changed files with 11 additions and 14 deletions

View File

@ -5147,7 +5147,7 @@ static int check_cache_range(struct btrfs_root *root,
for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
bytenr = btrfs_sb_offset(i);
ret = btrfs_rmap_block(root->fs_info,
cache->key.objectid, bytenr, 0,
cache->key.objectid, bytenr,
&logical, &nr, &stripe_len);
if (ret)
return ret;

View File

@ -75,7 +75,7 @@ static int remove_sb_from_cache(struct btrfs_root *root,
free_space_cache = &fs_info->free_space_cache;
for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
bytenr = btrfs_sb_offset(i);
ret = btrfs_rmap_block(fs_info, cache->key.objectid, bytenr, 0,
ret = btrfs_rmap_block(fs_info, cache->key.objectid, bytenr,
&logical, &nr, &stripe_len);
BUG_ON(ret);
while (nr--) {
@ -699,7 +699,7 @@ again:
if (key.objectid != bytenr ||
key.type != BTRFS_EXTENT_DATA_REF_KEY)
goto fail;
ref = btrfs_item_ptr(leaf, path->slots[0],
struct btrfs_extent_data_ref);
@ -1403,7 +1403,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
err = ret;
goto out;
}
leaf = path->nodes[0];
item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item);
refs = btrfs_extent_refs(leaf, item);
@ -1666,7 +1666,7 @@ static int __btrfs_mod_ref(struct btrfs_trans_handle *trans,
bytenr = btrfs_file_extent_disk_bytenr(buf, fi);
if (bytenr == 0)
continue;
num_bytes = btrfs_file_extent_disk_num_bytes(buf, fi);
key.offset -= btrfs_file_extent_offset(buf, fi);
ret = process_func(trans, root, bytenr, num_bytes,
@ -3181,7 +3181,7 @@ static void account_super_bytes(struct btrfs_fs_info *fs_info,
bytenr = btrfs_sb_offset(i);
ret = btrfs_rmap_block(fs_info,
cache->key.objectid, bytenr,
0, &logical, &nr, &stripe_len);
&logical, &nr, &stripe_len);
if (ret)
return;
@ -4180,7 +4180,7 @@ int exclude_super_stripes(struct btrfs_root *root,
bytenr = btrfs_sb_offset(i);
ret = btrfs_rmap_block(root->fs_info,
cache->key.objectid, bytenr,
0, &logical, &nr, &stripe_len);
&logical, &nr, &stripe_len);
if (ret)
return ret;

View File

@ -1364,9 +1364,8 @@ int btrfs_next_bg(struct btrfs_fs_info *fs_info, u64 *logical,
return -ENOENT;
}
int btrfs_rmap_block(struct btrfs_fs_info *fs_info,
u64 chunk_start, u64 physical, u64 devid,
u64 **logical, int *naddrs, int *stripe_len)
int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start,
u64 physical, u64 **logical, int *naddrs, int *stripe_len)
{
struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree;
struct cache_extent *ce;
@ -1397,8 +1396,6 @@ int btrfs_rmap_block(struct btrfs_fs_info *fs_info,
buf = kzalloc(sizeof(u64) * map->num_stripes, GFP_NOFS);
for (i = 0; i < map->num_stripes; i++) {
if (devid && map->stripes[i].dev->devid != devid)
continue;
if (map->stripes[i].physical > physical ||
map->stripes[i].physical + length <= physical)
continue;

View File

@ -254,8 +254,8 @@ static inline int btrfs_next_bg_system(struct btrfs_fs_info *fs_info,
BTRFS_BLOCK_GROUP_SYSTEM);
}
int btrfs_rmap_block(struct btrfs_fs_info *fs_info,
u64 chunk_start, u64 physical, u64 devid,
u64 **logical, int *naddrs, int *stripe_len);
u64 chunk_start, u64 physical, u64 **logical,
int *naddrs, int *stripe_len);
int btrfs_read_sys_array(struct btrfs_fs_info *fs_info);
int btrfs_read_chunk_tree(struct btrfs_fs_info *fs_info);
int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,