diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-10-03 17:36:38 -0400 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2006-10-03 17:36:38 -0400 |
commit | 14a61442c2203d2a49f2f954bfa9259c0ddac1aa (patch) | |
tree | c146effc3dbaa41dd6fdd01e6f3f8fcdd63ad705 /fs/reiserfs/file.c | |
parent | 8d8f3cbe777e014123bfa63f2cebd6eb29032225 (diff) |
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 <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'fs/reiserfs/file.c')
-rw-r--r-- | fs/reiserfs/file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 41f24369e47a..c093642fb983 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) | |||
38 | int err; | 38 | int err; |
39 | int jbegin_failure = 0; | 39 | int jbegin_failure = 0; |
40 | 40 | ||
41 | if (!S_ISREG(inode->i_mode)) | 41 | BUG_ON(!S_ISREG(inode->i_mode)); |
42 | BUG(); | ||
43 | 42 | ||
44 | /* fast out for when nothing needs to be done */ | 43 | /* fast out for when nothing needs to be done */ |
45 | if ((atomic_read(&inode->i_count) > 1 || | 44 | if ((atomic_read(&inode->i_count) > 1 || |
@@ -125,8 +124,7 @@ static int reiserfs_sync_file(struct file *p_s_filp, | |||
125 | int n_err; | 124 | int n_err; |
126 | int barrier_done; | 125 | int barrier_done; |
127 | 126 | ||
128 | if (!S_ISREG(p_s_inode->i_mode)) | 127 | BUG_ON(!S_ISREG(p_s_inode->i_mode)); |
129 | BUG(); | ||
130 | n_err = sync_mapping_buffers(p_s_inode->i_mapping); | 128 | n_err = sync_mapping_buffers(p_s_inode->i_mapping); |
131 | reiserfs_write_lock(p_s_inode->i_sb); | 129 | reiserfs_write_lock(p_s_inode->i_sb); |
132 | barrier_done = reiserfs_commit_for_inode(p_s_inode); | 130 | barrier_done = reiserfs_commit_for_inode(p_s_inode); |