Btrfs: BUG to BUG_ON changes
authorStoyan Gaydarov <stoyboyker@gmail.com>
Thu, 2 Apr 2009 21:05:11 +0000 (17:05 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 2 Apr 2009 21:05:11 +0000 (17:05 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ctree.c
fs/btrfs/free-space-cache.c
fs/btrfs/tree-log.c

index b8082762ca78dd72bb177548bd7fbbcd2173bfd3..e5b2533b691a3040f108d517efea04ccfdcc6117 100644 (file)
@@ -2157,8 +2157,7 @@ static int insert_ptr(struct btrfs_trans_handle *trans, struct btrfs_root
        BUG_ON(!path->nodes[level]);
        lower = path->nodes[level];
        nritems = btrfs_header_nritems(lower);
-       if (slot > nritems)
-               BUG();
+       BUG_ON(slot > nritems);
        if (nritems == BTRFS_NODEPTRS_PER_BLOCK(root))
                BUG();
        if (slot != nritems) {
index 3fdadd28e935f62c42964f0e350049f63dffb7e7..768b9523662df85274e402328c618c226be5ab77 100644 (file)
@@ -253,8 +253,7 @@ int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
 
        if (ret) {
                printk(KERN_ERR "btrfs: unable to add free space :%d\n", ret);
-               if (ret == -EEXIST)
-                       BUG();
+               BUG_ON(ret == -EEXIST);
        }
 
        return ret;
index c047eea4093fcd650e09bac8f1618a1262cb91d8..25f20ea11f2789db90f796ecfd52aeae87c02910 100644 (file)
@@ -1222,8 +1222,7 @@ insert:
        ret = insert_one_name(trans, root, path, key->objectid, key->offset,
                              name, name_len, log_type, &log_key);
 
-       if (ret && ret != -ENOENT)
-               BUG();
+       BUG_ON(ret && ret != -ENOENT);
        goto out;
 }