btrfs: adjust while loop condition in run_delalloc_nocow

We have the following pattern

while (1) {
	if (cur_offset > end)
		break;
}

Which is just

while (cur_offset <= end) {
	...
}

so adjust the code to be more clear.

Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2024-02-12 16:27:15 -05:00 committed by David Sterba
parent 7c9acd440f
commit 0ed30c17f6

View File

@ -1988,7 +1988,7 @@ static noinline int run_delalloc_nocow(struct btrfs_inode *inode,
nocow_args.end = end; nocow_args.end = end;
nocow_args.writeback_path = true; nocow_args.writeback_path = true;
while (1) { while (cur_offset <= end) {
struct btrfs_block_group *nocow_bg = NULL; struct btrfs_block_group *nocow_bg = NULL;
struct btrfs_ordered_extent *ordered; struct btrfs_ordered_extent *ordered;
struct btrfs_key found_key; struct btrfs_key found_key;
@ -2192,8 +2192,6 @@ must_cow:
*/ */
if (ret) if (ret)
goto error; goto error;
if (cur_offset > end)
break;
} }
btrfs_release_path(path); btrfs_release_path(path);