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/item_ops.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/item_ops.c')
-rw-r--r-- | fs/reiserfs/item_ops.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c index 7a88adbceef6..b9b423b22a8b 100644 --- a/fs/reiserfs/item_ops.c +++ b/fs/reiserfs/item_ops.c | |||
@@ -75,8 +75,7 @@ static int sd_create_vi(struct virtual_node *vn, | |||
75 | static int sd_check_left(struct virtual_item *vi, int free, | 75 | static int sd_check_left(struct virtual_item *vi, int free, |
76 | int start_skip, int end_skip) | 76 | int start_skip, int end_skip) |
77 | { | 77 | { |
78 | if (start_skip || end_skip) | 78 | BUG_ON(start_skip || end_skip); |
79 | BUG(); | ||
80 | return -1; | 79 | return -1; |
81 | } | 80 | } |
82 | 81 | ||
@@ -87,8 +86,7 @@ static int sd_check_right(struct virtual_item *vi, int free) | |||
87 | 86 | ||
88 | static int sd_part_size(struct virtual_item *vi, int first, int count) | 87 | static int sd_part_size(struct virtual_item *vi, int first, int count) |
89 | { | 88 | { |
90 | if (count) | 89 | BUG_ON(count); |
91 | BUG(); | ||
92 | return 0; | 90 | return 0; |
93 | } | 91 | } |
94 | 92 | ||
@@ -476,8 +474,7 @@ static int direntry_create_vi(struct virtual_node *vn, | |||
476 | 474 | ||
477 | vi->vi_index = TYPE_DIRENTRY; | 475 | vi->vi_index = TYPE_DIRENTRY; |
478 | 476 | ||
479 | if (!(vi->vi_ih) || !vi->vi_item) | 477 | BUG_ON(!(vi->vi_ih) || !vi->vi_item); |
480 | BUG(); | ||
481 | 478 | ||
482 | dir_u->flags = 0; | 479 | dir_u->flags = 0; |
483 | if (le_ih_k_offset(vi->vi_ih) == DOT_OFFSET) | 480 | if (le_ih_k_offset(vi->vi_ih) == DOT_OFFSET) |
@@ -575,8 +572,7 @@ static int direntry_check_right(struct virtual_item *vi, int free) | |||
575 | free -= dir_u->entry_sizes[i]; | 572 | free -= dir_u->entry_sizes[i]; |
576 | entries++; | 573 | entries++; |
577 | } | 574 | } |
578 | if (entries == dir_u->entry_count) | 575 | BUG_ON(entries == dir_u->entry_count); |
579 | BUG(); | ||
580 | 576 | ||
581 | /* "." and ".." can not be separated from each other */ | 577 | /* "." and ".." can not be separated from each other */ |
582 | if ((dir_u->flags & DIRENTRY_VI_FIRST_DIRENTRY_ITEM) | 578 | if ((dir_u->flags & DIRENTRY_VI_FIRST_DIRENTRY_ITEM) |