diff options
author | Josef Bacik <josef@toxicpanda.com> | 2024-02-12 16:27:15 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2024-05-07 21:31:09 +0200 |
commit | 0ed30c17f699d5df73c445999b0114c5859d1145 (patch) | |
tree | 24167ec2878c09fc8b1d17f590a152a4629ed96e /fs/btrfs | |
parent | 7c9acd440f4d1124122639928ac4ff69082bbd3a (diff) | |
download | linux-stable-0ed30c17f699d5df73c445999b0114c5859d1145.tar.gz linux-stable-0ed30c17f699d5df73c445999b0114c5859d1145.tar.bz2 linux-stable-0ed30c17f699d5df73c445999b0114c5859d1145.zip |
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d8037775ab75..2fe82614521c 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1988,7 +1988,7 @@ static noinline int run_delalloc_nocow(struct btrfs_inode *inode, nocow_args.end = end; nocow_args.writeback_path = true; - while (1) { + while (cur_offset <= end) { struct btrfs_block_group *nocow_bg = NULL; struct btrfs_ordered_extent *ordered; struct btrfs_key found_key; @@ -2192,8 +2192,6 @@ must_cow: */ if (ret) goto error; - if (cur_offset > end) - break; } btrfs_release_path(path); |