diff options
Diffstat (limited to 'include/linux/reiserfs_fs.h')
-rw-r--r-- | include/linux/reiserfs_fs.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index cf5407ee0f32..04bfd61eeaaa 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -86,11 +86,14 @@ void __reiserfs_warning(struct super_block *s, const char *id, | |||
86 | /* assertions handling */ | 86 | /* assertions handling */ |
87 | 87 | ||
88 | /** always check a condition and panic if it's false. */ | 88 | /** always check a condition and panic if it's false. */ |
89 | #define __RASSERT( cond, scond, format, args... ) \ | 89 | #define __RASSERT(cond, scond, format, args...) \ |
90 | if( !( cond ) ) \ | 90 | do { \ |
91 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ | 91 | if (!(cond)) \ |
92 | __FILE__ ":%i:%s: " format "\n", \ | 92 | reiserfs_panic(NULL, "assertion failure", "(" #cond ") at " \ |
93 | in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __func__ , ##args ) | 93 | __FILE__ ":%i:%s: " format "\n", \ |
94 | in_interrupt() ? -1 : task_pid_nr(current), \ | ||
95 | __LINE__, __func__ , ##args); \ | ||
96 | } while (0) | ||
94 | 97 | ||
95 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) | 98 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) |
96 | 99 | ||
@@ -1448,6 +1451,16 @@ struct buffer_info { | |||
1448 | int bi_position; | 1451 | int bi_position; |
1449 | }; | 1452 | }; |
1450 | 1453 | ||
1454 | static inline struct super_block *sb_from_tb(struct tree_balance *tb) | ||
1455 | { | ||
1456 | return tb ? tb->tb_sb : NULL; | ||
1457 | } | ||
1458 | |||
1459 | static inline struct super_block *sb_from_bi(struct buffer_info *bi) | ||
1460 | { | ||
1461 | return bi ? sb_from_tb(bi->tb) : NULL; | ||
1462 | } | ||
1463 | |||
1451 | /* there are 4 types of items: stat data, directory item, indirect, direct. | 1464 | /* there are 4 types of items: stat data, directory item, indirect, direct. |
1452 | +-------------------+------------+--------------+------------+ | 1465 | +-------------------+------------+--------------+------------+ |
1453 | | | k_offset | k_uniqueness | mergeable? | | 1466 | | | k_offset | k_uniqueness | mergeable? | |
@@ -1988,8 +2001,11 @@ int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, | |||
1988 | void unfix_nodes(struct tree_balance *); | 2001 | void unfix_nodes(struct tree_balance *); |
1989 | 2002 | ||
1990 | /* prints.c */ | 2003 | /* prints.c */ |
1991 | void reiserfs_panic(struct super_block *s, const char *fmt, ...) | 2004 | void __reiserfs_panic(struct super_block *s, const char *id, |
2005 | const char *function, const char *fmt, ...) | ||
1992 | __attribute__ ((noreturn)); | 2006 | __attribute__ ((noreturn)); |
2007 | #define reiserfs_panic(s, id, fmt, args...) \ | ||
2008 | __reiserfs_panic(s, id, __func__, fmt, ##args) | ||
1993 | void reiserfs_info(struct super_block *s, const char *fmt, ...); | 2009 | void reiserfs_info(struct super_block *s, const char *fmt, ...); |
1994 | void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...); | 2010 | void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...); |
1995 | void print_indirect_item(struct buffer_head *bh, int item_num); | 2011 | void print_indirect_item(struct buffer_head *bh, int item_num); |