summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2026-04-14 17:30:29 +0200
committerDavid Sterba <dsterba@suse.com>2026-06-08 15:53:28 +0200
commitcf384a2ab86bc63df4f1f58f3e79407be75848b4 (patch)
tree2663984ab5d6c6d76c0bc9e30b8c11008bae6f73
parent115421e29b845d521e3dc24b67d83e8695f621f6 (diff)
downloadlinux-cf384a2ab86bc63df4f1f58f3e79407be75848b4.tar.gz
linux-cf384a2ab86bc63df4f1f58f3e79407be75848b4.zip
btrfs: move condition to WARN_ON in btrfs_set_delalloc_extent()
For a simple if + WARN_ON we should use the condition directly in the macro. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/inode.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7557b571a5d9..fd58f7792d94 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2605,8 +2605,7 @@ void btrfs_set_delalloc_extent(struct btrfs_inode *inode, struct extent_state *s
lockdep_assert_held(&inode->io_tree.lock);
- if ((bits & EXTENT_DEFRAG) && !(bits & EXTENT_DELALLOC))
- WARN_ON(1);
+ WARN_ON((bits & EXTENT_DEFRAG) && !(bits & EXTENT_DELALLOC));
/*
* set_bit and clear bit hooks normally require _irqsave/restore
* but in this case, we are only testing for the DELALLOC