From 14a61442c2203d2a49f2f954bfa9259c0ddac1aa Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Tue, 3 Oct 2006 23:36:38 +0200 Subject: BUG_ON conversion for fs/reiserfs This patch converts several if () BUG(); construct to BUG_ON(); which occupies less space, uses unlikely and is safer when BUG() is disabled. S_ISREG() has no side effects, so the conversion is safe. Signed-off-by: Eric Sesterhenn Signed-off-by: Adrian Bunk --- fs/reiserfs/file.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'fs/reiserfs/file.c') diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 41f24369e47..c093642fb98 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c @@ -38,8 +38,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp) int err; int jbegin_failure = 0; - if (!S_ISREG(inode->i_mode)) - BUG(); + BUG_ON(!S_ISREG(inode->i_mode)); /* fast out for when nothing needs to be done */ if ((atomic_read(&inode->i_count) > 1 || @@ -125,8 +124,7 @@ static int reiserfs_sync_file(struct file *p_s_filp, int n_err; int barrier_done; - if (!S_ISREG(p_s_inode->i_mode)) - BUG(); + BUG_ON(!S_ISREG(p_s_inode->i_mode)); n_err = sync_mapping_buffers(p_s_inode->i_mapping); reiserfs_write_lock(p_s_inode->i_sb); barrier_done = reiserfs_commit_for_inode(p_s_inode); -- cgit v1.2.3-70-g09d2