aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/reiserfs_fs.h
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-03-30 14:02:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 15:16:36 -0400
commitc3a9c2109f84882b9b3178f6b1838d550d3df0ec (patch)
tree08a502b8013eabb562f03be45622b0f63b1a34b9 /include/linux/reiserfs_fs.h
parent78b6513d2881f1a759fb9825a036d926392de084 (diff)
reiserfs: rework reiserfs_panic
ReiserFS panics can be somewhat inconsistent. In some cases: * a unique identifier may be associated with it * the function name may be included * the device may be printed separately This patch aims to make warnings more consistent. reiserfs_warning() prints the device name, so printing it a second time is not required. The function name for a warning is always helpful in debugging, so it is now automatically inserted into the output. Hans has stated that every warning should have a unique identifier. Some cases lack them, others really shouldn't have them. reiserfs_warning() now expects an id associated with each message. In the rare case where one isn't needed, "" will suffice. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/reiserfs_fs.h')
-rw-r--r--include/linux/reiserfs_fs.h28
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...) \
90if( !( cond ) ) \ 90do { \
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
1454static inline struct super_block *sb_from_tb(struct tree_balance *tb)
1455{
1456 return tb ? tb->tb_sb : NULL;
1457}
1458
1459static 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,
1988void unfix_nodes(struct tree_balance *); 2001void unfix_nodes(struct tree_balance *);
1989 2002
1990/* prints.c */ 2003/* prints.c */
1991void reiserfs_panic(struct super_block *s, const char *fmt, ...) 2004void __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)
1993void reiserfs_info(struct super_block *s, const char *fmt, ...); 2009void reiserfs_info(struct super_block *s, const char *fmt, ...);
1994void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...); 2010void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...);
1995void print_indirect_item(struct buffer_head *bh, int item_num); 2011void print_indirect_item(struct buffer_head *bh, int item_num);