Skip to content

Commit 9435be7

Browse files
Lotte-Baikdave
authored andcommitted
btrfs: zoned: remove redundant condition in btrfs_run_delalloc_range
The logic !A || A && B is equivalent to !A || B. so we can make code clear. Note: though it's preferred to be in the more human readable form, there have been repeated reports and patches as the expression is detected by tools so apply it to reduce the load. Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Haowen Bai <[email protected]> Reviewed-by: David Sterba <[email protected]> [ add note ] Signed-off-by: David Sterba <[email protected]>
1 parent 60021bd commit 9435be7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/btrfs/inode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,8 +2016,7 @@ int btrfs_run_delalloc_range(struct btrfs_inode *inode, struct page *locked_page
20162016
* to use run_delalloc_nocow() here, like for regular
20172017
* preallocated inodes.
20182018
*/
2019-
ASSERT(!zoned ||
2020-
(zoned && btrfs_is_data_reloc_root(inode->root)));
2019+
ASSERT(!zoned || btrfs_is_data_reloc_root(inode->root));
20212020
ret = run_delalloc_nocow(inode, locked_page, start, end,
20222021
page_started, nr_written);
20232022
} else if (!inode_can_compress(inode) ||

0 commit comments

Comments
 (0)