Skip to content

Commit 1eb82ef

Browse files
Christoph Hellwigkdave
authored andcommitted
btrfs: remove the bdev argument to btrfs_rmap_block
The only user in the zoned remap code is gone now, so remove the argument. Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 04f0847 commit 1eb82ef

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

fs/btrfs/block-group.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,6 @@ static void set_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags)
19651965
*
19661966
* @fs_info: the filesystem
19671967
* @chunk_start: logical address of block group
1968-
* @bdev: physical device to resolve, can be NULL to indicate any device
19691968
* @physical: physical address to map to logical addresses
19701969
* @logical: return array of logical addresses which map to @physical
19711970
* @naddrs: length of @logical
@@ -1976,8 +1975,7 @@ static void set_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags)
19761975
* block copies.
19771976
*/
19781977
int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start,
1979-
struct block_device *bdev, u64 physical, u64 **logical,
1980-
int *naddrs, int *stripe_len)
1978+
u64 physical, u64 **logical, int *naddrs, int *stripe_len)
19811979
{
19821980
struct extent_map *em;
19831981
struct map_lookup *map;
@@ -2017,9 +2015,6 @@ int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start,
20172015
data_stripe_length))
20182016
continue;
20192017

2020-
if (bdev && map->stripes[i].dev->bdev != bdev)
2021-
continue;
2022-
20232018
stripe_nr = physical - map->stripes[i].physical;
20242019
stripe_nr = div64_u64_rem(stripe_nr, map->stripe_len, &offset);
20252020

@@ -2076,7 +2071,7 @@ static int exclude_super_stripes(struct btrfs_block_group *cache)
20762071

20772072
for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
20782073
bytenr = btrfs_sb_offset(i);
2079-
ret = btrfs_rmap_block(fs_info, cache->start, NULL,
2074+
ret = btrfs_rmap_block(fs_info, cache->start,
20802075
bytenr, &logical, &nr, &stripe_len);
20812076
if (ret)
20822077
return ret;

fs/btrfs/block-group.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,7 @@ u64 btrfs_get_alloc_profile(struct btrfs_fs_info *fs_info, u64 orig_flags);
328328
void btrfs_put_block_group_cache(struct btrfs_fs_info *info);
329329
int btrfs_free_block_groups(struct btrfs_fs_info *info);
330330
int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start,
331-
struct block_device *bdev, u64 physical, u64 **logical,
332-
int *naddrs, int *stripe_len);
331+
u64 physical, u64 **logical, int *naddrs, int *stripe_len);
333332

334333
static inline u64 btrfs_data_alloc_profile(struct btrfs_fs_info *fs_info)
335334
{

fs/btrfs/tests/extent-map-tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ static int test_rmap_block(struct btrfs_fs_info *fs_info,
509509
goto out_free;
510510
}
511511

512-
ret = btrfs_rmap_block(fs_info, em->start, NULL, btrfs_sb_offset(1),
512+
ret = btrfs_rmap_block(fs_info, em->start, btrfs_sb_offset(1),
513513
&logical, &out_ndaddrs, &out_stripe_len);
514514
if (ret || (out_ndaddrs == 0 && test->expected_mapped_addr)) {
515515
test_err("didn't rmap anything but expected %d",

0 commit comments

Comments
 (0)