diff options
author | Filipe Manana <fdmanana@suse.com> | 2023-06-30 17:03:49 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-08-21 14:52:12 +0200 |
commit | e5860f8207ed341502ecee80688cef93e367b615 (patch) | |
tree | 067d1eec30e7dc7109bb1fe3a77a0ab72d1a9c88 /fs/btrfs/relocation.c | |
parent | btrfs: make btrfs_destroy_pinned_extent() return void (diff) | |
download | linux-e5860f8207ed341502ecee80688cef93e367b615.tar.xz linux-e5860f8207ed341502ecee80688cef93e367b615.zip |
btrfs: make find_first_extent_bit() return a boolean
Currently find_first_extent_bit() returns a 0 if it found a range in the
given io tree and 1 if it didn't find any. There's no need to return any
errors, so make the return value a boolean and invert the logic to make
more sense: return true if it found a range and false if it didn't find
any range.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 46c3c1d57266..8ff0e9dcf85c 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3498,6 +3498,8 @@ int find_next_extent(struct reloc_control *rc, struct btrfs_path *path, last = rc->block_group->start + rc->block_group->length; while (1) { + bool block_found; + cond_resched(); if (rc->search_start >= last) { ret = 1; @@ -3548,11 +3550,11 @@ next: goto next; } - ret = find_first_extent_bit(&rc->processed_blocks, - key.objectid, &start, &end, - EXTENT_DIRTY, NULL); + block_found = find_first_extent_bit(&rc->processed_blocks, + key.objectid, &start, &end, + EXTENT_DIRTY, NULL); - if (ret == 0 && start <= key.objectid) { + if (block_found && start <= key.objectid) { btrfs_release_path(path); rc->search_start = end + 1; } else { |