BUG_ON() Conversion in fs/ext2/
authorEric Sesterhenn <snakebyte@gmx.de>
Sun, 26 Mar 2006 16:27:41 +0000 (18:27 +0200)
committerAdrian Bunk <bunk@stusta.de>
Sun, 26 Mar 2006 16:27:41 +0000 (18:27 +0200)
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
fs/ext2/dir.c

index b3dbd716cd3a19b537c87b88048cd54ee43d7e50..0165388c425cce5625d4265ee40136ae9a988d25 100644 (file)
@@ -416,8 +416,7 @@ void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
 
        lock_page(page);
        err = page->mapping->a_ops->prepare_write(NULL, page, from, to);
-       if (err)
-               BUG();
+       BUG_ON(err);
        de->inode = cpu_to_le32(inode->i_ino);
        ext2_set_de_type (de, inode);
        err = ext2_commit_chunk(page, from, to);
@@ -554,8 +553,7 @@ int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page )
                from = (char*)pde - (char*)page_address(page);
        lock_page(page);
        err = mapping->a_ops->prepare_write(NULL, page, from, to);
-       if (err)
-               BUG();
+       BUG_ON(err);
        if (pde)
                pde->rec_len = cpu_to_le16(to-from);
        dir->inode = 0;