summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorDulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>2013-10-31 01:00:08 -0400
committerChris Mason <chris.mason@fusionio.com>2013-11-11 22:11:53 -0500
commitfae7f21cece9a4c181a8d8131870c7247e153f65 (patch)
treed2c8052ead139f3e4bb4cb13c44dd59f32184d63 /fs/btrfs/tree-log.c
parentb19e684393752ec129a36924e6c270daf79676d6 (diff)
btrfs: Use WARN_ON()'s return value in place of WARN_ON(1)
Use WARN_ON()'s return value in place of WARN_ON(1) for cleaner source code that outputs a more descriptive warnings. Also fix the styling warning of redundant braces that came up as a result of this fix. Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com> Reviewed-by: Zach Brown <zab@redhat.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 7927a5fa755c..744553c83fe2 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2130,8 +2130,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
2130 WARN_ON(*level >= BTRFS_MAX_LEVEL); 2130 WARN_ON(*level >= BTRFS_MAX_LEVEL);
2131 cur = path->nodes[*level]; 2131 cur = path->nodes[*level];
2132 2132
2133 if (btrfs_header_level(cur) != *level) 2133 WARN_ON(btrfs_header_level(cur) != *level);
2134 WARN_ON(1);
2135 2134
2136 if (path->slots[*level] >= 2135 if (path->slots[*level] >=
2137 btrfs_header_nritems(cur)) 2136 btrfs_header_nritems(cur))
@@ -2951,10 +2950,8 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
2951 2950
2952 /* find the first key from this transaction again */ 2951 /* find the first key from this transaction again */
2953 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); 2952 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0);
2954 if (ret != 0) { 2953 if (WARN_ON(ret != 0))
2955 WARN_ON(1);
2956 goto done; 2954 goto done;
2957 }
2958 2955
2959 /* 2956 /*
2960 * we have a block from this transaction, log every item in it 2957 * we have a block from this transaction, log every item in it