Commit 9511c080 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] reiserfs: add device info to diagnostic messages

From: Chris Mason <mason@suse.com>

From: Jeff Mahoney <jeffm@suse.com>

Add device info to the various reiserfs warnings and panics so you can tell
which filesystem triggers the message.  Loosely based on code from Oleg
Drokin.
parent cee42600
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define SET_OPTION(optname) \ #define SET_OPTION(optname) \
do { \ do { \
reiserfs_warning("reiserfs: option \"%s\" is set\n", #optname); \ reiserfs_warning(s, "reiserfs: option \"%s\" is set", #optname); \
set_bit(_ALLOC_ ## optname , &SB_ALLOC_OPTS(s)); \ set_bit(_ALLOC_ ## optname , &SB_ALLOC_OPTS(s)); \
} while(0) } while(0)
#define TEST_OPTION(optname, s) \ #define TEST_OPTION(optname, s) \
...@@ -60,7 +60,7 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value) ...@@ -60,7 +60,7 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value)
int i, j; int i, j;
if (block == 0 || block >= SB_BLOCK_COUNT (s)) { if (block == 0 || block >= SB_BLOCK_COUNT (s)) {
reiserfs_warning ("vs-4010: is_reusable: block number is out of range %lu (%u)\n", reiserfs_warning (s, "vs-4010: is_reusable: block number is out of range %lu (%u)",
block, SB_BLOCK_COUNT (s)); block, SB_BLOCK_COUNT (s));
return 0; return 0;
} }
...@@ -68,8 +68,8 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value) ...@@ -68,8 +68,8 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value)
/* it can't be one of the bitmap blocks */ /* it can't be one of the bitmap blocks */
for (i = 0; i < SB_BMAP_NR (s); i ++) for (i = 0; i < SB_BMAP_NR (s); i ++)
if (block == SB_AP_BITMAP (s)[i].bh->b_blocknr) { if (block == SB_AP_BITMAP (s)[i].bh->b_blocknr) {
reiserfs_warning ("vs: 4020: is_reusable: " reiserfs_warning (s, "vs: 4020: is_reusable: "
"bitmap block %lu(%u) can't be freed or reused\n", "bitmap block %lu(%u) can't be freed or reused",
block, SB_BMAP_NR (s)); block, SB_BMAP_NR (s));
return 0; return 0;
} }
...@@ -77,8 +77,8 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value) ...@@ -77,8 +77,8 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value)
get_bit_address (s, block, &i, &j); get_bit_address (s, block, &i, &j);
if (i >= SB_BMAP_NR (s)) { if (i >= SB_BMAP_NR (s)) {
reiserfs_warning ("vs-4030: is_reusable: there is no so many bitmap blocks: " reiserfs_warning (s, "vs-4030: is_reusable: there is no so many bitmap blocks: "
"block=%lu, bitmap_nr=%d\n", block, i); "block=%lu, bitmap_nr=%d", block, i);
return 0; return 0;
} }
...@@ -86,16 +86,16 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value) ...@@ -86,16 +86,16 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value)
reiserfs_test_le_bit(j, SB_AP_BITMAP(s)[i].bh->b_data)) || reiserfs_test_le_bit(j, SB_AP_BITMAP(s)[i].bh->b_data)) ||
(bit_value == 1 && (bit_value == 1 &&
reiserfs_test_le_bit(j, SB_AP_BITMAP (s)[i].bh->b_data) == 0)) { reiserfs_test_le_bit(j, SB_AP_BITMAP (s)[i].bh->b_data) == 0)) {
reiserfs_warning ("vs-4040: is_reusable: corresponding bit of block %lu does not " reiserfs_warning (s, "vs-4040: is_reusable: corresponding bit of block %lu does not "
"match required value (i==%d, j==%d) test_bit==%d\n", "match required value (i==%d, j==%d) test_bit==%d",
block, i, j, reiserfs_test_le_bit (j, SB_AP_BITMAP (s)[i].bh->b_data)); block, i, j, reiserfs_test_le_bit (j, SB_AP_BITMAP (s)[i].bh->b_data));
return 0; return 0;
} }
if (bit_value == 0 && block == SB_ROOT_BLOCK (s)) { if (bit_value == 0 && block == SB_ROOT_BLOCK (s)) {
reiserfs_warning ("vs-4050: is_reusable: this is root block (%u), " reiserfs_warning (s, "vs-4050: is_reusable: this is root block (%u), "
"it must be busy\n", SB_ROOT_BLOCK (s)); "it must be busy", SB_ROOT_BLOCK (s));
return 0; return 0;
} }
...@@ -134,7 +134,7 @@ static int scan_bitmap_block (struct reiserfs_transaction_handle *th, ...@@ -134,7 +134,7 @@ static int scan_bitmap_block (struct reiserfs_transaction_handle *th,
int end, next; int end, next;
int org = *beg; int org = *beg;
RFALSE(bmap_n >= SB_BMAP_NR (s), "Bitmap %d is out of range (0..%d)\n",bmap_n, SB_BMAP_NR (s) - 1); RFALSE(bmap_n >= SB_BMAP_NR (s), "Bitmap %d is out of range (0..%d)",bmap_n, SB_BMAP_NR (s) - 1);
PROC_INFO_INC( s, scan_bitmap.bmap ); PROC_INFO_INC( s, scan_bitmap.bmap );
/* this is unclear and lacks comments, explain how journal bitmaps /* this is unclear and lacks comments, explain how journal bitmaps
work here for the reader. Convey a sense of the design here. What work here for the reader. Convey a sense of the design here. What
...@@ -142,7 +142,7 @@ static int scan_bitmap_block (struct reiserfs_transaction_handle *th, ...@@ -142,7 +142,7 @@ static int scan_bitmap_block (struct reiserfs_transaction_handle *th,
/* - I mean `a window of zero bits' as in description of this function - Zam. */ /* - I mean `a window of zero bits' as in description of this function - Zam. */
if ( !bi ) { if ( !bi ) {
printk("Hey, bitmap info pointer is zero for bitmap %d!\n",bmap_n); reiserfs_warning (s, "NULL bitmap info pointer for bitmap %d", bmap_n);
return 0; return 0;
} }
if (buffer_locked (bi->bh)) { if (buffer_locked (bi->bh)) {
...@@ -300,8 +300,8 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th, ...@@ -300,8 +300,8 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th,
get_bit_address (s, block, &nr, &offset); get_bit_address (s, block, &nr, &offset);
if (nr >= sb_bmap_nr (rs)) { if (nr >= sb_bmap_nr (rs)) {
reiserfs_warning ("vs-4075: reiserfs_free_block: " reiserfs_warning (s, "vs-4075: reiserfs_free_block: "
"block %lu is out of range on %s\n", "block %lu is out of range on %s",
block, reiserfs_bdevname (s)); block, reiserfs_bdevname (s));
return; return;
} }
...@@ -310,8 +310,8 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th, ...@@ -310,8 +310,8 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th,
/* clear bit for the given block in bit map */ /* clear bit for the given block in bit map */
if (!reiserfs_test_and_clear_le_bit (offset, apbi[nr].bh->b_data)) { if (!reiserfs_test_and_clear_le_bit (offset, apbi[nr].bh->b_data)) {
reiserfs_warning ("vs-4080: reiserfs_free_block: " reiserfs_warning (s, "vs-4080: reiserfs_free_block: "
"free_block (%s:%lu)[dev:blocknr]: bit already cleared\n", "free_block (%s:%lu)[dev:blocknr]: bit already cleared",
reiserfs_bdevname (s), block); reiserfs_bdevname (s), block);
} }
if (offset < apbi[nr].first_zero_hint) { if (offset < apbi[nr].first_zero_hint) {
...@@ -358,7 +358,7 @@ static void __discard_prealloc (struct reiserfs_transaction_handle * th, ...@@ -358,7 +358,7 @@ static void __discard_prealloc (struct reiserfs_transaction_handle * th,
struct inode *inode = &ei->vfs_inode; struct inode *inode = &ei->vfs_inode;
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
if (ei->i_prealloc_count < 0) if (ei->i_prealloc_count < 0)
reiserfs_warning("zam-4001:%s: inode has negative prealloc blocks count.\n", __FUNCTION__ ); reiserfs_warning (th->t_super, "zam-4001:%s: inode has negative prealloc blocks count.", __FUNCTION__ );
#endif #endif
while (ei->i_prealloc_count > 0) { while (ei->i_prealloc_count > 0) {
reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block); reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block);
...@@ -390,7 +390,7 @@ void reiserfs_discard_all_prealloc (struct reiserfs_transaction_handle *th) ...@@ -390,7 +390,7 @@ void reiserfs_discard_all_prealloc (struct reiserfs_transaction_handle *th)
ei = list_entry(plist->next, struct reiserfs_inode_info, i_prealloc_list); ei = list_entry(plist->next, struct reiserfs_inode_info, i_prealloc_list);
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
if (!ei->i_prealloc_count) { if (!ei->i_prealloc_count) {
reiserfs_warning("zam-4001:%s: inode is in prealloc list but has no preallocated blocks.\n", __FUNCTION__); reiserfs_warning (th->t_super, "zam-4001:%s: inode is in prealloc list but has no preallocated blocks.", __FUNCTION__);
} }
#endif #endif
__discard_prealloc(th, ei); __discard_prealloc(th, ei);
...@@ -476,7 +476,8 @@ int reiserfs_parse_alloc_options(struct super_block * s, char * options) ...@@ -476,7 +476,8 @@ int reiserfs_parse_alloc_options(struct super_block * s, char * options)
continue; continue;
} }
reiserfs_warning("zam-4001: %s : unknown option - %s\n", __FUNCTION__ , this_char); reiserfs_warning (s, "zam-4001: %s : unknown option - %s",
__FUNCTION__ , this_char);
return 1; return 1;
} }
...@@ -516,7 +517,7 @@ static inline void get_left_neighbor(reiserfs_blocknr_hint_t *hint) ...@@ -516,7 +517,7 @@ static inline void get_left_neighbor(reiserfs_blocknr_hint_t *hint)
path = hint->path; path = hint->path;
bh = get_last_bh(path); bh = get_last_bh(path);
RFALSE( !bh, "green-4002: Illegal path specified to get_left_neighbor\n"); RFALSE( !bh, "green-4002: Illegal path specified to get_left_neighbor");
ih = get_ih(path); ih = get_ih(path);
pos_in_item = path->pos_in_item; pos_in_item = path->pos_in_item;
item = get_item (path); item = get_item (path);
...@@ -783,14 +784,14 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start ...@@ -783,14 +784,14 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
if (!hint->formatted_node) { if (!hint->formatted_node) {
int quota_ret; int quota_ret;
#ifdef REISERQUOTA_DEBUG #ifdef REISERQUOTA_DEBUG
printk(KERN_DEBUG "reiserquota: allocating %d blocks id=%u\n", amount_needed, hint->inode->i_uid); reiserfs_debug (s, "reiserquota: allocating %d blocks id=%u", amount_needed, hint->inode->i_uid);
#endif #endif
quota_ret = DQUOT_ALLOC_BLOCK_NODIRTY(hint->inode, amount_needed); quota_ret = DQUOT_ALLOC_BLOCK_NODIRTY(hint->inode, amount_needed);
if (quota_ret) /* Quota exceeded? */ if (quota_ret) /* Quota exceeded? */
return QUOTA_EXCEEDED; return QUOTA_EXCEEDED;
if (hint->preallocate && hint->prealloc_size ) { if (hint->preallocate && hint->prealloc_size ) {
#ifdef REISERQUOTA_DEBUG #ifdef REISERQUOTA_DEBUG
printk(KERN_DEBUG "reiserquota: allocating (prealloc) %d blocks id=%u\n", hint->prealloc_size, hint->inode->i_uid); reiserfs_debug (s, "reiserquota: allocating (prealloc) %d blocks id=%u", hint->prealloc_size, hint->inode->i_uid);
#endif #endif
quota_ret = DQUOT_PREALLOC_BLOCK_NODIRTY(hint->inode, hint->prealloc_size); quota_ret = DQUOT_PREALLOC_BLOCK_NODIRTY(hint->inode, hint->prealloc_size);
if (quota_ret) if (quota_ret)
...@@ -807,7 +808,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start ...@@ -807,7 +808,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
if (second_pass) { /* it was a second pass; we must free all blocks */ if (second_pass) { /* it was a second pass; we must free all blocks */
if (!hint->formatted_node) { if (!hint->formatted_node) {
#ifdef REISERQUOTA_DEBUG #ifdef REISERQUOTA_DEBUG
printk(KERN_DEBUG "reiserquota: freeing (nospace) %d blocks id=%u\n", amount_needed + hint->prealloc_size - nr_allocated, hint->inode->i_uid); reiserfs_debug (s, "reiserquota: freeing (nospace) %d blocks id=%u", amount_needed + hint->prealloc_size - nr_allocated, hint->inode->i_uid);
#endif #endif
DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed + hint->prealloc_size - nr_allocated); /* Free not allocated blocks */ DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed + hint->prealloc_size - nr_allocated); /* Free not allocated blocks */
} }
...@@ -827,7 +828,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start ...@@ -827,7 +828,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
nr_allocated + REISERFS_I(hint->inode)->i_prealloc_count) { nr_allocated + REISERFS_I(hint->inode)->i_prealloc_count) {
/* Some of preallocation blocks were not allocated */ /* Some of preallocation blocks were not allocated */
#ifdef REISERQUOTA_DEBUG #ifdef REISERQUOTA_DEBUG
printk(KERN_DEBUG "reiserquota: freeing (failed prealloc) %d blocks id=%u\n", amount_needed + hint->prealloc_size - nr_allocated - INODE_INFO(hint->inode)->i_prealloc_count, hint->inode->i_uid); reiserfs_debug (s, "reiserquota: freeing (failed prealloc) %d blocks id=%u", amount_needed + hint->prealloc_size - nr_allocated - INODE_INFO(hint->inode)->i_prealloc_count, hint->inode->i_uid);
#endif #endif
DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed + DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed +
hint->prealloc_size - nr_allocated - hint->prealloc_size - nr_allocated -
......
...@@ -54,7 +54,7 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi ...@@ -54,7 +54,7 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock(inode->i_sb);
reiserfs_check_lock_depth("readdir") ; reiserfs_check_lock_depth(inode->i_sb, "readdir") ;
/* form key for search the next directory entry using f_pos field of /* form key for search the next directory entry using f_pos field of
file structure */ file structure */
...@@ -62,7 +62,7 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi ...@@ -62,7 +62,7 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
TYPE_DIRENTRY, 3); TYPE_DIRENTRY, 3);
next_pos = cpu_key_k_offset (&pos_key); next_pos = cpu_key_k_offset (&pos_key);
/* reiserfs_warning ("reiserfs_readdir 1: f_pos = %Ld\n", filp->f_pos);*/ /* reiserfs_warning (inode->i_sb, "reiserfs_readdir 1: f_pos = %Ld", filp->f_pos);*/
while (1) { while (1) {
research: research:
......
...@@ -83,7 +83,7 @@ static int balance_leaf_when_delete (struct tree_balance * tb, int flag) ...@@ -83,7 +83,7 @@ static int balance_leaf_when_delete (struct tree_balance * tb, int flag)
struct item_head * ih; struct item_head * ih;
RFALSE( tb->FR[0] && B_LEVEL (tb->FR[0]) != DISK_LEAF_NODE_LEVEL + 1, RFALSE( tb->FR[0] && B_LEVEL (tb->FR[0]) != DISK_LEAF_NODE_LEVEL + 1,
"vs- 12000: level: wrong FR %z\n", tb->FR[0]); "vs- 12000: level: wrong FR %z", tb->FR[0]);
RFALSE( tb->blknum[0] > 1, RFALSE( tb->blknum[0] > 1,
"PAP-12005: tb->blknum == %d, can not be > 1", tb->blknum[0]); "PAP-12005: tb->blknum == %d, can not be > 1", tb->blknum[0]);
RFALSE( ! tb->blknum[0] && ! PATH_H_PPARENT(tb->tb_path, 0), RFALSE( ! tb->blknum[0] && ! PATH_H_PPARENT(tb->tb_path, 0),
...@@ -1056,7 +1056,7 @@ static int balance_leaf (struct tree_balance * tb, ...@@ -1056,7 +1056,7 @@ static int balance_leaf (struct tree_balance * tb,
RFALSE (!buffer_journaled (S_new [i]) || buffer_journal_dirty (S_new [i]) || RFALSE (!buffer_journaled (S_new [i]) || buffer_journal_dirty (S_new [i]) ||
buffer_dirty (S_new [i]), buffer_dirty (S_new [i]),
"PAP-12247: S_new[%d] : (%b)\n", i, S_new[i]); "PAP-12247: S_new[%d] : (%b)", i, S_new[i]);
} }
/* if the affected item was not wholly shifted then we perform all necessary operations on that part or whole of the /* if the affected item was not wholly shifted then we perform all necessary operations on that part or whole of the
...@@ -1215,14 +1215,14 @@ static void store_thrown (struct tree_balance * tb, struct buffer_head * bh) ...@@ -1215,14 +1215,14 @@ static void store_thrown (struct tree_balance * tb, struct buffer_head * bh)
int i; int i;
if (buffer_dirty (bh)) if (buffer_dirty (bh))
printk ("store_thrown deals with dirty buffer\n"); reiserfs_warning (tb->tb_sb, "store_thrown deals with dirty buffer");
for (i = 0; i < sizeof (tb->thrown)/sizeof (tb->thrown[0]); i ++) for (i = 0; i < sizeof (tb->thrown)/sizeof (tb->thrown[0]); i ++)
if (!tb->thrown[i]) { if (!tb->thrown[i]) {
tb->thrown[i] = bh; tb->thrown[i] = bh;
get_bh(bh) ; /* free_thrown puts this */ get_bh(bh) ; /* free_thrown puts this */
return; return;
} }
reiserfs_warning ("store_thrown: too many thrown buffers\n"); reiserfs_warning (tb->tb_sb, "store_thrown: too many thrown buffers");
} }
static void free_thrown(struct tree_balance *tb) { static void free_thrown(struct tree_balance *tb) {
...@@ -1232,7 +1232,9 @@ static void free_thrown(struct tree_balance *tb) { ...@@ -1232,7 +1232,9 @@ static void free_thrown(struct tree_balance *tb) {
if (tb->thrown[i]) { if (tb->thrown[i]) {
blocknr = tb->thrown[i]->b_blocknr ; blocknr = tb->thrown[i]->b_blocknr ;
if (buffer_dirty (tb->thrown[i])) if (buffer_dirty (tb->thrown[i]))
printk ("free_thrown deals with dirty buffer %d\n", blocknr); reiserfs_warning (tb->tb_sb,
"free_thrown deals with dirty buffer %d",
blocknr);
brelse(tb->thrown[i]) ; /* incremented in store_thrown */ brelse(tb->thrown[i]) ; /* incremented in store_thrown */
reiserfs_free_block (tb->transaction_handle, NULL, blocknr, 0); reiserfs_free_block (tb->transaction_handle, NULL, blocknr, 0);
} }
...@@ -1341,7 +1343,8 @@ static int locked_or_not_in_tree (struct buffer_head * bh, char * which) ...@@ -1341,7 +1343,8 @@ static int locked_or_not_in_tree (struct buffer_head * bh, char * which)
{ {
if ( (!reiserfs_buffer_prepared(bh) && buffer_locked (bh)) || if ( (!reiserfs_buffer_prepared(bh) && buffer_locked (bh)) ||
!B_IS_IN_TREE (bh) ) { !B_IS_IN_TREE (bh) ) {
reiserfs_warning ("vs-12339: locked_or_not_in_tree: %s (%b)\n", which, bh); reiserfs_warning (NULL, "vs-12339: locked_or_not_in_tree: %s (%b)",
which, bh);
return 1; return 1;
} }
return 0; return 0;
...@@ -1405,9 +1408,9 @@ void check_after_balance_leaf (struct tree_balance * tb) ...@@ -1405,9 +1408,9 @@ void check_after_balance_leaf (struct tree_balance * tb)
dc_size(B_N_CHILD (PATH_H_PBUFFER(tb->tb_path,1), dc_size(B_N_CHILD (PATH_H_PBUFFER(tb->tb_path,1),
PATH_H_POSITION (tb->tb_path, 1)))); PATH_H_POSITION (tb->tb_path, 1))));
print_cur_tb ("12223"); print_cur_tb ("12223");
reiserfs_warning( reiserfs_warning (tb->tb_sb,
"B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; " "B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; "
"MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d\n", "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d",
left, left,
MAX_CHILD_SIZE (PATH_H_PBUFFER(tb->tb_path,0)), MAX_CHILD_SIZE (PATH_H_PBUFFER(tb->tb_path,0)),
PATH_H_PBUFFER(tb->tb_path,1), PATH_H_PBUFFER(tb->tb_path,1),
...@@ -1564,7 +1567,8 @@ void do_balance (struct tree_balance * tb, /* tree_balance structure */ ...@@ -1564,7 +1567,8 @@ void do_balance (struct tree_balance * tb, /* tree_balance structure */
} }
/* if we have no real work to do */ /* if we have no real work to do */
if ( ! tb->insert_size[0] ) { if ( ! tb->insert_size[0] ) {
reiserfs_warning ("PAP-12350: do_balance: insert_size == 0, mode == %c", reiserfs_warning (tb->tb_sb,
"PAP-12350: do_balance: insert_size == 0, mode == %c",
flag); flag);
unfix_nodes(tb); unfix_nodes(tb);
return; return;
......
...@@ -298,7 +298,8 @@ int reiserfs_allocate_blocks_for_region( ...@@ -298,7 +298,8 @@ int reiserfs_allocate_blocks_for_region(
if ( res != ITEM_NOT_FOUND ) { if ( res != ITEM_NOT_FOUND ) {
/* item should not exist, otherwise we have error */ /* item should not exist, otherwise we have error */
if ( res != -ENOSPC ) { if ( res != -ENOSPC ) {
reiserfs_warning ("green-9008: search_by_key (%K) returned %d\n", reiserfs_warning (inode->i_sb,
"green-9008: search_by_key (%K) returned %d",
&key, res); &key, res);
} }
res = -EIO; res = -EIO;
...@@ -446,8 +447,9 @@ int reiserfs_allocate_blocks_for_region( ...@@ -446,8 +447,9 @@ int reiserfs_allocate_blocks_for_region(
/* Well, if we have found such item already, or some error /* Well, if we have found such item already, or some error
occured, we need to warn user and return error */ occured, we need to warn user and return error */
if ( res != -ENOSPC ) { if ( res != -ENOSPC ) {
reiserfs_warning ("green-9009: search_by_key (%K) returned %d\n", reiserfs_warning (inode->i_sb,
&key, res); "green-9009: search_by_key (%K) "
"returned %d", &key, res);
} }
res = -EIO; res = -EIO;
goto error_exit_free_blocks; goto error_exit_free_blocks;
...@@ -799,7 +801,9 @@ int reiserfs_prepare_file_region_for_write( ...@@ -799,7 +801,9 @@ int reiserfs_prepare_file_region_for_write(
if ( num_pages < 1 ) { if ( num_pages < 1 ) {
reiserfs_warning("green-9001: reiserfs_prepare_file_region_for_write called with zero number of pages to process\n"); reiserfs_warning (inode->i_sb,
"green-9001: reiserfs_prepare_file_region_for_write "
"called with zero number of pages to process");
return -EFAULT; return -EFAULT;
} }
......
...@@ -483,7 +483,8 @@ static int get_num_ver (int mode, struct tree_balance * tb, int h, ...@@ -483,7 +483,8 @@ static int get_num_ver (int mode, struct tree_balance * tb, int h,
snum012[needed_nodes - 1 + 3] = units; snum012[needed_nodes - 1 + 3] = units;
if (needed_nodes > 2) if (needed_nodes > 2)
reiserfs_warning ("vs-8111: get_num_ver: split_item_position is out of boundary\n"); reiserfs_warning (tb->tb_sb, "vs-8111: get_num_ver: "
"split_item_position is out of boundary");
snum012[needed_nodes - 1] ++; snum012[needed_nodes - 1] ++;
split_item_positions[needed_nodes - 1] = i; split_item_positions[needed_nodes - 1] = i;
needed_nodes ++; needed_nodes ++;
...@@ -510,7 +511,8 @@ static int get_num_ver (int mode, struct tree_balance * tb, int h, ...@@ -510,7 +511,8 @@ static int get_num_ver (int mode, struct tree_balance * tb, int h,
snum012[4] = op_unit_num (&vn->vn_vi[split_item_num]) - snum012[4] - bytes_to_r - bytes_to_l - bytes_to_S1new; snum012[4] = op_unit_num (&vn->vn_vi[split_item_num]) - snum012[4] - bytes_to_r - bytes_to_l - bytes_to_S1new;
if (vn->vn_vi[split_item_num].vi_index != TYPE_DIRENTRY) if (vn->vn_vi[split_item_num].vi_index != TYPE_DIRENTRY)
reiserfs_warning ("vs-8115: get_num_ver: not directory item\n"); reiserfs_warning (tb->tb_sb, "vs-8115: get_num_ver: not "
"directory item");
} }
/* now we know S2bytes, calculate S1bytes */ /* now we know S2bytes, calculate S1bytes */
...@@ -1974,11 +1976,12 @@ void * reiserfs_kmalloc (size_t size, int flags, struct super_block * s) ...@@ -1974,11 +1976,12 @@ void * reiserfs_kmalloc (size_t size, int flags, struct super_block * s)
if (vp) { if (vp) {
REISERFS_SB(s)->s_kmallocs += size; REISERFS_SB(s)->s_kmallocs += size;
if (REISERFS_SB(s)->s_kmallocs > malloced + 200000) { if (REISERFS_SB(s)->s_kmallocs > malloced + 200000) {
reiserfs_warning ("vs-8301: reiserfs_kmalloc: allocated memory %d\n", REISERFS_SB(s)->s_kmallocs); reiserfs_warning (s,
"vs-8301: reiserfs_kmalloc: allocated memory %d",
REISERFS_SB(s)->s_kmallocs);
malloced = REISERFS_SB(s)->s_kmallocs; malloced = REISERFS_SB(s)->s_kmallocs;
} }
} }
/*printk ("malloc : size %d, allocated %d\n", size, REISERFS_SB(s)->s_kmallocs);*/
return vp; return vp;
} }
...@@ -1988,7 +1991,8 @@ void reiserfs_kfree (const void * vp, size_t size, struct super_block * s) ...@@ -1988,7 +1991,8 @@ void reiserfs_kfree (const void * vp, size_t size, struct super_block * s)
REISERFS_SB(s)->s_kmallocs -= size; REISERFS_SB(s)->s_kmallocs -= size;
if (REISERFS_SB(s)->s_kmallocs < 0) if (REISERFS_SB(s)->s_kmallocs < 0)
reiserfs_warning ("vs-8302: reiserfs_kfree: allocated memory %d\n", REISERFS_SB(s)->s_kmallocs); reiserfs_warning (s, "vs-8302: reiserfs_kfree: allocated memory %d",
REISERFS_SB(s)->s_kmallocs);
} }
#endif #endif
...@@ -2048,8 +2052,9 @@ static int get_mem_for_virtual_node (struct tree_balance * tb) ...@@ -2048,8 +2052,9 @@ static int get_mem_for_virtual_node (struct tree_balance * tb)
buf = reiserfs_kmalloc(size, GFP_NOFS, tb->tb_sb); buf = reiserfs_kmalloc(size, GFP_NOFS, tb->tb_sb);
if ( !buf ) { if ( !buf ) {
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
reiserfs_warning ("vs-8345: get_mem_for_virtual_node: " reiserfs_warning (tb->tb_sb,
"kmalloc failed. reiserfs kmalloced %d bytes\n", "vs-8345: get_mem_for_virtual_node: "
"kmalloc failed. reiserfs kmalloced %d bytes",
REISERFS_SB(tb->tb_sb)->s_kmallocs); REISERFS_SB(tb->tb_sb)->s_kmallocs);
#endif #endif
tb->vn_buf_size = 0; tb->vn_buf_size = 0;
...@@ -2211,7 +2216,10 @@ static int wait_tb_buffers_until_unlocked (struct tree_balance * p_s_tb) ...@@ -2211,7 +2216,10 @@ static int wait_tb_buffers_until_unlocked (struct tree_balance * p_s_tb)
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
repeat_counter++; repeat_counter++;
if ( (repeat_counter % 10000) == 0) { if ( (repeat_counter % 10000) == 0) {
reiserfs_warning ("wait_tb_buffers_until_released(): too many iterations waiting for buffer to unlock (%b)\n", locked); reiserfs_warning (p_s_tb->tb_sb,
"wait_tb_buffers_until_released(): too many "
"iterations waiting for buffer to unlock "
"(%b)", locked);
/* Don't loop forever. Try to recover from possible error. */ /* Don't loop forever. Try to recover from possible error. */
...@@ -2324,8 +2332,7 @@ int fix_nodes (int n_op_mode, ...@@ -2324,8 +2332,7 @@ int fix_nodes (int n_op_mode,
case M_CUT: case M_CUT:
if ( n_item_num < 0 || n_item_num >= B_NR_ITEMS(p_s_tbS0) ) { if ( n_item_num < 0 || n_item_num >= B_NR_ITEMS(p_s_tbS0) ) {
print_block (p_s_tbS0, 0, -1, -1); print_block (p_s_tbS0, 0, -1, -1);
printk("mode = %c insert_size = %d\n", n_op_mode, p_s_tb->insert_size[0]); reiserfs_panic(p_s_tb->tb_sb,"PAP-8335: fix_nodes: Incorrect item number(%d); mode = %c insert_size = %d\n", n_item_num, n_op_mode, p_s_tb->insert_size[0]);
reiserfs_panic(p_s_tb->tb_sb,"PAP-8335: fix_nodes: Incorrect item number(%d)", n_item_num);
} }
break; break;
default: default:
......
...@@ -774,7 +774,7 @@ int reiserfs_get_block (struct inode * inode, sector_t block, ...@@ -774,7 +774,7 @@ int reiserfs_get_block (struct inode * inode, sector_t block,
retval = convert_tail_for_hole(inode, bh_result, tail_offset) ; retval = convert_tail_for_hole(inode, bh_result, tail_offset) ;
if (retval) { if (retval) {
if ( retval != -ENOSPC ) if ( retval != -ENOSPC )
printk("clm-6004: convert tail failed inode %lu, error %d\n", inode->i_ino, retval) ; reiserfs_warning (inode->i_sb, "clm-6004: convert tail failed inode %lu, error %d", inode->i_ino, retval) ;
if (allocated_block_nr) { if (allocated_block_nr) {
/* the bitmap, the super, and the stat data == 3 */ /* the bitmap, the super, and the stat data == 3 */
if (!th) if (!th)
...@@ -911,8 +911,8 @@ int reiserfs_get_block (struct inode * inode, sector_t block, ...@@ -911,8 +911,8 @@ int reiserfs_get_block (struct inode * inode, sector_t block,
goto failure; goto failure;
} }
if (retval == POSITION_FOUND) { if (retval == POSITION_FOUND) {
reiserfs_warning ("vs-825: reiserfs_get_block: " reiserfs_warning (inode->i_sb, "vs-825: reiserfs_get_block: "
"%K should not be found\n", &key); "%K should not be found", &key);
retval = -EEXIST; retval = -EEXIST;
if (allocated_block_nr) if (allocated_block_nr)
reiserfs_free_block (th, inode, allocated_block_nr, 1); reiserfs_free_block (th, inode, allocated_block_nr, 1);
...@@ -1222,7 +1222,7 @@ void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th, ...@@ -1222,7 +1222,7 @@ void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th,
/* look for the object's stat data */ /* look for the object's stat data */
retval = search_item (inode->i_sb, &key, &path); retval = search_item (inode->i_sb, &key, &path);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning ("vs-13050: reiserfs_update_sd: " reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: "
"i/o failure occurred trying to update %K stat data", "i/o failure occurred trying to update %K stat data",
&key); &key);
return; return;
...@@ -1231,11 +1231,11 @@ void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th, ...@@ -1231,11 +1231,11 @@ void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th,
pos = PATH_LAST_POSITION (&path); pos = PATH_LAST_POSITION (&path);
pathrelse(&path) ; pathrelse(&path) ;
if (inode->i_nlink == 0) { if (inode->i_nlink == 0) {
/*printk ("vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found\n");*/ /*reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found");*/
return; return;
} }
reiserfs_warning ("vs-13060: reiserfs_update_sd: " reiserfs_warning (inode->i_sb, "vs-13060: reiserfs_update_sd: "
"stat data of object %k (nlink == %d) not found (pos %d)\n", "stat data of object %k (nlink == %d) not found (pos %d)",
INODE_PKEY (inode), inode->i_nlink, pos); INODE_PKEY (inode), inode->i_nlink, pos);
reiserfs_check_path(&path) ; reiserfs_check_path(&path) ;
return; return;
...@@ -1308,8 +1308,8 @@ void reiserfs_read_locked_inode (struct inode * inode, struct reiserfs_iget_args ...@@ -1308,8 +1308,8 @@ void reiserfs_read_locked_inode (struct inode * inode, struct reiserfs_iget_args
/* look for the object's stat data */ /* look for the object's stat data */
retval = search_item (inode->i_sb, &key, &path_to_sd); retval = search_item (inode->i_sb, &key, &path_to_sd);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning ("vs-13070: reiserfs_read_locked_inode: " reiserfs_warning (inode->i_sb, "vs-13070: reiserfs_read_locked_inode: "
"i/o failure occurred trying to find stat data of %K\n", "i/o failure occurred trying to find stat data of %K",
&key); &key);
reiserfs_make_bad_inode(inode) ; reiserfs_make_bad_inode(inode) ;
return; return;
...@@ -1340,9 +1340,10 @@ void reiserfs_read_locked_inode (struct inode * inode, struct reiserfs_iget_args ...@@ -1340,9 +1340,10 @@ void reiserfs_read_locked_inode (struct inode * inode, struct reiserfs_iget_args
during mount (fs/reiserfs/super.c:finish_unfinished()). */ during mount (fs/reiserfs/super.c:finish_unfinished()). */
if( ( inode -> i_nlink == 0 ) && if( ( inode -> i_nlink == 0 ) &&
! REISERFS_SB(inode -> i_sb) -> s_is_unlinked_ok ) { ! REISERFS_SB(inode -> i_sb) -> s_is_unlinked_ok ) {
reiserfs_warning( "vs-13075: reiserfs_read_locked_inode: " reiserfs_warning (inode->i_sb,
"vs-13075: reiserfs_read_locked_inode: "
"dead inode read from disk %K. " "dead inode read from disk %K. "
"This is likely to be race with knfsd. Ignore\n", "This is likely to be race with knfsd. Ignore",
&key ); &key );
reiserfs_make_bad_inode( inode ); reiserfs_make_bad_inode( inode );
} }
...@@ -1445,7 +1446,7 @@ struct dentry *reiserfs_decode_fh(struct super_block *sb, __u32 *data, ...@@ -1445,7 +1446,7 @@ struct dentry *reiserfs_decode_fh(struct super_block *sb, __u32 *data,
*/ */
if (fhtype > len) { if (fhtype > len) {
if (fhtype != 6 || len != 5) if (fhtype != 6 || len != 5)
printk(KERN_WARNING "nfsd/reiserfs, fhtype=%d, len=%d - odd\n", reiserfs_warning (sb, "nfsd/reiserfs, fhtype=%d, len=%d - odd",
fhtype, len); fhtype, len);
fhtype = 5; fhtype = 5;
} }
...@@ -1508,7 +1509,8 @@ void reiserfs_write_inode (struct inode * inode, int do_sync) { ...@@ -1508,7 +1509,8 @@ void reiserfs_write_inode (struct inode * inode, int do_sync) {
int jbegin_count = 1 ; int jbegin_count = 1 ;
if (inode->i_sb->s_flags & MS_RDONLY) { if (inode->i_sb->s_flags & MS_RDONLY) {
reiserfs_warning("clm-6005: writing inode %lu on readonly FS\n", reiserfs_warning (inode->i_sb,
"clm-6005: writing inode %lu on readonly FS",
inode->i_ino) ; inode->i_ino) ;
return ; return ;
} }
...@@ -1572,13 +1574,13 @@ static int reiserfs_new_directory (struct reiserfs_transaction_handle *th, ...@@ -1572,13 +1574,13 @@ static int reiserfs_new_directory (struct reiserfs_transaction_handle *th,
/* look for place in the tree for new item */ /* look for place in the tree for new item */
retval = search_item (sb, &key, path); retval = search_item (sb, &key, path);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning ("vs-13080: reiserfs_new_directory: " reiserfs_warning (sb, "vs-13080: reiserfs_new_directory: "
"i/o failure occurred creating new directory\n"); "i/o failure occurred creating new directory");
return -EIO; return -EIO;
} }
if (retval == ITEM_FOUND) { if (retval == ITEM_FOUND) {
pathrelse (path); pathrelse (path);
reiserfs_warning ("vs-13070: reiserfs_new_directory: " reiserfs_warning (sb, "vs-13070: reiserfs_new_directory: "
"object with this key exists (%k)", &(ih->ih_key)); "object with this key exists (%k)", &(ih->ih_key));
return -EEXIST; return -EEXIST;
} }
...@@ -1609,13 +1611,13 @@ static int reiserfs_new_symlink (struct reiserfs_transaction_handle *th, ...@@ -1609,13 +1611,13 @@ static int reiserfs_new_symlink (struct reiserfs_transaction_handle *th,
/* look for place in the tree for new item */ /* look for place in the tree for new item */
retval = search_item (sb, &key, path); retval = search_item (sb, &key, path);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning ("vs-13080: reiserfs_new_symlinik: " reiserfs_warning (sb, "vs-13080: reiserfs_new_symlinik: "
"i/o failure occurred creating new symlink\n"); "i/o failure occurred creating new symlink");
return -EIO; return -EIO;
} }
if (retval == ITEM_FOUND) { if (retval == ITEM_FOUND) {
pathrelse (path); pathrelse (path);
reiserfs_warning ("vs-13080: reiserfs_new_symlink: " reiserfs_warning (sb, "vs-13080: reiserfs_new_symlink: "
"object with this key exists (%k)", &(ih->ih_key)); "object with this key exists (%k)", &(ih->ih_key));
return -EEXIST; return -EEXIST;
} }
...@@ -1800,7 +1802,8 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th, ...@@ -1800,7 +1802,8 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
goto out_inserted_sd; goto out_inserted_sd;
} }
} else if (inode->i_sb->s_flags & MS_POSIXACL) { } else if (inode->i_sb->s_flags & MS_POSIXACL) {
reiserfs_warning ("ACLs aren't enabled in the fs, but vfs thinks they are!\n"); reiserfs_warning (inode->i_sb, "ACLs aren't enabled in the fs, "
"but vfs thinks they are!");
} }
insert_inode_hash (inode); insert_inode_hash (inode);
...@@ -1898,7 +1901,8 @@ static int grab_tail_page(struct inode *p_s_inode, ...@@ -1898,7 +1901,8 @@ static int grab_tail_page(struct inode *p_s_inode,
** I've screwed up the code to find the buffer, or the code to ** I've screwed up the code to find the buffer, or the code to
** call prepare_write ** call prepare_write
*/ */
reiserfs_warning("clm-6000: error reading block %lu on dev %s\n", reiserfs_warning (p_s_inode->i_sb,
"clm-6000: error reading block %lu on dev %s",
bh->b_blocknr, bh->b_blocknr,
reiserfs_bdevname (p_s_inode->i_sb)) ; reiserfs_bdevname (p_s_inode->i_sb)) ;
error = -EIO ; error = -EIO ;
...@@ -1940,7 +1944,9 @@ void reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) { ...@@ -1940,7 +1944,9 @@ void reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) {
// and get_block_create_0 could not find a block to read in, // and get_block_create_0 could not find a block to read in,
// which is ok. // which is ok.
if (error != -ENOENT) if (error != -ENOENT)
reiserfs_warning("clm-6001: grab_tail_page failed %d\n", error); reiserfs_warning (p_s_inode->i_sb,
"clm-6001: grab_tail_page failed %d",
error);
page = NULL ; page = NULL ;
bh = NULL ; bh = NULL ;
} }
...@@ -2038,7 +2044,8 @@ static int map_block_for_writepage(struct inode *inode, ...@@ -2038,7 +2044,8 @@ static int map_block_for_writepage(struct inode *inode,
/* we've found an unformatted node */ /* we've found an unformatted node */
if (indirect_item_found(retval, ih)) { if (indirect_item_found(retval, ih)) {
if (bytes_copied > 0) { if (bytes_copied > 0) {
reiserfs_warning("clm-6002: bytes_copied %d\n", bytes_copied) ; reiserfs_warning (inode->i_sb, "clm-6002: bytes_copied %d",
bytes_copied) ;
} }
if (!get_block_num(item, pos_in_item)) { if (!get_block_num(item, pos_in_item)) {
/* crap, we are writing to a hole */ /* crap, we are writing to a hole */
...@@ -2086,7 +2093,9 @@ static int map_block_for_writepage(struct inode *inode, ...@@ -2086,7 +2093,9 @@ static int map_block_for_writepage(struct inode *inode,
goto research ; goto research ;
} }
} else { } else {
reiserfs_warning("clm-6003: bad item inode %lu, device %s\n", inode->i_ino, reiserfs_bdevname (inode->i_sb)) ; reiserfs_warning (inode->i_sb,
"clm-6003: bad item inode %lu, device %s",
inode->i_ino, reiserfs_bdevname (inode->i_sb)) ;
retval = -EIO ; retval = -EIO ;
goto out ; goto out ;
} }
......
...@@ -106,7 +106,7 @@ static int sd_unit_num (struct virtual_item * vi) ...@@ -106,7 +106,7 @@ static int sd_unit_num (struct virtual_item * vi)
static void sd_print_vi (struct virtual_item * vi) static void sd_print_vi (struct virtual_item * vi)
{ {
reiserfs_warning ("STATDATA, index %d, type 0x%x, %h\n", reiserfs_warning (NULL, "STATDATA, index %d, type 0x%x, %h",
vi->vi_index, vi->vi_type, vi->vi_ih); vi->vi_index, vi->vi_type, vi->vi_ih);
} }
...@@ -209,7 +209,7 @@ static int direct_unit_num (struct virtual_item * vi) ...@@ -209,7 +209,7 @@ static int direct_unit_num (struct virtual_item * vi)
static void direct_print_vi (struct virtual_item * vi) static void direct_print_vi (struct virtual_item * vi)
{ {
reiserfs_warning ("DIRECT, index %d, type 0x%x, %h\n", reiserfs_warning (NULL, "DIRECT, index %d, type 0x%x, %h",
vi->vi_index, vi->vi_type, vi->vi_ih); vi->vi_index, vi->vi_type, vi->vi_ih);
} }
...@@ -302,7 +302,7 @@ static void indirect_print_item (struct item_head * ih, char * item) ...@@ -302,7 +302,7 @@ static void indirect_print_item (struct item_head * ih, char * item)
unp = (__u32 *)item; unp = (__u32 *)item;
if (ih_item_len(ih) % UNFM_P_SIZE) if (ih_item_len(ih) % UNFM_P_SIZE)
printk ("indirect_print_item: invalid item len"); reiserfs_warning (NULL, "indirect_print_item: invalid item len");
printk ("%d pointers\n[ ", (int)I_UNFM_NUM (ih)); printk ("%d pointers\n[ ", (int)I_UNFM_NUM (ih));
for (j = 0; j < I_UNFM_NUM (ih); j ++) { for (j = 0; j < I_UNFM_NUM (ih); j ++) {
...@@ -363,7 +363,7 @@ static int indirect_unit_num (struct virtual_item * vi) ...@@ -363,7 +363,7 @@ static int indirect_unit_num (struct virtual_item * vi)
static void indirect_print_vi (struct virtual_item * vi) static void indirect_print_vi (struct virtual_item * vi)
{ {
reiserfs_warning ("INDIRECT, index %d, type 0x%x, %h\n", reiserfs_warning (NULL, "INDIRECT, index %d, type 0x%x, %h",
vi->vi_index, vi->vi_type, vi->vi_ih); vi->vi_index, vi->vi_type, vi->vi_ih);
} }
...@@ -390,7 +390,7 @@ struct item_operations indirect_ops = { ...@@ -390,7 +390,7 @@ struct item_operations indirect_ops = {
static int direntry_bytes_number (struct item_head * ih, int block_size) static int direntry_bytes_number (struct item_head * ih, int block_size)
{ {
reiserfs_warning ("vs-16090: direntry_bytes_number: " reiserfs_warning (NULL, "vs-16090: direntry_bytes_number: "
"bytes number is asked for direntry"); "bytes number is asked for direntry");
return 0; return 0;
} }
...@@ -582,8 +582,7 @@ static int direntry_check_left (struct virtual_item * vi, int free, ...@@ -582,8 +582,7 @@ static int direntry_check_left (struct virtual_item * vi, int free,
} }
if (entries == dir_u->entry_count) { if (entries == dir_u->entry_count) {
printk ("free spze %d, entry_count %d\n", free, dir_u->entry_count); reiserfs_panic (NULL, "free space %d, entry_count %d\n", free, dir_u->entry_count);
BUG ();
} }
/* "." and ".." can not be separated from each other */ /* "." and ".." can not be separated from each other */
...@@ -653,7 +652,7 @@ static void direntry_print_vi (struct virtual_item * vi) ...@@ -653,7 +652,7 @@ static void direntry_print_vi (struct virtual_item * vi)
int i; int i;
struct direntry_uarea * dir_u = vi->vi_uarea; struct direntry_uarea * dir_u = vi->vi_uarea;
reiserfs_warning ("DIRENTRY, index %d, type 0x%x, %h, flags 0x%x\n", reiserfs_warning (NULL, "DIRENTRY, index %d, type 0x%x, %h, flags 0x%x",
vi->vi_index, vi->vi_type, vi->vi_ih, dir_u->flags); vi->vi_index, vi->vi_type, vi->vi_ih, dir_u->flags);
printk ("%d entries: ", dir_u->entry_count); printk ("%d entries: ", dir_u->entry_count);
for (i = 0; i < dir_u->entry_count; i ++) for (i = 0; i < dir_u->entry_count; i ++)
...@@ -682,32 +681,32 @@ struct item_operations direntry_ops = { ...@@ -682,32 +681,32 @@ struct item_operations direntry_ops = {
// //
static int errcatch_bytes_number (struct item_head * ih, int block_size) static int errcatch_bytes_number (struct item_head * ih, int block_size)
{ {
reiserfs_warning ("green-16001: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16001: Invalid item type observed, run fsck ASAP");
return 0; return 0;
} }
static void errcatch_decrement_key (struct cpu_key * key) static void errcatch_decrement_key (struct cpu_key * key)
{ {
reiserfs_warning ("green-16002: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16002: Invalid item type observed, run fsck ASAP");
} }
static int errcatch_is_left_mergeable (struct key * key, unsigned long bsize) static int errcatch_is_left_mergeable (struct key * key, unsigned long bsize)
{ {
reiserfs_warning ("green-16003: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16003: Invalid item type observed, run fsck ASAP");
return 0; return 0;
} }
static void errcatch_print_item (struct item_head * ih, char * item) static void errcatch_print_item (struct item_head * ih, char * item)
{ {
reiserfs_warning ("green-16004: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16004: Invalid item type observed, run fsck ASAP");
} }
static void errcatch_check_item (struct item_head * ih, char * item) static void errcatch_check_item (struct item_head * ih, char * item)
{ {
reiserfs_warning ("green-16005: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16005: Invalid item type observed, run fsck ASAP");
} }
static int errcatch_create_vi (struct virtual_node * vn, static int errcatch_create_vi (struct virtual_node * vn,
...@@ -715,7 +714,7 @@ static int errcatch_create_vi (struct virtual_node * vn, ...@@ -715,7 +714,7 @@ static int errcatch_create_vi (struct virtual_node * vn,
int is_affected, int is_affected,
int insert_size) int insert_size)
{ {
reiserfs_warning ("green-16006: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16006: Invalid item type observed, run fsck ASAP");
return 0; // We might return -1 here as well, but it won't help as create_virtual_node() from where return 0; // We might return -1 here as well, but it won't help as create_virtual_node() from where
// this operation is called from is of return type void. // this operation is called from is of return type void.
} }
...@@ -723,32 +722,32 @@ static int errcatch_create_vi (struct virtual_node * vn, ...@@ -723,32 +722,32 @@ static int errcatch_create_vi (struct virtual_node * vn,
static int errcatch_check_left (struct virtual_item * vi, int free, static int errcatch_check_left (struct virtual_item * vi, int free,
int start_skip, int end_skip) int start_skip, int end_skip)
{ {
reiserfs_warning ("green-16007: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16007: Invalid item type observed, run fsck ASAP");
return -1; return -1;
} }
static int errcatch_check_right (struct virtual_item * vi, int free) static int errcatch_check_right (struct virtual_item * vi, int free)
{ {
reiserfs_warning ("green-16008: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16008: Invalid item type observed, run fsck ASAP");
return -1; return -1;
} }
static int errcatch_part_size (struct virtual_item * vi, int first, int count) static int errcatch_part_size (struct virtual_item * vi, int first, int count)
{ {
reiserfs_warning ("green-16009: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16009: Invalid item type observed, run fsck ASAP");
return 0; return 0;
} }
static int errcatch_unit_num (struct virtual_item * vi) static int errcatch_unit_num (struct virtual_item * vi)
{ {
reiserfs_warning ("green-16010: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16010: Invalid item type observed, run fsck ASAP");
return 0; return 0;
} }
static void errcatch_print_vi (struct virtual_item * vi) static void errcatch_print_vi (struct virtual_item * vi)
{ {
reiserfs_warning ("green-16011: Invalid item type observed, run fsck ASAP\n"); reiserfs_warning (NULL, "green-16011: Invalid item type observed, run fsck ASAP");
} }
struct item_operations errcatch_ops = { struct item_operations errcatch_ops = {
......
This diff is collapsed.
...@@ -1210,10 +1210,10 @@ void leaf_paste_entries ( ...@@ -1210,10 +1210,10 @@ void leaf_paste_entries (
prev = (i != 0) ? deh_location( &(deh[i - 1]) ) : 0; prev = (i != 0) ? deh_location( &(deh[i - 1]) ) : 0;
if (prev && prev <= deh_location( &(deh[i]))) if (prev && prev <= deh_location( &(deh[i])))
reiserfs_warning ("vs-10240: leaf_paste_entries: directory item (%h) corrupted (prev %a, cur(%d) %a)\n", reiserfs_warning (NULL, "vs-10240: leaf_paste_entries: directory item (%h) corrupted (prev %a, cur(%d) %a)",
ih, deh + i - 1, i, deh + i); ih, deh + i - 1, i, deh + i);
if (next && next >= deh_location( &(deh[i]))) if (next && next >= deh_location( &(deh[i])))
reiserfs_warning ("vs-10250: leaf_paste_entries: directory item (%h) corrupted (cur(%d) %a, next %a)\n", reiserfs_warning (NULL, "vs-10250: leaf_paste_entries: directory item (%h) corrupted (cur(%d) %a, next %a)",
ih, i, deh + i, deh + i + 1); ih, i, deh + i, deh + i + 1);
} }
} }
......
...@@ -126,7 +126,7 @@ int search_by_entry_key (struct super_block * sb, const struct cpu_key * key, ...@@ -126,7 +126,7 @@ int search_by_entry_key (struct super_block * sb, const struct cpu_key * key,
switch (retval) { switch (retval) {
case ITEM_NOT_FOUND: case ITEM_NOT_FOUND:
if (!PATH_LAST_POSITION (path)) { if (!PATH_LAST_POSITION (path)) {
reiserfs_warning ("vs-7000: search_by_entry_key: search_by_key returned item position == 0"); reiserfs_warning (sb, "vs-7000: search_by_entry_key: search_by_key returned item position == 0");
pathrelse(path) ; pathrelse(path) ;
return IO_ERROR ; return IO_ERROR ;
} }
...@@ -140,7 +140,7 @@ int search_by_entry_key (struct super_block * sb, const struct cpu_key * key, ...@@ -140,7 +140,7 @@ int search_by_entry_key (struct super_block * sb, const struct cpu_key * key,
default: default:
pathrelse (path); pathrelse (path);
reiserfs_warning ("vs-7002: search_by_entry_key: no path to here"); reiserfs_warning (sb, "vs-7002: search_by_entry_key: no path to here");
return IO_ERROR; return IO_ERROR;
} }
...@@ -299,7 +299,8 @@ static int reiserfs_find_entry (struct inode * dir, const char * name, int namel ...@@ -299,7 +299,8 @@ static int reiserfs_find_entry (struct inode * dir, const char * name, int namel
while (1) { while (1) {
retval = search_by_entry_key (dir->i_sb, &key_to_search, path_to_entry, de); retval = search_by_entry_key (dir->i_sb, &key_to_search, path_to_entry, de);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning ("zam-7001: io error in %s\n", __FUNCTION__); reiserfs_warning (dir->i_sb, "zam-7001: io error in %s",
__FUNCTION__);
return IO_ERROR; return IO_ERROR;
} }
...@@ -484,8 +485,9 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in ...@@ -484,8 +485,9 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
} }
if (retval != NAME_FOUND) { if (retval != NAME_FOUND) {
reiserfs_warning ("zam-7002:%s: \"reiserfs_find_entry\" has returned" reiserfs_warning (dir->i_sb, "zam-7002:%s: \"reiserfs_find_entry\" "
" unexpected value (%d)\n", __FUNCTION__, retval); "has returned unexpected value (%d)",
__FUNCTION__, retval);
} }
return -EEXIST; return -EEXIST;
...@@ -494,7 +496,7 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in ...@@ -494,7 +496,7 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
gen_number = find_first_zero_bit ((unsigned long *)bit_string, MAX_GENERATION_NUMBER + 1); gen_number = find_first_zero_bit ((unsigned long *)bit_string, MAX_GENERATION_NUMBER + 1);
if (gen_number > MAX_GENERATION_NUMBER) { if (gen_number > MAX_GENERATION_NUMBER) {
/* there is no free generation number */ /* there is no free generation number */
reiserfs_warning ("reiserfs_add_entry: Congratulations! we have got hash function screwed up\n"); reiserfs_warning (dir->i_sb, "reiserfs_add_entry: Congratulations! we have got hash function screwed up");
if (buffer != small_buf) if (buffer != small_buf)
reiserfs_kfree (buffer, buflen, dir->i_sb); reiserfs_kfree (buffer, buflen, dir->i_sb);
pathrelse (&path); pathrelse (&path);
...@@ -509,8 +511,9 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in ...@@ -509,8 +511,9 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
if (gen_number != 0) { /* we need to re-search for the insertion point */ if (gen_number != 0) { /* we need to re-search for the insertion point */
if (search_by_entry_key (dir->i_sb, &entry_key, &path, &de) != NAME_NOT_FOUND) { if (search_by_entry_key (dir->i_sb, &entry_key, &path, &de) != NAME_NOT_FOUND) {
reiserfs_warning ("vs-7032: reiserfs_add_entry: " reiserfs_warning (dir->i_sb, "vs-7032: reiserfs_add_entry: "
"entry with this key (%K) already exists\n", &entry_key); "entry with this key (%K) already exists",
&entry_key);
if (buffer != small_buf) if (buffer != small_buf)
reiserfs_kfree (buffer, buflen, dir->i_sb); reiserfs_kfree (buffer, buflen, dir->i_sb);
...@@ -835,7 +838,8 @@ static int reiserfs_rmdir (struct inode * dir, struct dentry *dentry) ...@@ -835,7 +838,8 @@ static int reiserfs_rmdir (struct inode * dir, struct dentry *dentry)
goto end_rmdir; goto end_rmdir;
if ( inode->i_nlink != 2 && inode->i_nlink != 1 ) if ( inode->i_nlink != 2 && inode->i_nlink != 1 )
printk ("reiserfs_rmdir: empty directory has nlink != 2 (%d)\n", inode->i_nlink); reiserfs_warning (inode->i_sb, "%s: empty directory has nlink "
"!= 2 (%d)", __FUNCTION__, inode->i_nlink);
inode->i_nlink = 0; inode->i_nlink = 0;
inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
...@@ -902,8 +906,10 @@ static int reiserfs_unlink (struct inode * dir, struct dentry *dentry) ...@@ -902,8 +906,10 @@ static int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
} }
if (!inode->i_nlink) { if (!inode->i_nlink) {
printk("reiserfs_unlink: deleting nonexistent file (%s:%lu), %d\n", reiserfs_warning (inode->i_sb, "%s: deleting nonexistent file "
reiserfs_bdevname (inode->i_sb), inode->i_ino, inode->i_nlink); "(%s:%lu), %d", __FUNCTION__,
reiserfs_bdevname (inode->i_sb), inode->i_ino,
inode->i_nlink);
inode->i_nlink = 1; inode->i_nlink = 1;
} }
...@@ -1337,7 +1343,7 @@ static int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry, ...@@ -1337,7 +1343,7 @@ static int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
// anybody, but it will panic if will not be able to find the // anybody, but it will panic if will not be able to find the
// entry. This needs one more clean up // entry. This needs one more clean up
if (reiserfs_cut_from_item (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL, 0) < 0) if (reiserfs_cut_from_item (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL, 0) < 0)
reiserfs_warning ("vs-7060: reiserfs_rename: couldn't not cut old name. Fsck later?\n"); reiserfs_warning (old_dir->i_sb, "vs-7060: reiserfs_rename: couldn't not cut old name. Fsck later?");
old_dir->i_size -= DEH_SIZE + old_de.de_entrylen; old_dir->i_size -= DEH_SIZE + old_de.de_entrylen;
......
...@@ -62,7 +62,7 @@ __u32 reiserfs_get_unused_objectid (struct reiserfs_transaction_handle *th) ...@@ -62,7 +62,7 @@ __u32 reiserfs_get_unused_objectid (struct reiserfs_transaction_handle *th)
/* comment needed -Hans */ /* comment needed -Hans */
unused_objectid = le32_to_cpu (map[1]); unused_objectid = le32_to_cpu (map[1]);
if (unused_objectid == U32_MAX) { if (unused_objectid == U32_MAX) {
printk ("REISERFS: get_objectid: no more object ids\n"); reiserfs_warning (s, "%s: no more object ids", __FUNCTION__);
reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s)) ; reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s)) ;
return 0; return 0;
} }
...@@ -159,7 +159,7 @@ void reiserfs_release_objectid (struct reiserfs_transaction_handle *th, ...@@ -159,7 +159,7 @@ void reiserfs_release_objectid (struct reiserfs_transaction_handle *th,
i += 2; i += 2;
} }
reiserfs_warning ("vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)\n", reiserfs_warning (s, "vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)",
( long unsigned ) objectid_to_release); ( long unsigned ) objectid_to_release);
} }
......
...@@ -264,20 +264,43 @@ prepare_error_buf( const char *fmt, va_list args ) ...@@ -264,20 +264,43 @@ prepare_error_buf( const char *fmt, va_list args )
va_end( args );\ va_end( args );\
} }
void reiserfs_warning (const char * fmt, ...) void reiserfs_warning (struct super_block *sb, const char * fmt, ...)
{ {
do_reiserfs_warning(fmt); do_reiserfs_warning(fmt);
/* console_print (error_buf); */ if (sb)
printk (KERN_WARNING "%s", error_buf); printk (KERN_WARNING "ReiserFS: %s: warning: %s\n",
reiserfs_bdevname (sb), error_buf);
else
printk (KERN_WARNING "ReiserFS: warning: %s\n", error_buf);
}
/* No newline.. reiserfs_info calls can be followed by printk's */
void reiserfs_info (struct super_block *sb, const char * fmt, ...)
{
do_reiserfs_warning(fmt);
if (sb)
printk (KERN_NOTICE "ReiserFS: %s: %s",
reiserfs_bdevname (sb), error_buf);
else
printk (KERN_NOTICE "ReiserFS: %s", error_buf);
}
/* No newline.. reiserfs_printk calls can be followed by printk's */
void reiserfs_printk (const char * fmt, ...)
{
do_reiserfs_warning(fmt);
printk (error_buf);
} }
void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...) void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...)
{ {
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
do_reiserfs_warning(fmt); do_reiserfs_warning(fmt);
printk (KERN_DEBUG "%s", error_buf); if (s)
#else printk (KERN_DEBUG "ReiserFS: %s: %s\n",
; reiserfs_bdevname (s), error_buf);
else
printk (KERN_DEBUG "ReiserFS: %s\n", error_buf);
#endif #endif
} }
...@@ -334,7 +357,8 @@ extern struct tree_balance * cur_tb; ...@@ -334,7 +357,8 @@ extern struct tree_balance * cur_tb;
void reiserfs_panic (struct super_block * sb, const char * fmt, ...) void reiserfs_panic (struct super_block * sb, const char * fmt, ...)
{ {
do_reiserfs_warning(fmt); do_reiserfs_warning(fmt);
printk ( KERN_EMERG "%s", error_buf); printk (KERN_EMERG "REISERFS: panic (device %s): %s\n",
reiserfs_bdevname (sb), error_buf);
BUG (); BUG ();
/* this is not actually called, but makes reiserfs_panic() "noreturn" */ /* this is not actually called, but makes reiserfs_panic() "noreturn" */
...@@ -413,13 +437,13 @@ static int print_internal (struct buffer_head * bh, int first, int last) ...@@ -413,13 +437,13 @@ static int print_internal (struct buffer_head * bh, int first, int last)
to = last < B_NR_ITEMS (bh) ? last : B_NR_ITEMS (bh); to = last < B_NR_ITEMS (bh) ? last : B_NR_ITEMS (bh);
} }
reiserfs_warning ("INTERNAL NODE (%ld) contains %z\n", bh->b_blocknr, bh); reiserfs_printk ("INTERNAL NODE (%ld) contains %z\n", bh->b_blocknr, bh);
dc = B_N_CHILD (bh, from); dc = B_N_CHILD (bh, from);
reiserfs_warning ("PTR %d: %y ", from, dc); reiserfs_printk ("PTR %d: %y ", from, dc);
for (i = from, key = B_N_PDELIM_KEY (bh, from), dc ++; i < to; i ++, key ++, dc ++) { for (i = from, key = B_N_PDELIM_KEY (bh, from), dc ++; i < to; i ++, key ++, dc ++) {
reiserfs_warning ("KEY %d: %k PTR %d: %y ", i, key, i + 1, dc); reiserfs_printk ("KEY %d: %k PTR %d: %y ", i, key, i + 1, dc);
if (i && i % 4 == 0) if (i && i % 4 == 0)
printk ("\n"); printk ("\n");
} }
...@@ -448,10 +472,10 @@ static int print_leaf (struct buffer_head * bh, int print_mode, int first, int l ...@@ -448,10 +472,10 @@ static int print_leaf (struct buffer_head * bh, int print_mode, int first, int l
nr = blkh_nr_item(blkh); nr = blkh_nr_item(blkh);
printk ("\n===================================================================\n"); printk ("\n===================================================================\n");
reiserfs_warning ("LEAF NODE (%ld) contains %z\n", bh->b_blocknr, bh); reiserfs_printk ("LEAF NODE (%ld) contains %z\n", bh->b_blocknr, bh);
if (!(print_mode & PRINT_LEAF_ITEMS)) { if (!(print_mode & PRINT_LEAF_ITEMS)) {
reiserfs_warning ("FIRST ITEM_KEY: %k, LAST ITEM KEY: %k\n", reiserfs_printk ("FIRST ITEM_KEY: %k, LAST ITEM KEY: %k\n",
&(ih->ih_key), &((ih + nr - 1)->ih_key)); &(ih->ih_key), &((ih + nr - 1)->ih_key));
return 0; return 0;
} }
...@@ -471,7 +495,7 @@ static int print_leaf (struct buffer_head * bh, int print_mode, int first, int l ...@@ -471,7 +495,7 @@ static int print_leaf (struct buffer_head * bh, int print_mode, int first, int l
printk ("|##| type | key | ilen | free_space | version | loc |\n"); printk ("|##| type | key | ilen | free_space | version | loc |\n");
for (i = from; i < to; i++, ih ++) { for (i = from; i < to; i++, ih ++) {
printk ("-------------------------------------------------------------------------------\n"); printk ("-------------------------------------------------------------------------------\n");
reiserfs_warning ("|%2d| %h |\n", i, ih); reiserfs_printk ("|%2d| %h |\n", i, ih);
if (print_mode & PRINT_LEAF_ITEMS) if (print_mode & PRINT_LEAF_ITEMS)
op_print_item (ih, B_I_PITEM (bh, ih)); op_print_item (ih, B_I_PITEM (bh, ih));
} }
......
...@@ -548,7 +548,7 @@ int reiserfs_proc_info_init( struct super_block *sb ) ...@@ -548,7 +548,7 @@ int reiserfs_proc_info_init( struct super_block *sb )
add_file(sb, "journal", show_journal); add_file(sb, "journal", show_journal);
return 0; return 0;
} }
reiserfs_warning( "reiserfs: cannot create /proc/%s/%s\n", reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s",
proc_info_root_name, reiserfs_bdevname (sb) ); proc_info_root_name, reiserfs_bdevname (sb) );
return 1; return 1;
} }
...@@ -595,7 +595,8 @@ int reiserfs_proc_info_global_init( void ) ...@@ -595,7 +595,8 @@ int reiserfs_proc_info_global_init( void )
if( proc_info_root ) { if( proc_info_root ) {
proc_info_root -> owner = THIS_MODULE; proc_info_root -> owner = THIS_MODULE;
} else { } else {
reiserfs_warning( "reiserfs: cannot create /proc/%s\n", reiserfs_warning (NULL,
"reiserfs: cannot create /proc/%s",
proc_info_root_name ); proc_info_root_name );
return 1; return 1;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -50,9 +50,9 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod ...@@ -50,9 +50,9 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod
// FIXME: we could avoid this // FIXME: we could avoid this
if ( search_for_position_by_key (sb, &end_key, path) == POSITION_FOUND ) { if ( search_for_position_by_key (sb, &end_key, path) == POSITION_FOUND ) {
reiserfs_warning ("PAP-14030: direct2indirect: " reiserfs_warning (sb, "PAP-14030: direct2indirect: "
"pasted or inserted byte exists in the tree %K. " "pasted or inserted byte exists in the tree %K. "
"Use fsck to repair.\n", &end_key); "Use fsck to repair.", &end_key);
pathrelse(path); pathrelse(path);
return -EIO; return -EIO;
} }
......
...@@ -326,7 +326,7 @@ static int __xattr_readdir(struct file * filp, void * dirent, filldir_t filldir) ...@@ -326,7 +326,7 @@ static int __xattr_readdir(struct file * filp, void * dirent, filldir_t filldir)
ih = de.de_ih; ih = de.de_ih;
if (!is_direntry_le_ih(ih)) { if (!is_direntry_le_ih(ih)) {
reiserfs_warning("not direntry %h\n", ih); reiserfs_warning(inode->i_sb, "not direntry %h", ih);
break; break;
} }
copy_item_head(&tmp_ih, ih); copy_item_head(&tmp_ih, ih);
...@@ -671,9 +671,8 @@ reiserfs_xattr_get (const struct inode *inode, const char *name, void *buffer, ...@@ -671,9 +671,8 @@ reiserfs_xattr_get (const struct inode *inode, const char *name, void *buffer,
if (rxh->h_magic != cpu_to_le32 (REISERFS_XATTR_MAGIC)) { if (rxh->h_magic != cpu_to_le32 (REISERFS_XATTR_MAGIC)) {
unlock_page (page); unlock_page (page);
reiserfs_put_page (page); reiserfs_put_page (page);
reiserfs_warning ("reiserfs: Invalid magic for xattr (%s) " reiserfs_warning (inode->i_sb, "Invalid magic for xattr (%s) "
"associated with %s %k\n", name, "associated with %k", name,
reiserfs_bdevname (inode->i_sb),
INODE_PKEY (inode)); INODE_PKEY (inode));
err = -EIO; err = -EIO;
goto out_dput; goto out_dput;
...@@ -690,9 +689,8 @@ reiserfs_xattr_get (const struct inode *inode, const char *name, void *buffer, ...@@ -690,9 +689,8 @@ reiserfs_xattr_get (const struct inode *inode, const char *name, void *buffer,
err = isize - sizeof (struct reiserfs_xattr_header); err = isize - sizeof (struct reiserfs_xattr_header);
if (xattr_hash (buffer, isize - sizeof (struct reiserfs_xattr_header)) != hash) { if (xattr_hash (buffer, isize - sizeof (struct reiserfs_xattr_header)) != hash) {
reiserfs_warning ("reiserfs: Invalid hash for xattr (%s) associated " reiserfs_warning (inode->i_sb, "Invalid hash for xattr (%s) associated "
"with %s %k\n", name, "with %k", name, INODE_PKEY (inode));
reiserfs_bdevname (inode->i_sb), INODE_PKEY (inode));
err = -EIO; err = -EIO;
} }
...@@ -724,7 +722,8 @@ __reiserfs_xattr_del (struct dentry *xadir, const char *name, int namelen) ...@@ -724,7 +722,8 @@ __reiserfs_xattr_del (struct dentry *xadir, const char *name, int namelen)
goto out_file; goto out_file;
if (!is_reiserfs_priv_object (dentry->d_inode)) { if (!is_reiserfs_priv_object (dentry->d_inode)) {
reiserfs_warning ("OID %08x [%.*s/%.*s] doesn't have priv flag set [parent is %sset].\n", reiserfs_warning (dir->i_sb, "OID %08x [%.*s/%.*s] doesn't have "
"priv flag set [parent is %sset].",
le32_to_cpu (INODE_PKEY (dentry->d_inode)->k_objectid), le32_to_cpu (INODE_PKEY (dentry->d_inode)->k_objectid),
xadir->d_name.len, xadir->d_name.name, namelen, name, xadir->d_name.len, xadir->d_name.name, namelen, name,
is_reiserfs_priv_object (xadir->d_inode) ? "" : "not "); is_reiserfs_priv_object (xadir->d_inode) ? "" : "not ");
...@@ -828,7 +827,8 @@ reiserfs_delete_xattrs (struct inode *inode) ...@@ -828,7 +827,8 @@ reiserfs_delete_xattrs (struct inode *inode)
reiserfs_write_unlock_xattrs (inode->i_sb); reiserfs_write_unlock_xattrs (inode->i_sb);
dput (root); dput (root);
} else { } else {
reiserfs_warning ("Couldn't remove all entries in directory\n"); reiserfs_warning (inode->i_sb,
"Couldn't remove all entries in directory");
} }
unlock_kernel (); unlock_kernel ();
...@@ -1264,8 +1264,8 @@ reiserfs_xattr_init (struct super_block *s, int mount_flags) ...@@ -1264,8 +1264,8 @@ reiserfs_xattr_init (struct super_block *s, int mount_flags)
} else if (reiserfs_xattrs_optional (s)) { } else if (reiserfs_xattrs_optional (s)) {
/* Old format filesystem, but optional xattrs have been enabled /* Old format filesystem, but optional xattrs have been enabled
* at mount time. Error out. */ * at mount time. Error out. */
reiserfs_warning ("reiserfs: xattrs/ACLs not supported on pre v3.6 " reiserfs_warning (s, "xattrs/ACLs not supported on pre v3.6 "
"format filesystem. Failing mount.\n"); "format filesystem. Failing mount.");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto error; goto error;
} else { } else {
...@@ -1291,8 +1291,8 @@ reiserfs_xattr_init (struct super_block *s, int mount_flags) ...@@ -1291,8 +1291,8 @@ reiserfs_xattr_init (struct super_block *s, int mount_flags)
} }
if (dentry && dentry->d_inode) if (dentry && dentry->d_inode)
reiserfs_warning ("reiserfs: Created %s on %s - reserved for " reiserfs_warning (s, "Created %s on %s - reserved for "
"xattr storage.\n", PRIVROOT_NAME, "xattr storage.", PRIVROOT_NAME,
reiserfs_bdevname (inode->i_sb)); reiserfs_bdevname (inode->i_sb));
} else if (!dentry->d_inode) { } else if (!dentry->d_inode) {
dput (dentry); dput (dentry);
...@@ -1309,8 +1309,8 @@ reiserfs_xattr_init (struct super_block *s, int mount_flags) ...@@ -1309,8 +1309,8 @@ reiserfs_xattr_init (struct super_block *s, int mount_flags)
/* If we're read-only it just means that the dir hasn't been /* If we're read-only it just means that the dir hasn't been
* created. Not an error -- just no xattrs on the fs. We'll * created. Not an error -- just no xattrs on the fs. We'll
* check again if we go read-write */ * check again if we go read-write */
reiserfs_warning ("reiserfs: xattrs/ACLs enabled and couldn't " reiserfs_warning (s, "xattrs/ACLs enabled and couldn't "
"find/create .reiserfs_priv. Failing mount.\n"); "find/create .reiserfs_priv. Failing mount.");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
} }
} }
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
*/ */
#define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ #define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */
void reiserfs_warning (struct super_block *s, const char * fmt, ...);
/* assertions handling */ /* assertions handling */
/** always check a condition and panic if it's false. */ /** always check a condition and panic if it's false. */
...@@ -562,9 +563,6 @@ struct item_head ...@@ -562,9 +563,6 @@ struct item_head
#define V1_DIRENTRY_UNIQUENESS 500 #define V1_DIRENTRY_UNIQUENESS 500
#define V1_ANY_UNIQUENESS 555 // FIXME: comment is required #define V1_ANY_UNIQUENESS 555 // FIXME: comment is required
extern void reiserfs_warning (const char * fmt, ...);
/* __attribute__( ( format ( printf, 1, 2 ) ) ); */
// //
// here are conversion routines // here are conversion routines
// //
...@@ -577,7 +575,8 @@ static inline int uniqueness2type (__u32 uniqueness) ...@@ -577,7 +575,8 @@ static inline int uniqueness2type (__u32 uniqueness)
case V1_DIRECT_UNIQUENESS: return TYPE_DIRECT; case V1_DIRECT_UNIQUENESS: return TYPE_DIRECT;
case V1_DIRENTRY_UNIQUENESS: return TYPE_DIRENTRY; case V1_DIRENTRY_UNIQUENESS: return TYPE_DIRENTRY;
default: default:
reiserfs_warning( "vs-500: unknown uniqueness %d\n", uniqueness); reiserfs_warning (NULL, "vs-500: unknown uniqueness %d",
uniqueness);
case V1_ANY_UNIQUENESS: case V1_ANY_UNIQUENESS:
return TYPE_ANY; return TYPE_ANY;
} }
...@@ -592,7 +591,7 @@ static inline __u32 type2uniqueness (int type) ...@@ -592,7 +591,7 @@ static inline __u32 type2uniqueness (int type)
case TYPE_DIRECT: return V1_DIRECT_UNIQUENESS; case TYPE_DIRECT: return V1_DIRECT_UNIQUENESS;
case TYPE_DIRENTRY: return V1_DIRENTRY_UNIQUENESS; case TYPE_DIRENTRY: return V1_DIRENTRY_UNIQUENESS;
default: default:
reiserfs_warning( "vs-501: unknown type %d\n", type); reiserfs_warning (NULL, "vs-501: unknown type %d", type);
case TYPE_ANY: case TYPE_ANY:
return V1_ANY_UNIQUENESS; return V1_ANY_UNIQUENESS;
} }
...@@ -1771,7 +1770,7 @@ void reiserfs_update_inode_transaction(struct inode *) ; ...@@ -1771,7 +1770,7 @@ void reiserfs_update_inode_transaction(struct inode *) ;
void reiserfs_wait_on_write_block(struct super_block *s) ; void reiserfs_wait_on_write_block(struct super_block *s) ;
void reiserfs_block_writes(struct reiserfs_transaction_handle *th) ; void reiserfs_block_writes(struct reiserfs_transaction_handle *th) ;
void reiserfs_allow_writes(struct super_block *s) ; void reiserfs_allow_writes(struct super_block *s) ;
void reiserfs_check_lock_depth(char *caller) ; void reiserfs_check_lock_depth(struct super_block *s, char *caller) ;
int reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh, int wait) ; int reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh, int wait) ;
void reiserfs_restore_prepared_buffer(struct super_block *, struct buffer_head *bh) ; void reiserfs_restore_prepared_buffer(struct super_block *, struct buffer_head *bh) ;
int journal_init(struct super_block *, const char * j_dev_name, int old_format, unsigned int) ; int journal_init(struct super_block *, const char * j_dev_name, int old_format, unsigned int) ;
...@@ -2063,10 +2062,10 @@ void free_buffers_in_tb (struct tree_balance * p_s_tb); ...@@ -2063,10 +2062,10 @@ void free_buffers_in_tb (struct tree_balance * p_s_tb);
/* prints.c */ /* prints.c */
void reiserfs_panic (struct super_block * s, const char * fmt, ...) void reiserfs_panic (struct super_block * s, const char * fmt, ...) __attribute__ ( ( noreturn ) );
__attribute__ ( ( noreturn ) );/* __attribute__( ( format ( printf, 2, 3 ) ) ) */ void reiserfs_info (struct super_block *s, const char * fmt, ...);
void reiserfs_printk (const char * fmt, ...);
void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...); void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...);
/* __attribute__( ( format ( printf, 3, 4 ) ) ); */
void print_virtual_node (struct virtual_node * vn); void print_virtual_node (struct virtual_node * vn);
void print_indirect_item (struct buffer_head * bh, int item_num); void print_indirect_item (struct buffer_head * bh, int item_num);
void store_print_tb (struct tree_balance * tb); void store_print_tb (struct tree_balance * tb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment