aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-11-03 16:30:18 -0400
committerJosef Bacik <jbacik@fusionio.com>2012-12-12 17:15:24 -0500
commit6c1500f22a7be3a24ad3dffcdbf04be3f676521b (patch)
treebef37d29a8bac05bcf594df26a3eb340141d165e
parent31b1a2bd758f439fc945b3ac5899d890cb7e2dc6 (diff)
fs/btrfs: drop if around WARN_ON
Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--fs/btrfs/backref.c3
-rw-r--r--fs/btrfs/ctree.c9
-rw-r--r--fs/btrfs/inode.c3
3 files changed, 5 insertions, 10 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 208d8aa5b07e..a3219523ebc9 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -890,8 +890,7 @@ again:
890 while (!list_empty(&prefs)) { 890 while (!list_empty(&prefs)) {
891 ref = list_first_entry(&prefs, struct __prelim_ref, list); 891 ref = list_first_entry(&prefs, struct __prelim_ref, list);
892 list_del(&ref->list); 892 list_del(&ref->list);
893 if (ref->count < 0) 893 WARN_ON(ref->count < 0);
894 WARN_ON(1);
895 if (ref->count && ref->root_id && ref->parent == 0) { 894 if (ref->count && ref->root_id && ref->parent == 0) {
896 /* no parent == root of tree */ 895 /* no parent == root of tree */
897 ret = ulist_add(roots, ref->root_id, 0, GFP_NOFS); 896 ret = ulist_add(roots, ref->root_id, 0, GFP_NOFS);
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 0e4adb00e9d9..5c2cf992e717 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1464,10 +1464,8 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
1464 if (cache_only && parent_level != 1) 1464 if (cache_only && parent_level != 1)
1465 return 0; 1465 return 0;
1466 1466
1467 if (trans->transaction != root->fs_info->running_transaction) 1467 WARN_ON(trans->transaction != root->fs_info->running_transaction);
1468 WARN_ON(1); 1468 WARN_ON(trans->transid != root->fs_info->generation);
1469 if (trans->transid != root->fs_info->generation)
1470 WARN_ON(1);
1471 1469
1472 parent_nritems = btrfs_header_nritems(parent); 1470 parent_nritems = btrfs_header_nritems(parent);
1473 blocksize = btrfs_level_size(root, parent_level - 1); 1471 blocksize = btrfs_level_size(root, parent_level - 1);
@@ -3398,8 +3396,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
3398 if (push_items == 0) 3396 if (push_items == 0)
3399 goto out_unlock; 3397 goto out_unlock;
3400 3398
3401 if (!empty && push_items == left_nritems) 3399 WARN_ON(!empty && push_items == left_nritems);
3402 WARN_ON(1);
3403 3400
3404 /* push left to right */ 3401 /* push left to right */
3405 right_nritems = btrfs_header_nritems(right); 3402 right_nritems = btrfs_header_nritems(right);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 6dca345fd1b6..e8733fab2739 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1675,8 +1675,7 @@ static noinline int add_pending_csums(struct btrfs_trans_handle *trans,
1675int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, 1675int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end,
1676 struct extent_state **cached_state) 1676 struct extent_state **cached_state)
1677{ 1677{
1678 if ((end & (PAGE_CACHE_SIZE - 1)) == 0) 1678 WARN_ON((end & (PAGE_CACHE_SIZE - 1)) == 0);
1679 WARN_ON(1);
1680 return set_extent_delalloc(&BTRFS_I(inode)->io_tree, start, end, 1679 return set_extent_delalloc(&BTRFS_I(inode)->io_tree, start, end,
1681 cached_state, GFP_NOFS); 1680 cached_state, GFP_NOFS);
1682} 1681}