Skip to content

Commit 0ed30c1

Browse files
josefbacikkdave
authored andcommitted
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>
1 parent 7c9acd4 commit 0ed30c1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/btrfs/inode.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,7 @@ static noinline int run_delalloc_nocow(struct btrfs_inode *inode,
19881988
nocow_args.end = end;
19891989
nocow_args.writeback_path = true;
19901990

1991-
while (1) {
1991+
while (cur_offset <= end) {
19921992
struct btrfs_block_group *nocow_bg = NULL;
19931993
struct btrfs_ordered_extent *ordered;
19941994
struct btrfs_key found_key;
@@ -2192,8 +2192,6 @@ static noinline int run_delalloc_nocow(struct btrfs_inode *inode,
21922192
*/
21932193
if (ret)
21942194
goto error;
2195-
if (cur_offset > end)
2196-
break;
21972195
}
21982196
btrfs_release_path(path);
21992197

0 commit comments

Comments
 (0)