From eba00305591714f1d85ccad1afbf58259c2197b4 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Mon, 30 Mar 2009 14:02:18 -0400 Subject: reiserfs: use buffer_info for leaf_paste_entries This patch makes leaf_paste_entries more consistent with respect to the other leaf operations. Using buffer_info instead of buffer_head directly allows us to get a superblock pointer for use in error handling. Signed-off-by: Jeff Mahoney Signed-off-by: Linus Torvalds --- fs/reiserfs/lbalance.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/reiserfs/lbalance.c') diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c index 6de060a6aa7f..41bdd8c75887 100644 --- a/fs/reiserfs/lbalance.c +++ b/fs/reiserfs/lbalance.c @@ -111,7 +111,7 @@ static void leaf_copy_dir_entries(struct buffer_info *dest_bi, item_num_in_dest = (last_first == FIRST_TO_LAST) ? (B_NR_ITEMS(dest) - 1) : 0; - leaf_paste_entries(dest_bi->bi_bh, item_num_in_dest, + leaf_paste_entries(dest_bi, item_num_in_dest, (last_first == FIRST_TO_LAST) ? I_ENTRY_COUNT(B_N_PITEM_HEAD(dest, item_num_in_dest)) @@ -1191,7 +1191,7 @@ static void leaf_delete_items_entirely(struct buffer_info *bi, } /* paste new_entry_count entries (new_dehs, records) into position before to item_num-th item */ -void leaf_paste_entries(struct buffer_head *bh, +void leaf_paste_entries(struct buffer_info *bi, int item_num, int before, int new_entry_count, @@ -1203,6 +1203,7 @@ void leaf_paste_entries(struct buffer_head *bh, struct reiserfs_de_head *deh; char *insert_point; int i, old_entry_num; + struct buffer_head *bh = bi->bi_bh; if (new_entry_count == 0) return; -- cgit v1.2.3-59-g8ed1b From 45b03d5e8e674eb6555b767e1c8eb40b671ff892 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Mon, 30 Mar 2009 14:02:21 -0400 Subject: reiserfs: rework reiserfs_warning ReiserFS warnings 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 Signed-off-by: Linus Torvalds --- fs/reiserfs/bitmap.c | 52 ++++----- fs/reiserfs/do_balan.c | 40 +++---- fs/reiserfs/file.c | 2 +- fs/reiserfs/fix_node.c | 14 +-- fs/reiserfs/inode.c | 60 +++++----- fs/reiserfs/item_ops.c | 60 +++++----- fs/reiserfs/journal.c | 174 +++++++++++++++------------- fs/reiserfs/lbalance.c | 12 +- fs/reiserfs/namei.c | 45 ++++---- fs/reiserfs/objectid.c | 5 +- fs/reiserfs/prints.c | 11 +- fs/reiserfs/procfs.c | 5 +- fs/reiserfs/stree.c | 107 ++++++++---------- fs/reiserfs/super.c | 257 ++++++++++++++++++++++-------------------- fs/reiserfs/tail_conversion.c | 6 +- fs/reiserfs/xattr.c | 21 ++-- include/linux/reiserfs_fs.h | 9 +- 17 files changed, 454 insertions(+), 426 deletions(-) (limited to 'fs/reiserfs/lbalance.c') diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index 98b92a3da14a..51b116103041 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c @@ -64,8 +64,8 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value) unsigned int bmap_count = reiserfs_bmap_count(s); if (block == 0 || block >= SB_BLOCK_COUNT(s)) { - reiserfs_warning(s, - "vs-4010: is_reusable: block number is out of range %lu (%u)", + reiserfs_warning(s, "vs-4010", + "block number is out of range %lu (%u)", block, SB_BLOCK_COUNT(s)); return 0; } @@ -79,30 +79,29 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value) b_blocknr_t bmap1 = REISERFS_SB(s)->s_sbh->b_blocknr + 1; if (block >= bmap1 && block <= bmap1 + bmap_count) { - reiserfs_warning(s, "vs: 4019: is_reusable: " - "bitmap block %lu(%u) can't be freed or reused", + reiserfs_warning(s, "vs-4019", "bitmap block %lu(%u) " + "can't be freed or reused", block, bmap_count); return 0; } } else { if (offset == 0) { - reiserfs_warning(s, "vs: 4020: is_reusable: " - "bitmap block %lu(%u) can't be freed or reused", + reiserfs_warning(s, "vs-4020", "bitmap block %lu(%u) " + "can't be freed or reused", block, bmap_count); return 0; } } if (bmap >= bmap_count) { - reiserfs_warning(s, - "vs-4030: is_reusable: there is no so many bitmap blocks: " - "block=%lu, bitmap_nr=%u", block, bmap); + reiserfs_warning(s, "vs-4030", "bitmap for requested block " + "is out of range: block=%lu, bitmap_nr=%u", + block, bmap); return 0; } if (bit_value == 0 && block == SB_ROOT_BLOCK(s)) { - reiserfs_warning(s, - "vs-4050: is_reusable: this is root block (%u), " + reiserfs_warning(s, "vs-4050", "this is root block (%u), " "it must be busy", SB_ROOT_BLOCK(s)); return 0; } @@ -154,8 +153,8 @@ static int scan_bitmap_block(struct reiserfs_transaction_handle *th, /* - I mean `a window of zero bits' as in description of this function - Zam. */ if (!bi) { - reiserfs_warning(s, "NULL bitmap info pointer for bitmap %d", - bmap_n); + reiserfs_warning(s, "jdm-4055", "NULL bitmap info pointer " + "for bitmap %d", bmap_n); return 0; } @@ -400,11 +399,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th, get_bit_address(s, block, &nr, &offset); if (nr >= reiserfs_bmap_count(s)) { - reiserfs_warning(s, "vs-4075: reiserfs_free_block: " - "block %lu is out of range on %s " - "(nr=%u,max=%u)", block, - reiserfs_bdevname(s), nr, - reiserfs_bmap_count(s)); + reiserfs_warning(s, "vs-4075", "block %lu is out of range", + block); return; } @@ -416,9 +412,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th, /* clear bit for the given block in bit map */ if (!reiserfs_test_and_clear_le_bit(offset, bmbh->b_data)) { - reiserfs_warning(s, "vs-4080: reiserfs_free_block: " - "free_block (%s:%lu)[dev:blocknr]: bit already cleared", - reiserfs_bdevname(s), block); + reiserfs_warning(s, "vs-4080", + "block %lu: bit already cleared", block); } apbi[nr].free_count++; journal_mark_dirty(th, s, bmbh); @@ -477,9 +472,8 @@ static void __discard_prealloc(struct reiserfs_transaction_handle *th, BUG_ON(!th->t_trans_id); #ifdef CONFIG_REISERFS_CHECK if (ei->i_prealloc_count < 0) - reiserfs_warning(th->t_super, - "zam-4001:%s: inode has negative prealloc blocks count.", - __func__); + reiserfs_warning(th->t_super, "zam-4001", + "inode has negative prealloc blocks count."); #endif while (ei->i_prealloc_count > 0) { reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block); @@ -515,9 +509,9 @@ void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th) i_prealloc_list); #ifdef CONFIG_REISERFS_CHECK if (!ei->i_prealloc_count) { - reiserfs_warning(th->t_super, - "zam-4001:%s: inode is in prealloc list but has no preallocated blocks.", - __func__); + reiserfs_warning(th->t_super, "zam-4001", + "inode is in prealloc list but has " + "no preallocated blocks."); } #endif __discard_prealloc(th, ei); @@ -631,8 +625,8 @@ int reiserfs_parse_alloc_options(struct super_block *s, char *options) continue; } - reiserfs_warning(s, "zam-4001: %s : unknown option - %s", - __func__, this_char); + reiserfs_warning(s, "zam-4001", "unknown option - %s", + this_char); return 1; } diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c index 99f80538c4bf..f701f37ddf98 100644 --- a/fs/reiserfs/do_balan.c +++ b/fs/reiserfs/do_balan.c @@ -1752,15 +1752,16 @@ static void store_thrown(struct tree_balance *tb, struct buffer_head *bh) int i; if (buffer_dirty(bh)) - reiserfs_warning(tb->tb_sb, - "store_thrown deals with dirty buffer"); + reiserfs_warning(tb->tb_sb, "reiserfs-12320", + "called with dirty buffer"); for (i = 0; i < ARRAY_SIZE(tb->thrown); i++) if (!tb->thrown[i]) { tb->thrown[i] = bh; get_bh(bh); /* free_thrown puts this */ return; } - reiserfs_warning(tb->tb_sb, "store_thrown: too many thrown buffers"); + reiserfs_warning(tb->tb_sb, "reiserfs-12321", + "too many thrown buffers"); } static void free_thrown(struct tree_balance *tb) @@ -1771,8 +1772,8 @@ static void free_thrown(struct tree_balance *tb) if (tb->thrown[i]) { blocknr = tb->thrown[i]->b_blocknr; if (buffer_dirty(tb->thrown[i])) - reiserfs_warning(tb->tb_sb, - "free_thrown deals with dirty buffer %d", + reiserfs_warning(tb->tb_sb, "reiserfs-12322", + "called with dirty buffer %d", blocknr); brelse(tb->thrown[i]); /* incremented in store_thrown */ reiserfs_free_block(tb->transaction_handle, NULL, @@ -1877,13 +1878,12 @@ static void check_internal_node(struct super_block *s, struct buffer_head *bh, } } -static int locked_or_not_in_tree(struct buffer_head *bh, char *which) +static int locked_or_not_in_tree(struct tree_balance *tb, + struct buffer_head *bh, char *which) { if ((!buffer_journal_prepared(bh) && buffer_locked(bh)) || !B_IS_IN_TREE(bh)) { - reiserfs_warning(NULL, - "vs-12339: locked_or_not_in_tree: %s (%b)", - which, bh); + reiserfs_warning(tb->tb_sb, "vs-12339", "%s (%b)", which, bh); return 1; } return 0; @@ -1902,18 +1902,19 @@ static int check_before_balancing(struct tree_balance *tb) /* double check that buffers that we will modify are unlocked. (fix_nodes should already have prepped all of these for us). */ if (tb->lnum[0]) { - retval |= locked_or_not_in_tree(tb->L[0], "L[0]"); - retval |= locked_or_not_in_tree(tb->FL[0], "FL[0]"); - retval |= locked_or_not_in_tree(tb->CFL[0], "CFL[0]"); + retval |= locked_or_not_in_tree(tb, tb->L[0], "L[0]"); + retval |= locked_or_not_in_tree(tb, tb->FL[0], "FL[0]"); + retval |= locked_or_not_in_tree(tb, tb->CFL[0], "CFL[0]"); check_leaf(tb->L[0]); } if (tb->rnum[0]) { - retval |= locked_or_not_in_tree(tb->R[0], "R[0]"); - retval |= locked_or_not_in_tree(tb->FR[0], "FR[0]"); - retval |= locked_or_not_in_tree(tb->CFR[0], "CFR[0]"); + retval |= locked_or_not_in_tree(tb, tb->R[0], "R[0]"); + retval |= locked_or_not_in_tree(tb, tb->FR[0], "FR[0]"); + retval |= locked_or_not_in_tree(tb, tb->CFR[0], "CFR[0]"); check_leaf(tb->R[0]); } - retval |= locked_or_not_in_tree(PATH_PLAST_BUFFER(tb->tb_path), "S[0]"); + retval |= locked_or_not_in_tree(tb, PATH_PLAST_BUFFER(tb->tb_path), + "S[0]"); check_leaf(PATH_PLAST_BUFFER(tb->tb_path)); return retval; @@ -1952,7 +1953,7 @@ static void check_after_balance_leaf(struct tree_balance *tb) PATH_H_POSITION(tb->tb_path, 1)))); print_cur_tb("12223"); - reiserfs_warning(tb->tb_sb, + reiserfs_warning(tb->tb_sb, "reiserfs-12363", "B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; " "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d", left, @@ -2104,9 +2105,8 @@ void do_balance(struct tree_balance *tb, /* tree_balance structure */ } /* if we have no real work to do */ if (!tb->insert_size[0]) { - reiserfs_warning(tb->tb_sb, - "PAP-12350: do_balance: insert_size == 0, mode == %c", - flag); + reiserfs_warning(tb->tb_sb, "PAP-12350", + "insert_size == 0, mode == %c", flag); unfix_nodes(tb); return; } diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 33408417038c..47bab8978be1 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c @@ -76,7 +76,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp) * and let the admin know what is going on. */ igrab(inode); - reiserfs_warning(inode->i_sb, + reiserfs_warning(inode->i_sb, "clm-9001", "pinning inode %lu because the " "preallocation can't be freed", inode->i_ino); diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c index 07d05e0842b7..59735a9e2349 100644 --- a/fs/reiserfs/fix_node.c +++ b/fs/reiserfs/fix_node.c @@ -496,8 +496,8 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h, snum012[needed_nodes - 1 + 3] = units; if (needed_nodes > 2) - reiserfs_warning(tb->tb_sb, "vs-8111: get_num_ver: " - "split_item_position is out of boundary"); + reiserfs_warning(tb->tb_sb, "vs-8111", + "split_item_position is out of range"); snum012[needed_nodes - 1]++; split_item_positions[needed_nodes - 1] = i; needed_nodes++; @@ -533,8 +533,8 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h, if (vn->vn_vi[split_item_num].vi_index != TYPE_DIRENTRY && vn->vn_vi[split_item_num].vi_index != TYPE_INDIRECT) - reiserfs_warning(tb->tb_sb, "vs-8115: get_num_ver: not " - "directory or indirect item"); + reiserfs_warning(tb->tb_sb, "vs-8115", + "not directory or indirect item"); } /* now we know S2bytes, calculate S1bytes */ @@ -2268,9 +2268,9 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *p_s_tb) #ifdef CONFIG_REISERFS_CHECK repeat_counter++; if ((repeat_counter % 10000) == 0) { - reiserfs_warning(p_s_tb->tb_sb, - "wait_tb_buffers_until_released(): too many " - "iterations waiting for buffer to unlock " + reiserfs_warning(p_s_tb->tb_sb, "reiserfs-8200", + "too many iterations waiting " + "for buffer to unlock " "(%b)", locked); /* Don't loop forever. Try to recover from possible error. */ diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 55fce92cdf18..95157762b1bf 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -842,7 +842,9 @@ int reiserfs_get_block(struct inode *inode, sector_t block, if (retval) { if (retval != -ENOSPC) reiserfs_warning(inode->i_sb, - "clm-6004: convert tail failed inode %lu, error %d", + "clm-6004", + "convert tail failed " + "inode %lu, error %d", inode->i_ino, retval); if (allocated_block_nr) { @@ -1006,8 +1008,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block, goto failure; } if (retval == POSITION_FOUND) { - reiserfs_warning(inode->i_sb, - "vs-825: reiserfs_get_block: " + reiserfs_warning(inode->i_sb, "vs-825", "%K should not be found", &key); retval = -EEXIST; if (allocated_block_nr) @@ -1332,9 +1333,9 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, /* look for the object's stat data */ retval = search_item(inode->i_sb, &key, &path); if (retval == IO_ERROR) { - reiserfs_warning(inode->i_sb, - "vs-13050: reiserfs_update_sd: " - "i/o failure occurred trying to update %K stat data", + reiserfs_warning(inode->i_sb, "vs-13050", + "i/o failure occurred trying to " + "update %K stat data", &key); return; } @@ -1345,9 +1346,9 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, /*reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found"); */ return; } - reiserfs_warning(inode->i_sb, - "vs-13060: reiserfs_update_sd: " - "stat data of object %k (nlink == %d) not found (pos %d)", + reiserfs_warning(inode->i_sb, "vs-13060", + "stat data of object %k (nlink == %d) " + "not found (pos %d)", INODE_PKEY(inode), inode->i_nlink, pos); reiserfs_check_path(&path); @@ -1424,10 +1425,9 @@ void reiserfs_read_locked_inode(struct inode *inode, /* look for the object's stat data */ retval = search_item(inode->i_sb, &key, &path_to_sd); if (retval == IO_ERROR) { - reiserfs_warning(inode->i_sb, - "vs-13070: reiserfs_read_locked_inode: " - "i/o failure occurred trying to find stat data of %K", - &key); + reiserfs_warning(inode->i_sb, "vs-13070", + "i/o failure occurred trying to find " + "stat data of %K", &key); reiserfs_make_bad_inode(inode); return; } @@ -1457,8 +1457,7 @@ void reiserfs_read_locked_inode(struct inode *inode, during mount (fs/reiserfs/super.c:finish_unfinished()). */ if ((inode->i_nlink == 0) && !REISERFS_SB(inode->i_sb)->s_is_unlinked_ok) { - reiserfs_warning(inode->i_sb, - "vs-13075: reiserfs_read_locked_inode: " + reiserfs_warning(inode->i_sb, "vs-13075", "dead inode read from disk %K. " "This is likely to be race with knfsd. Ignore", &key); @@ -1555,7 +1554,7 @@ struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid, */ if (fh_type > fh_len) { if (fh_type != 6 || fh_len != 5) - reiserfs_warning(sb, + reiserfs_warning(sb, "reiserfs-13077", "nfsd/reiserfs, fhtype=%d, len=%d - odd", fh_type, fh_len); fh_type = 5; @@ -1680,13 +1679,13 @@ static int reiserfs_new_directory(struct reiserfs_transaction_handle *th, /* look for place in the tree for new item */ retval = search_item(sb, &key, path); if (retval == IO_ERROR) { - reiserfs_warning(sb, "vs-13080: reiserfs_new_directory: " + reiserfs_warning(sb, "vs-13080", "i/o failure occurred creating new directory"); return -EIO; } if (retval == ITEM_FOUND) { pathrelse(path); - reiserfs_warning(sb, "vs-13070: reiserfs_new_directory: " + reiserfs_warning(sb, "vs-13070", "object with this key exists (%k)", &(ih->ih_key)); return -EEXIST; @@ -1720,13 +1719,13 @@ static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct i /* look for place in the tree for new item */ retval = search_item(sb, &key, path); if (retval == IO_ERROR) { - reiserfs_warning(sb, "vs-13080: reiserfs_new_symlinik: " + reiserfs_warning(sb, "vs-13080", "i/o failure occurred creating new symlink"); return -EIO; } if (retval == ITEM_FOUND) { pathrelse(path); - reiserfs_warning(sb, "vs-13080: reiserfs_new_symlink: " + reiserfs_warning(sb, "vs-13080", "object with this key exists (%k)", &(ih->ih_key)); return -EEXIST; @@ -1927,7 +1926,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, goto out_inserted_sd; } } else if (inode->i_sb->s_flags & MS_POSIXACL) { - reiserfs_warning(inode->i_sb, "ACLs aren't enabled in the fs, " + reiserfs_warning(inode->i_sb, "jdm-13090", + "ACLs aren't enabled in the fs, " "but vfs thinks they are!"); } else if (is_reiserfs_priv_object(dir)) { reiserfs_mark_inode_private(inode); @@ -2044,8 +2044,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 ** call prepare_write */ - reiserfs_warning(p_s_inode->i_sb, - "clm-6000: error reading block %lu on dev %s", + reiserfs_warning(p_s_inode->i_sb, "clm-6000", + "error reading block %lu on dev %s", bh->b_blocknr, reiserfs_bdevname(p_s_inode->i_sb)); error = -EIO; @@ -2089,8 +2089,8 @@ int reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) // and get_block_create_0 could not find a block to read in, // which is ok. if (error != -ENOENT) - reiserfs_warning(p_s_inode->i_sb, - "clm-6001: grab_tail_page failed %d", + reiserfs_warning(p_s_inode->i_sb, "clm-6001", + "grab_tail_page failed %d", error); page = NULL; bh = NULL; @@ -2208,9 +2208,8 @@ static int map_block_for_writepage(struct inode *inode, /* we've found an unformatted node */ if (indirect_item_found(retval, ih)) { if (bytes_copied > 0) { - reiserfs_warning(inode->i_sb, - "clm-6002: bytes_copied %d", - bytes_copied); + reiserfs_warning(inode->i_sb, "clm-6002", + "bytes_copied %d", bytes_copied); } if (!get_block_num(item, pos_in_item)) { /* crap, we are writing to a hole */ @@ -2267,9 +2266,8 @@ static int map_block_for_writepage(struct inode *inode, goto research; } } else { - reiserfs_warning(inode->i_sb, - "clm-6003: bad item inode %lu, device %s", - inode->i_ino, reiserfs_bdevname(inode->i_sb)); + reiserfs_warning(inode->i_sb, "clm-6003", + "bad item inode %lu", inode->i_ino); retval = -EIO; goto out; } diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c index 9475557ab499..8a11cf39f57b 100644 --- a/fs/reiserfs/item_ops.c +++ b/fs/reiserfs/item_ops.c @@ -97,7 +97,8 @@ static int sd_unit_num(struct virtual_item *vi) static void sd_print_vi(struct virtual_item *vi) { - reiserfs_warning(NULL, "STATDATA, index %d, type 0x%x, %h", + reiserfs_warning(NULL, "reiserfs-16100", + "STATDATA, index %d, type 0x%x, %h", vi->vi_index, vi->vi_type, vi->vi_ih); } @@ -190,7 +191,8 @@ static int direct_unit_num(struct virtual_item *vi) static void direct_print_vi(struct virtual_item *vi) { - reiserfs_warning(NULL, "DIRECT, index %d, type 0x%x, %h", + reiserfs_warning(NULL, "reiserfs-16101", + "DIRECT, index %d, type 0x%x, %h", vi->vi_index, vi->vi_type, vi->vi_ih); } @@ -278,7 +280,7 @@ static void indirect_print_item(struct item_head *ih, char *item) unp = (__le32 *) item; if (ih_item_len(ih) % UNFM_P_SIZE) - reiserfs_warning(NULL, "indirect_print_item: invalid item len"); + reiserfs_warning(NULL, "reiserfs-16102", "invalid item len"); printk("%d pointers\n[ ", (int)I_UNFM_NUM(ih)); for (j = 0; j < I_UNFM_NUM(ih); j++) { @@ -334,7 +336,8 @@ static int indirect_unit_num(struct virtual_item *vi) static void indirect_print_vi(struct virtual_item *vi) { - reiserfs_warning(NULL, "INDIRECT, index %d, type 0x%x, %h", + reiserfs_warning(NULL, "reiserfs-16103", + "INDIRECT, index %d, type 0x%x, %h", vi->vi_index, vi->vi_type, vi->vi_ih); } @@ -359,7 +362,7 @@ static struct item_operations indirect_ops = { static int direntry_bytes_number(struct item_head *ih, int block_size) { - reiserfs_warning(NULL, "vs-16090: direntry_bytes_number: " + reiserfs_warning(NULL, "vs-16090", "bytes number is asked for direntry"); return 0; } @@ -614,7 +617,8 @@ static void direntry_print_vi(struct virtual_item *vi) int i; struct direntry_uarea *dir_u = vi->vi_uarea; - reiserfs_warning(NULL, "DIRENTRY, index %d, type 0x%x, %h, flags 0x%x", + reiserfs_warning(NULL, "reiserfs-16104", + "DIRENTRY, index %d, type 0x%x, %h, flags 0x%x", vi->vi_index, vi->vi_type, vi->vi_ih, dir_u->flags); printk("%d entries: ", dir_u->entry_count); for (i = 0; i < dir_u->entry_count; i++) @@ -642,43 +646,43 @@ static struct item_operations direntry_ops = { // static int errcatch_bytes_number(struct item_head *ih, int block_size) { - reiserfs_warning(NULL, - "green-16001: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16001", + "Invalid item type observed, run fsck ASAP"); return 0; } static void errcatch_decrement_key(struct cpu_key *key) { - reiserfs_warning(NULL, - "green-16002: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16002", + "Invalid item type observed, run fsck ASAP"); } static int errcatch_is_left_mergeable(struct reiserfs_key *key, unsigned long bsize) { - reiserfs_warning(NULL, - "green-16003: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16003", + "Invalid item type observed, run fsck ASAP"); return 0; } static void errcatch_print_item(struct item_head *ih, char *item) { - reiserfs_warning(NULL, - "green-16004: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16004", + "Invalid item type observed, run fsck ASAP"); } static void errcatch_check_item(struct item_head *ih, char *item) { - reiserfs_warning(NULL, - "green-16005: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16005", + "Invalid item type observed, run fsck ASAP"); } static int errcatch_create_vi(struct virtual_node *vn, struct virtual_item *vi, int is_affected, int insert_size) { - reiserfs_warning(NULL, - "green-16006: Invalid item type observed, run fsck ASAP"); + 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 // this operation is called from is of return type void. } @@ -686,36 +690,36 @@ static int errcatch_create_vi(struct virtual_node *vn, static int errcatch_check_left(struct virtual_item *vi, int free, int start_skip, int end_skip) { - reiserfs_warning(NULL, - "green-16007: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16007", + "Invalid item type observed, run fsck ASAP"); return -1; } static int errcatch_check_right(struct virtual_item *vi, int free) { - reiserfs_warning(NULL, - "green-16008: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16008", + "Invalid item type observed, run fsck ASAP"); return -1; } static int errcatch_part_size(struct virtual_item *vi, int first, int count) { - reiserfs_warning(NULL, - "green-16009: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16009", + "Invalid item type observed, run fsck ASAP"); return 0; } static int errcatch_unit_num(struct virtual_item *vi) { - reiserfs_warning(NULL, - "green-16010: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16010", + "Invalid item type observed, run fsck ASAP"); return 0; } static void errcatch_print_vi(struct virtual_item *vi) { - reiserfs_warning(NULL, - "green-16011: Invalid item type observed, run fsck ASAP"); + reiserfs_warning(NULL, "green-16011", + "Invalid item type observed, run fsck ASAP"); } static struct item_operations errcatch_ops = { diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 677bb926e7d6..88a031fafd07 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -300,8 +300,8 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, jb->journal_list = NULL; jb->bitmaps = vmalloc(mem); if (!jb->bitmaps) { - reiserfs_warning(p_s_sb, - "clm-2000, unable to allocate bitmaps for journal lists"); + reiserfs_warning(p_s_sb, "clm-2000", "unable to " + "allocate bitmaps for journal lists"); failed = 1; break; } @@ -644,8 +644,8 @@ static void reiserfs_end_buffer_io_sync(struct buffer_head *bh, int uptodate) char b[BDEVNAME_SIZE]; if (buffer_journaled(bh)) { - reiserfs_warning(NULL, - "clm-2084: pinned buffer %lu:%s sent to disk", + reiserfs_warning(NULL, "clm-2084", + "pinned buffer %lu:%s sent to disk", bh->b_blocknr, bdevname(bh->b_bdev, b)); } if (uptodate) @@ -1122,7 +1122,8 @@ static int flush_commit_list(struct super_block *s, sync_dirty_buffer(tbh); if (unlikely(!buffer_uptodate(tbh))) { #ifdef CONFIG_REISERFS_CHECK - reiserfs_warning(s, "journal-601, buffer write failed"); + reiserfs_warning(s, "journal-601", + "buffer write failed"); #endif retval = -EIO; } @@ -1154,14 +1155,14 @@ static int flush_commit_list(struct super_block *s, * up propagating the write error out to the filesystem. */ if (unlikely(!buffer_uptodate(jl->j_commit_bh))) { #ifdef CONFIG_REISERFS_CHECK - reiserfs_warning(s, "journal-615: buffer write failed"); + reiserfs_warning(s, "journal-615", "buffer write failed"); #endif retval = -EIO; } bforget(jl->j_commit_bh); if (journal->j_last_commit_id != 0 && (jl->j_trans_id - journal->j_last_commit_id) != 1) { - reiserfs_warning(s, "clm-2200: last commit %lu, current %lu", + reiserfs_warning(s, "clm-2200", "last commit %lu, current %lu", journal->j_last_commit_id, jl->j_trans_id); } journal->j_last_commit_id = jl->j_trans_id; @@ -1250,7 +1251,7 @@ static void remove_all_from_journal_list(struct super_block *p_s_sb, while (cn) { if (cn->blocknr != 0) { if (debug) { - reiserfs_warning(p_s_sb, + reiserfs_warning(p_s_sb, "reiserfs-2201", "block %u, bh is %d, state %ld", cn->blocknr, cn->bh ? 1 : 0, cn->state); @@ -1288,8 +1289,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb, wait_on_buffer((journal->j_header_bh)); if (unlikely(!buffer_uptodate(journal->j_header_bh))) { #ifdef CONFIG_REISERFS_CHECK - reiserfs_warning(p_s_sb, - "journal-699: buffer write failed"); + reiserfs_warning(p_s_sb, "journal-699", + "buffer write failed"); #endif return -EIO; } @@ -1319,8 +1320,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb, sync_dirty_buffer(journal->j_header_bh); } if (!buffer_uptodate(journal->j_header_bh)) { - reiserfs_warning(p_s_sb, - "journal-837: IO error during journal replay"); + reiserfs_warning(p_s_sb, "journal-837", + "IO error during journal replay"); return -EIO; } } @@ -1401,8 +1402,7 @@ static int flush_journal_list(struct super_block *s, BUG_ON(j_len_saved <= 0); if (atomic_read(&journal->j_wcount) != 0) { - reiserfs_warning(s, - "clm-2048: flush_journal_list called with wcount %d", + reiserfs_warning(s, "clm-2048", "called with wcount %d", atomic_read(&journal->j_wcount)); } BUG_ON(jl->j_trans_id == 0); @@ -1510,8 +1510,8 @@ static int flush_journal_list(struct super_block *s, ** is not marked JDirty_wait */ if ((!was_jwait) && !buffer_locked(saved_bh)) { - reiserfs_warning(s, - "journal-813: BAD! buffer %llu %cdirty %cjwait, " + reiserfs_warning(s, "journal-813", + "BAD! buffer %llu %cdirty %cjwait, " "not in a newer tranasction", (unsigned long long)saved_bh-> b_blocknr, was_dirty ? ' ' : '!', @@ -1529,8 +1529,8 @@ static int flush_journal_list(struct super_block *s, unlock_buffer(saved_bh); count++; } else { - reiserfs_warning(s, - "clm-2082: Unable to flush buffer %llu in %s", + reiserfs_warning(s, "clm-2082", + "Unable to flush buffer %llu in %s", (unsigned long long)saved_bh-> b_blocknr, __func__); } @@ -1541,8 +1541,8 @@ static int flush_journal_list(struct super_block *s, /* we incremented this to keep others from taking the buffer head away */ put_bh(saved_bh); if (atomic_read(&(saved_bh->b_count)) < 0) { - reiserfs_warning(s, - "journal-945: saved_bh->b_count < 0"); + reiserfs_warning(s, "journal-945", + "saved_bh->b_count < 0"); } } } @@ -1561,8 +1561,8 @@ static int flush_journal_list(struct super_block *s, } if (unlikely(!buffer_uptodate(cn->bh))) { #ifdef CONFIG_REISERFS_CHECK - reiserfs_warning(s, - "journal-949: buffer write failed\n"); + reiserfs_warning(s, "journal-949", + "buffer write failed"); #endif err = -EIO; } @@ -1623,7 +1623,7 @@ static int flush_journal_list(struct super_block *s, if (journal->j_last_flush_id != 0 && (jl->j_trans_id - journal->j_last_flush_id) != 1) { - reiserfs_warning(s, "clm-2201: last flush %lu, current %lu", + reiserfs_warning(s, "clm-2201", "last flush %lu, current %lu", journal->j_last_flush_id, jl->j_trans_id); } journal->j_last_flush_id = jl->j_trans_id; @@ -2058,8 +2058,9 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, return -1; } if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) { - reiserfs_warning(p_s_sb, - "journal-2018: Bad transaction length %d encountered, ignoring transaction", + reiserfs_warning(p_s_sb, "journal-2018", + "Bad transaction length %d " + "encountered, ignoring transaction", get_desc_trans_len(desc)); return -1; } @@ -2195,8 +2196,8 @@ static int journal_read_transaction(struct super_block *p_s_sb, brelse(d_bh); kfree(log_blocks); kfree(real_blocks); - reiserfs_warning(p_s_sb, - "journal-1169: kmalloc failed, unable to mount FS"); + reiserfs_warning(p_s_sb, "journal-1169", + "kmalloc failed, unable to mount FS"); return -1; } /* get all the buffer heads */ @@ -2218,15 +2219,18 @@ static int journal_read_transaction(struct super_block *p_s_sb, j_realblock[i - trans_half])); } if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { - reiserfs_warning(p_s_sb, - "journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem"); + reiserfs_warning(p_s_sb, "journal-1207", + "REPLAY FAILURE fsck required! " + "Block to replay is outside of " + "filesystem"); goto abort_replay; } /* make sure we don't try to replay onto log or reserved area */ if (is_block_in_log_or_reserved_area (p_s_sb, real_blocks[i]->b_blocknr)) { - reiserfs_warning(p_s_sb, - "journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block"); + reiserfs_warning(p_s_sb, "journal-1204", + "REPLAY FAILURE fsck required! " + "Trying to replay onto a log block"); abort_replay: brelse_array(log_blocks, i); brelse_array(real_blocks, i); @@ -2242,8 +2246,9 @@ static int journal_read_transaction(struct super_block *p_s_sb, for (i = 0; i < get_desc_trans_len(desc); i++) { wait_on_buffer(log_blocks[i]); if (!buffer_uptodate(log_blocks[i])) { - reiserfs_warning(p_s_sb, - "journal-1212: REPLAY FAILURE fsck required! buffer write failed"); + reiserfs_warning(p_s_sb, "journal-1212", + "REPLAY FAILURE fsck required! " + "buffer write failed"); brelse_array(log_blocks + i, get_desc_trans_len(desc) - i); brelse_array(real_blocks, get_desc_trans_len(desc)); @@ -2266,8 +2271,9 @@ static int journal_read_transaction(struct super_block *p_s_sb, for (i = 0; i < get_desc_trans_len(desc); i++) { wait_on_buffer(real_blocks[i]); if (!buffer_uptodate(real_blocks[i])) { - reiserfs_warning(p_s_sb, - "journal-1226: REPLAY FAILURE, fsck required! buffer write failed"); + reiserfs_warning(p_s_sb, "journal-1226", + "REPLAY FAILURE, fsck required! " + "buffer write failed"); brelse_array(real_blocks + i, get_desc_trans_len(desc) - i); brelse(c_bh); @@ -2418,8 +2424,8 @@ static int journal_read(struct super_block *p_s_sb) } if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) { - reiserfs_warning(p_s_sb, - "clm-2076: device is readonly, unable to replay log"); + reiserfs_warning(p_s_sb, "clm-2076", + "device is readonly, unable to replay log"); return -1; } @@ -2580,9 +2586,8 @@ static int release_journal_dev(struct super_block *super, } if (result != 0) { - reiserfs_warning(super, - "sh-457: release_journal_dev: Cannot release journal device: %i", - result); + reiserfs_warning(super, "sh-457", + "Cannot release journal device: %i", result); } return result; } @@ -2612,7 +2617,7 @@ static int journal_init_dev(struct super_block *super, if (IS_ERR(journal->j_dev_bd)) { result = PTR_ERR(journal->j_dev_bd); journal->j_dev_bd = NULL; - reiserfs_warning(super, "sh-458: journal_init_dev: " + reiserfs_warning(super, "sh-458", "cannot init journal device '%s': %i", __bdevname(jdev, b), result); return result; @@ -2676,16 +2681,16 @@ static int check_advise_trans_params(struct super_block *p_s_sb, journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio || SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max < JOURNAL_MIN_RATIO) { - reiserfs_warning(p_s_sb, - "sh-462: bad transaction max size (%u). FSCK?", - journal->j_trans_max); + reiserfs_warning(p_s_sb, "sh-462", + "bad transaction max size (%u). " + "FSCK?", journal->j_trans_max); return 1; } if (journal->j_max_batch != (journal->j_trans_max) * JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) { - reiserfs_warning(p_s_sb, - "sh-463: bad transaction max batch (%u). FSCK?", - journal->j_max_batch); + reiserfs_warning(p_s_sb, "sh-463", + "bad transaction max batch (%u). " + "FSCK?", journal->j_max_batch); return 1; } } else { @@ -2693,9 +2698,11 @@ static int check_advise_trans_params(struct super_block *p_s_sb, The file system was created by old version of mkreiserfs, so some fields contain zeros, and we need to advise proper values for them */ - if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) - reiserfs_panic(p_s_sb, "sh-464: bad blocksize (%u)", - p_s_sb->s_blocksize); + if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) { + reiserfs_warning(p_s_sb, "sh-464", "bad blocksize (%u)", + p_s_sb->s_blocksize); + return 1; + } journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT; journal->j_max_batch = JOURNAL_MAX_BATCH_DEFAULT; journal->j_max_commit_age = JOURNAL_MAX_COMMIT_AGE; @@ -2719,8 +2726,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal)); if (!journal) { - reiserfs_warning(p_s_sb, - "journal-1256: unable to get memory for journal structure"); + reiserfs_warning(p_s_sb, "journal-1256", + "unable to get memory for journal structure"); return 1; } memset(journal, 0, sizeof(struct reiserfs_journal)); @@ -2749,9 +2756,9 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) && (SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) { - reiserfs_warning(p_s_sb, - "journal-1393: journal does not fit for area " - "addressed by first of bitmap blocks. It starts at " + reiserfs_warning(p_s_sb, "journal-1393", + "journal does not fit for area addressed " + "by first of bitmap blocks. It starts at " "%u and its size is %u. Block size %ld", SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb), SB_ONDISK_JOURNAL_SIZE(p_s_sb), @@ -2760,8 +2767,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, } if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) { - reiserfs_warning(p_s_sb, - "sh-462: unable to initialize jornal device"); + reiserfs_warning(p_s_sb, "sh-462", + "unable to initialize jornal device"); goto free_and_return; } @@ -2772,8 +2779,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_SIZE(p_s_sb)); if (!bhjh) { - reiserfs_warning(p_s_sb, - "sh-459: unable to read journal header"); + reiserfs_warning(p_s_sb, "sh-459", + "unable to read journal header"); goto free_and_return; } jh = (struct reiserfs_journal_header *)(bhjh->b_data); @@ -2782,10 +2789,10 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, if (is_reiserfs_jr(rs) && (le32_to_cpu(jh->jh_journal.jp_journal_magic) != sb_jp_journal_magic(rs))) { - reiserfs_warning(p_s_sb, - "sh-460: journal header magic %x " - "(device %s) does not match to magic found in super " - "block %x", jh->jh_journal.jp_journal_magic, + reiserfs_warning(p_s_sb, "sh-460", + "journal header magic %x (device %s) does " + "not match to magic found in super block %x", + jh->jh_journal.jp_journal_magic, bdevname(journal->j_dev_bd, b), sb_jp_journal_magic(rs)); brelse(bhjh); @@ -2852,7 +2859,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, journal->j_must_wait = 0; if (journal->j_cnode_free == 0) { - reiserfs_warning(p_s_sb, "journal-2004: Journal cnode memory " + reiserfs_warning(p_s_sb, "journal-2004", "Journal cnode memory " "allocation failed (%ld bytes). Journal is " "too large for available memory. Usually " "this is due to a journal that is too large.", @@ -2864,12 +2871,13 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, jl = journal->j_current_jl; jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl); if (!jl->j_list_bitmap) { - reiserfs_warning(p_s_sb, - "journal-2005, get_list_bitmap failed for journal list 0"); + reiserfs_warning(p_s_sb, "journal-2005", + "get_list_bitmap failed for journal list 0"); goto free_and_return; } if (journal_read(p_s_sb) < 0) { - reiserfs_warning(p_s_sb, "Replay Failure, unable to mount"); + reiserfs_warning(p_s_sb, "reiserfs-2006", + "Replay Failure, unable to mount"); goto free_and_return; } @@ -3196,16 +3204,17 @@ int journal_begin(struct reiserfs_transaction_handle *th, cur_th->t_refcount++; memcpy(th, cur_th, sizeof(*th)); if (th->t_refcount <= 1) - reiserfs_warning(p_s_sb, - "BAD: refcount <= 1, but journal_info != 0"); + reiserfs_warning(p_s_sb, "reiserfs-2005", + "BAD: refcount <= 1, but " + "journal_info != 0"); return 0; } else { /* we've ended up with a handle from a different filesystem. ** save it and restore on journal_end. This should never ** really happen... */ - reiserfs_warning(p_s_sb, - "clm-2100: nesting info a different FS"); + reiserfs_warning(p_s_sb, "clm-2100", + "nesting info a different FS"); th->t_handle_save = current->journal_info; current->journal_info = th; } @@ -3266,7 +3275,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ** could get to disk too early. NOT GOOD. */ if (!prepared || buffer_dirty(bh)) { - reiserfs_warning(p_s_sb, "journal-1777: buffer %llu bad state " + reiserfs_warning(p_s_sb, "journal-1777", + "buffer %llu bad state " "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT", (unsigned long long)bh->b_blocknr, prepared ? ' ' : '!', @@ -3276,8 +3286,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, } if (atomic_read(&(journal->j_wcount)) <= 0) { - reiserfs_warning(p_s_sb, - "journal-1409: journal_mark_dirty returning because j_wcount was %d", + reiserfs_warning(p_s_sb, "journal-1409", + "returning because j_wcount was %d", atomic_read(&(journal->j_wcount))); return 1; } @@ -3342,8 +3352,8 @@ int journal_end(struct reiserfs_transaction_handle *th, struct super_block *p_s_sb, unsigned long nblocks) { if (!current->journal_info && th->t_refcount > 1) - reiserfs_warning(p_s_sb, "REISER-NESTING: th NULL, refcount %d", - th->t_refcount); + reiserfs_warning(p_s_sb, "REISER-NESTING", + "th NULL, refcount %d", th->t_refcount); if (!th->t_trans_id) { WARN_ON(1); @@ -3413,8 +3423,8 @@ static int remove_from_transaction(struct super_block *p_s_sb, clear_buffer_journal_test(bh); put_bh(bh); if (atomic_read(&(bh->b_count)) < 0) { - reiserfs_warning(p_s_sb, - "journal-1752: remove from trans, b_count < 0"); + reiserfs_warning(p_s_sb, "journal-1752", + "b_count < 0"); } ret = 1; } @@ -3734,7 +3744,8 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, if (atomic_read (&(cn->bh->b_count)) < 0) { reiserfs_warning(p_s_sb, - "journal-2138: cn->bh->b_count < 0"); + "journal-2138", + "cn->bh->b_count < 0"); } } if (cn->jlist) { /* since we are clearing the bh, we MUST dec nonzerolen */ @@ -4137,8 +4148,9 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, clear_buffer_journaled(cn->bh); } else { /* JDirty cleared sometime during transaction. don't log this one */ - reiserfs_warning(p_s_sb, - "journal-2048: do_journal_end: BAD, buffer in journal hash, but not JDirty!"); + reiserfs_warning(p_s_sb, "journal-2048", + "BAD, buffer in journal hash, " + "but not JDirty!"); brelse(cn->bh); } next = cn->next; diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c index 41bdd8c75887..381339b432e7 100644 --- a/fs/reiserfs/lbalance.c +++ b/fs/reiserfs/lbalance.c @@ -1288,12 +1288,16 @@ void leaf_paste_entries(struct buffer_info *bi, prev = (i != 0) ? deh_location(&(deh[i - 1])) : 0; if (prev && prev <= deh_location(&(deh[i]))) - reiserfs_warning(NULL, - "vs-10240: leaf_paste_entries: directory item (%h) corrupted (prev %a, cur(%d) %a)", + reiserfs_warning(NULL, "vs-10240", + "directory item (%h) " + "corrupted (prev %a, " + "cur(%d) %a)", ih, deh + i - 1, i, deh + i); if (next && next >= deh_location(&(deh[i]))) - reiserfs_warning(NULL, - "vs-10250: leaf_paste_entries: directory item (%h) corrupted (cur(%d) %a, next %a)", + reiserfs_warning(NULL, "vs-10250", + "directory item (%h) " + "corrupted (cur(%d) %a, " + "next %a)", ih, i, deh + i, deh + i + 1); } } diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 738967f6c8ee..bb41c6e7c79b 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -120,8 +120,8 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, switch (retval) { case ITEM_NOT_FOUND: if (!PATH_LAST_POSITION(path)) { - reiserfs_warning(sb, - "vs-7000: search_by_entry_key: search_by_key returned item position == 0"); + reiserfs_warning(sb, "vs-7000", "search_by_key " + "returned item position == 0"); pathrelse(path); return IO_ERROR; } @@ -135,8 +135,7 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, default: pathrelse(path); - reiserfs_warning(sb, - "vs-7002: search_by_entry_key: no path to here"); + reiserfs_warning(sb, "vs-7002", "no path to here"); return IO_ERROR; } @@ -300,8 +299,7 @@ static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen, search_by_entry_key(dir->i_sb, &key_to_search, path_to_entry, de); if (retval == IO_ERROR) { - reiserfs_warning(dir->i_sb, "zam-7001: io error in %s", - __func__); + reiserfs_warning(dir->i_sb, "zam-7001", "io error"); return IO_ERROR; } @@ -484,10 +482,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, } if (retval != NAME_FOUND) { - reiserfs_warning(dir->i_sb, - "zam-7002:%s: \"reiserfs_find_entry\" " - "has returned unexpected value (%d)", - __func__, retval); + reiserfs_warning(dir->i_sb, "zam-7002", + "reiserfs_find_entry() returned " + "unexpected value (%d)", retval); } return -EEXIST; @@ -498,8 +495,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, MAX_GENERATION_NUMBER + 1); if (gen_number > MAX_GENERATION_NUMBER) { /* there is no free generation number */ - reiserfs_warning(dir->i_sb, - "reiserfs_add_entry: Congratulations! we have got hash function screwed up"); + reiserfs_warning(dir->i_sb, "reiserfs-7010", + "Congratulations! we have got hash function " + "screwed up"); if (buffer != small_buf) kfree(buffer); pathrelse(&path); @@ -515,10 +513,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, 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) { - reiserfs_warning(dir->i_sb, - "vs-7032: reiserfs_add_entry: " - "entry with this key (%K) already exists", - &entry_key); + reiserfs_warning(dir->i_sb, "vs-7032", + "entry with this key (%K) already " + "exists", &entry_key); if (buffer != small_buf) kfree(buffer); @@ -903,8 +900,9 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) goto end_rmdir; if (inode->i_nlink != 2 && inode->i_nlink != 1) - reiserfs_warning(inode->i_sb, "%s: empty directory has nlink " - "!= 2 (%d)", __func__, inode->i_nlink); + reiserfs_warning(inode->i_sb, "reiserfs-7040", + "empty directory has nlink != 2 (%d)", + inode->i_nlink); clear_nlink(inode); inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; @@ -980,10 +978,9 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry) } if (!inode->i_nlink) { - reiserfs_warning(inode->i_sb, "%s: deleting nonexistent file " - "(%s:%lu), %d", __func__, - reiserfs_bdevname(inode->i_sb), inode->i_ino, - inode->i_nlink); + reiserfs_warning(inode->i_sb, "reiserfs-7042", + "deleting nonexistent file (%lu), %d", + inode->i_ino, inode->i_nlink); inode->i_nlink = 1; } @@ -1499,8 +1496,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, if (reiserfs_cut_from_item (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL, 0) < 0) - reiserfs_warning(old_dir->i_sb, - "vs-7060: reiserfs_rename: couldn't not cut old name. Fsck later?"); + reiserfs_warning(old_dir->i_sb, "vs-7060", + "couldn't not cut old name. Fsck later?"); old_dir->i_size -= DEH_SIZE + old_de.de_entrylen; diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c index ea0cf8c28a99..a3a5f43ff443 100644 --- a/fs/reiserfs/objectid.c +++ b/fs/reiserfs/objectid.c @@ -61,7 +61,7 @@ __u32 reiserfs_get_unused_objectid(struct reiserfs_transaction_handle *th) /* comment needed -Hans */ unused_objectid = le32_to_cpu(map[1]); if (unused_objectid == U32_MAX) { - reiserfs_warning(s, "%s: no more object ids", __func__); + reiserfs_warning(s, "reiserfs-15100", "no more object ids"); reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s)); return 0; } @@ -160,8 +160,7 @@ void reiserfs_release_objectid(struct reiserfs_transaction_handle *th, i += 2; } - reiserfs_warning(s, - "vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)", + reiserfs_warning(s, "vs-15011", "tried to free free object id (%lu)", (long unsigned)objectid_to_release); } diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c index 535a3c7fc68e..50ed4bd3ef63 100644 --- a/fs/reiserfs/prints.c +++ b/fs/reiserfs/prints.c @@ -264,14 +264,17 @@ static void prepare_error_buf(const char *fmt, va_list args) va_end( args );\ } -void reiserfs_warning(struct super_block *sb, const char *fmt, ...) +void __reiserfs_warning(struct super_block *sb, const char *id, + const char *function, const char *fmt, ...) { do_reiserfs_warning(fmt); if (sb) - printk(KERN_WARNING "REISERFS warning (device %s): %s\n", - sb->s_id, error_buf); + printk(KERN_WARNING "REISERFS warning (device %s): %s%s%s: " + "%s\n", sb->s_id, id ? id : "", id ? " " : "", + function, error_buf); else - printk(KERN_WARNING "REISERFS warning: %s\n", error_buf); + printk(KERN_WARNING "REISERFS warning: %s%s%s: %s\n", + id ? id : "", id ? " " : "", function, error_buf); } /* No newline.. reiserfs_info calls can be followed by printk's */ diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index 370988efc8ad..d4d7f1433ed0 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c @@ -503,7 +503,7 @@ int reiserfs_proc_info_init(struct super_block *sb) add_file(sb, "journal", show_journal); return 0; } - reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", + reiserfs_warning(sb, "cannot create /proc/%s/%s", proc_info_root_name, b); return 1; } @@ -559,8 +559,7 @@ int reiserfs_proc_info_global_init(void) if (proc_info_root) { proc_info_root->owner = THIS_MODULE; } else { - reiserfs_warning(NULL, - "reiserfs: cannot create /proc/%s", + reiserfs_warning(NULL, "cannot create /proc/%s", proc_info_root_name); return 1; } diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index abbc64dcc8d4..f328d27a19d5 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -444,23 +444,24 @@ static int is_leaf(char *buf, int blocksize, struct buffer_head *bh) blkh = (struct block_head *)buf; if (blkh_level(blkh) != DISK_LEAF_NODE_LEVEL) { - reiserfs_warning(NULL, - "is_leaf: this should be caught earlier"); + reiserfs_warning(NULL, "reiserfs-5080", + "this should be caught earlier"); return 0; } nr = blkh_nr_item(blkh); if (nr < 1 || nr > ((blocksize - BLKH_SIZE) / (IH_SIZE + MIN_ITEM_LEN))) { /* item number is too big or too small */ - reiserfs_warning(NULL, "is_leaf: nr_item seems wrong: %z", bh); + reiserfs_warning(NULL, "reiserfs-5081", + "nr_item seems wrong: %z", bh); return 0; } ih = (struct item_head *)(buf + BLKH_SIZE) + nr - 1; used_space = BLKH_SIZE + IH_SIZE * nr + (blocksize - ih_location(ih)); if (used_space != blocksize - blkh_free_space(blkh)) { /* free space does not match to calculated amount of use space */ - reiserfs_warning(NULL, "is_leaf: free space seems wrong: %z", - bh); + reiserfs_warning(NULL, "reiserfs-5082", + "free space seems wrong: %z", bh); return 0; } // FIXME: it is_leaf will hit performance too much - we may have @@ -471,29 +472,29 @@ static int is_leaf(char *buf, int blocksize, struct buffer_head *bh) prev_location = blocksize; for (i = 0; i < nr; i++, ih++) { if (le_ih_k_type(ih) == TYPE_ANY) { - reiserfs_warning(NULL, - "is_leaf: wrong item type for item %h", + reiserfs_warning(NULL, "reiserfs-5083", + "wrong item type for item %h", ih); return 0; } if (ih_location(ih) >= blocksize || ih_location(ih) < IH_SIZE * nr) { - reiserfs_warning(NULL, - "is_leaf: item location seems wrong: %h", + reiserfs_warning(NULL, "reiserfs-5084", + "item location seems wrong: %h", ih); return 0; } if (ih_item_len(ih) < 1 || ih_item_len(ih) > MAX_ITEM_LEN(blocksize)) { - reiserfs_warning(NULL, - "is_leaf: item length seems wrong: %h", + reiserfs_warning(NULL, "reiserfs-5085", + "item length seems wrong: %h", ih); return 0; } if (prev_location - ih_location(ih) != ih_item_len(ih)) { - reiserfs_warning(NULL, - "is_leaf: item location seems wrong (second one): %h", - ih); + reiserfs_warning(NULL, "reiserfs-5086", + "item location seems wrong " + "(second one): %h", ih); return 0; } prev_location = ih_location(ih); @@ -514,24 +515,23 @@ static int is_internal(char *buf, int blocksize, struct buffer_head *bh) nr = blkh_level(blkh); if (nr <= DISK_LEAF_NODE_LEVEL || nr > MAX_HEIGHT) { /* this level is not possible for internal nodes */ - reiserfs_warning(NULL, - "is_internal: this should be caught earlier"); + reiserfs_warning(NULL, "reiserfs-5087", + "this should be caught earlier"); return 0; } nr = blkh_nr_item(blkh); if (nr > (blocksize - BLKH_SIZE - DC_SIZE) / (KEY_SIZE + DC_SIZE)) { /* for internal which is not root we might check min number of keys */ - reiserfs_warning(NULL, - "is_internal: number of key seems wrong: %z", - bh); + reiserfs_warning(NULL, "reiserfs-5088", + "number of key seems wrong: %z", bh); return 0; } used_space = BLKH_SIZE + KEY_SIZE * nr + DC_SIZE * (nr + 1); if (used_space != blocksize - blkh_free_space(blkh)) { - reiserfs_warning(NULL, - "is_internal: free space seems wrong: %z", bh); + reiserfs_warning(NULL, "reiserfs-5089", + "free space seems wrong: %z", bh); return 0; } // one may imagine much more checks @@ -543,8 +543,8 @@ static int is_internal(char *buf, int blocksize, struct buffer_head *bh) static int is_tree_node(struct buffer_head *bh, int level) { if (B_LEVEL(bh) != level) { - reiserfs_warning(NULL, - "is_tree_node: node level %d does not match to the expected one %d", + reiserfs_warning(NULL, "reiserfs-5090", "node level %d does " + "not match to the expected one %d", B_LEVEL(bh), level); return 0; } @@ -645,9 +645,9 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* #ifdef CONFIG_REISERFS_CHECK if (!(++n_repeat_counter % 50000)) - reiserfs_warning(p_s_sb, "PAP-5100: search_by_key: %s:" - "there were %d iterations of while loop " - "looking for key %K", + reiserfs_warning(p_s_sb, "PAP-5100", + "%s: there were %d iterations of " + "while loop looking for key %K", current->comm, n_repeat_counter, p_s_key); #endif @@ -721,9 +721,9 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* // make sure, that the node contents look like a node of // certain level if (!is_tree_node(p_s_bh, expected_level)) { - reiserfs_warning(p_s_sb, "vs-5150: search_by_key: " - "invalid format found in block %ld. Fsck?", - p_s_bh->b_blocknr); + reiserfs_warning(p_s_sb, "vs-5150", + "invalid format found in block %ld. " + "Fsck?", p_s_bh->b_blocknr); pathrelse(p_s_search_path); return IO_ERROR; } @@ -1227,8 +1227,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath if (n_ret_value == IO_ERROR) break; if (n_ret_value == FILE_NOT_FOUND) { - reiserfs_warning(p_s_sb, - "vs-5340: reiserfs_delete_item: " + reiserfs_warning(p_s_sb, "vs-5340", "no items of the file %K found", p_s_item_key); break; @@ -1338,10 +1337,9 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, while (1) { retval = search_item(th->t_super, &cpu_key, &path); if (retval == IO_ERROR) { - reiserfs_warning(th->t_super, - "vs-5350: reiserfs_delete_solid_item: " - "i/o failure occurred trying to delete %K", - &cpu_key); + reiserfs_warning(th->t_super, "vs-5350", + "i/o failure occurred trying " + "to delete %K", &cpu_key); break; } if (retval != ITEM_FOUND) { @@ -1355,9 +1353,8 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, GET_GENERATION_NUMBER(le_key_k_offset (le_key_version(key), key)) == 1)) - reiserfs_warning(th->t_super, - "vs-5355: reiserfs_delete_solid_item: %k not found", - key); + reiserfs_warning(th->t_super, "vs-5355", + "%k not found", key); break; } if (!tb_init) { @@ -1389,8 +1386,7 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, break; } // IO_ERROR, NO_DISK_SPACE, etc - reiserfs_warning(th->t_super, - "vs-5360: reiserfs_delete_solid_item: " + reiserfs_warning(th->t_super, "vs-5360", "could not delete %K due to fix_nodes failure", &cpu_key); unfix_nodes(&tb); @@ -1533,8 +1529,9 @@ static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th, set_cpu_key_k_offset(&tail_key, cpu_key_k_offset(&tail_key) - removed); } - reiserfs_warning(inode->i_sb, - "indirect_to_direct_roll_back: indirect_to_direct conversion has been rolled back due to lack of disk space"); + reiserfs_warning(inode->i_sb, "reiserfs-5091", "indirect_to_direct " + "conversion has been rolled back due to " + "lack of disk space"); //mark_file_without_tail (inode); mark_inode_dirty(inode); } @@ -1639,8 +1636,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, if (n_ret_value == POSITION_FOUND) continue; - reiserfs_warning(p_s_sb, - "PAP-5610: reiserfs_cut_from_item: item %K not found", + reiserfs_warning(p_s_sb, "PAP-5610", "item %K not found", p_s_item_key); unfix_nodes(&s_cut_balance); return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT; @@ -1654,7 +1650,8 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, indirect_to_direct_roll_back(th, p_s_inode, p_s_path); } if (n_ret_value == NO_DISK_SPACE) - reiserfs_warning(p_s_sb, "NO_DISK_SPACE"); + reiserfs_warning(p_s_sb, "reiserfs-5092", + "NO_DISK_SPACE"); unfix_nodes(&s_cut_balance); return -EIO; } @@ -1743,8 +1740,7 @@ static void truncate_directory(struct reiserfs_transaction_handle *th, { BUG_ON(!th->t_trans_id); if (inode->i_nlink) - reiserfs_warning(inode->i_sb, - "vs-5655: truncate_directory: link count != 0"); + reiserfs_warning(inode->i_sb, "vs-5655", "link count != 0"); set_le_key_k_offset(KEY_FORMAT_3_5, INODE_PKEY(inode), DOT_OFFSET); set_le_key_k_type(KEY_FORMAT_3_5, INODE_PKEY(inode), TYPE_DIRENTRY); @@ -1797,16 +1793,14 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p search_for_position_by_key(p_s_inode->i_sb, &s_item_key, &s_search_path); if (retval == IO_ERROR) { - reiserfs_warning(p_s_inode->i_sb, - "vs-5657: reiserfs_do_truncate: " + reiserfs_warning(p_s_inode->i_sb, "vs-5657", "i/o failure occurred trying to truncate %K", &s_item_key); err = -EIO; goto out; } if (retval == POSITION_FOUND || retval == FILE_NOT_FOUND) { - reiserfs_warning(p_s_inode->i_sb, - "PAP-5660: reiserfs_do_truncate: " + reiserfs_warning(p_s_inode->i_sb, "PAP-5660", "wrong result %d of search for %K", retval, &s_item_key); @@ -1850,8 +1844,8 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p reiserfs_cut_from_item(th, &s_search_path, &s_item_key, p_s_inode, page, n_new_file_size); if (n_deleted < 0) { - reiserfs_warning(p_s_inode->i_sb, - "vs-5665: reiserfs_do_truncate: reiserfs_cut_from_item failed"); + reiserfs_warning(p_s_inode->i_sb, "vs-5665", + "reiserfs_cut_from_item failed"); reiserfs_check_path(&s_search_path); return 0; } @@ -2000,8 +1994,8 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree goto error_out; } if (retval == POSITION_FOUND) { - reiserfs_warning(inode->i_sb, - "PAP-5710: reiserfs_paste_into_item: entry or pasted byte (%K) exists", + reiserfs_warning(inode->i_sb, "PAP-5710", + "entry or pasted byte (%K) exists", p_s_key); retval = -EEXIST; goto error_out; @@ -2087,8 +2081,7 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct treepath goto error_out; } if (retval == ITEM_FOUND) { - reiserfs_warning(th->t_super, - "PAP-5760: reiserfs_insert_item: " + reiserfs_warning(th->t_super, "PAP-5760", "key %K already exists in the tree", key); retval = -EEXIST; diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 0428004dc638..bfc276c8e978 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -183,9 +183,9 @@ static int finish_unfinished(struct super_block *s) if (REISERFS_SB(s)->s_qf_names[i]) { int ret = reiserfs_quota_on_mount(s, i); if (ret < 0) - reiserfs_warning(s, - "reiserfs: cannot turn on journaled quota: error %d", - ret); + reiserfs_warning(s, "reiserfs-2500", + "cannot turn on journaled " + "quota: error %d", ret); } } #endif @@ -195,8 +195,8 @@ static int finish_unfinished(struct super_block *s) while (!retval) { retval = search_item(s, &max_cpu_key, &path); if (retval != ITEM_NOT_FOUND) { - reiserfs_warning(s, - "vs-2140: finish_unfinished: search_by_key returned %d", + reiserfs_warning(s, "vs-2140", + "search_by_key returned %d", retval); break; } @@ -204,8 +204,8 @@ static int finish_unfinished(struct super_block *s) bh = get_last_bh(&path); item_pos = get_item_pos(&path); if (item_pos != B_NR_ITEMS(bh)) { - reiserfs_warning(s, - "vs-2060: finish_unfinished: wrong position found"); + reiserfs_warning(s, "vs-2060", + "wrong position found"); break; } item_pos--; @@ -235,8 +235,7 @@ static int finish_unfinished(struct super_block *s) if (!inode) { /* the unlink almost completed, it just did not manage to remove "save" link and release objectid */ - reiserfs_warning(s, - "vs-2180: finish_unfinished: iget failed for %K", + reiserfs_warning(s, "vs-2180", "iget failed for %K", &obj_key); retval = remove_save_link_only(s, &save_link_key, 1); continue; @@ -244,8 +243,8 @@ static int finish_unfinished(struct super_block *s) if (!truncate && inode->i_nlink) { /* file is not unlinked */ - reiserfs_warning(s, - "vs-2185: finish_unfinished: file %K is not unlinked", + reiserfs_warning(s, "vs-2185", + "file %K is not unlinked", &obj_key); retval = remove_save_link_only(s, &save_link_key, 0); continue; @@ -257,8 +256,9 @@ static int finish_unfinished(struct super_block *s) The only imaginable way is to execute unfinished truncate request then boot into old kernel, remove the file and create dir with the same key. */ - reiserfs_warning(s, - "green-2101: impossible truncate on a directory %k. Please report", + reiserfs_warning(s, "green-2101", + "impossible truncate on a " + "directory %k. Please report", INODE_PKEY(inode)); retval = remove_save_link_only(s, &save_link_key, 0); truncate = 0; @@ -288,9 +288,10 @@ static int finish_unfinished(struct super_block *s) /* removal gets completed in iput */ retval = 0; } else { - reiserfs_warning(s, "Dead loop in " - "finish_unfinished detected, " - "just remove save link\n"); + reiserfs_warning(s, "super-2189", "Dead loop " + "in finish_unfinished " + "detected, just remove " + "save link\n"); retval = remove_save_link_only(s, &save_link_key, 0); } @@ -360,8 +361,9 @@ void add_save_link(struct reiserfs_transaction_handle *th, } else { /* truncate */ if (S_ISDIR(inode->i_mode)) - reiserfs_warning(inode->i_sb, - "green-2102: Adding a truncate savelink for a directory %k! Please report", + reiserfs_warning(inode->i_sb, "green-2102", + "Adding a truncate savelink for " + "a directory %k! Please report", INODE_PKEY(inode)); set_cpu_key_k_offset(&key, 1); set_cpu_key_k_type(&key, TYPE_INDIRECT); @@ -376,7 +378,7 @@ void add_save_link(struct reiserfs_transaction_handle *th, retval = search_item(inode->i_sb, &key, &path); if (retval != ITEM_NOT_FOUND) { if (retval != -ENOSPC) - reiserfs_warning(inode->i_sb, "vs-2100: add_save_link:" + reiserfs_warning(inode->i_sb, "vs-2100", "search_by_key (%K) returned %d", &key, retval); pathrelse(&path); @@ -391,9 +393,8 @@ void add_save_link(struct reiserfs_transaction_handle *th, reiserfs_insert_item(th, &path, &key, &ih, NULL, (char *)&link); if (retval) { if (retval != -ENOSPC) - reiserfs_warning(inode->i_sb, - "vs-2120: add_save_link: insert_item returned %d", - retval); + reiserfs_warning(inode->i_sb, "vs-2120", + "insert_item returned %d", retval); } else { if (truncate) REISERFS_I(inode)->i_flags |= @@ -492,8 +493,7 @@ static void reiserfs_put_super(struct super_block *s) print_statistics(s); if (REISERFS_SB(s)->reserved_blocks != 0) { - reiserfs_warning(s, - "green-2005: reiserfs_put_super: reserved blocks left %d", + reiserfs_warning(s, "green-2005", "reserved blocks left %d", REISERFS_SB(s)->reserved_blocks); } @@ -559,8 +559,8 @@ static void reiserfs_dirty_inode(struct inode *inode) int err = 0; if (inode->i_sb->s_flags & MS_RDONLY) { - reiserfs_warning(inode->i_sb, - "clm-6006: writing inode %lu on readonly FS", + reiserfs_warning(inode->i_sb, "clm-6006", + "writing inode %lu on readonly FS", inode->i_ino); return; } @@ -794,13 +794,15 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, if (bit_flags) { if (opt->clrmask == (1 << REISERFS_UNSUPPORTED_OPT)) - reiserfs_warning(s, "%s not supported.", + reiserfs_warning(s, "super-6500", + "%s not supported.\n", p); else *bit_flags &= ~opt->clrmask; if (opt->setmask == (1 << REISERFS_UNSUPPORTED_OPT)) - reiserfs_warning(s, "%s not supported.", + reiserfs_warning(s, "super-6501", + "%s not supported.\n", p); else *bit_flags |= opt->setmask; @@ -809,7 +811,8 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, } } if (!opt->option_name) { - reiserfs_warning(s, "unknown mount option \"%s\"", p); + reiserfs_warning(s, "super-6502", + "unknown mount option \"%s\"", p); return -1; } @@ -817,8 +820,9 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, switch (*p) { case '=': if (!opt->arg_required) { - reiserfs_warning(s, - "the option \"%s\" does not require an argument", + reiserfs_warning(s, "super-6503", + "the option \"%s\" does not " + "require an argument\n", opt->option_name); return -1; } @@ -826,14 +830,15 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, case 0: if (opt->arg_required) { - reiserfs_warning(s, - "the option \"%s\" requires an argument", - opt->option_name); + reiserfs_warning(s, "super-6504", + "the option \"%s\" requires an " + "argument\n", opt->option_name); return -1; } break; default: - reiserfs_warning(s, "head of option \"%s\" is only correct", + reiserfs_warning(s, "super-6505", + "head of option \"%s\" is only correct\n", opt->option_name); return -1; } @@ -845,7 +850,8 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, && !(opt->arg_required & (1 << REISERFS_OPT_ALLOWEMPTY)) && !strlen(p)) { /* this catches "option=," if not allowed */ - reiserfs_warning(s, "empty argument for \"%s\"", + reiserfs_warning(s, "super-6506", + "empty argument for \"%s\"\n", opt->option_name); return -1; } @@ -867,7 +873,8 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, } } - reiserfs_warning(s, "bad value \"%s\" for option \"%s\"", p, + reiserfs_warning(s, "super-6506", + "bad value \"%s\" for option \"%s\"\n", p, opt->option_name); return -1; } @@ -957,9 +964,9 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin *blocks = simple_strtoul(arg, &p, 0); if (*p != '\0') { /* NNN does not look like a number */ - reiserfs_warning(s, - "reiserfs_parse_options: bad value %s", - arg); + reiserfs_warning(s, "super-6507", + "bad value %s for " + "-oresize\n", arg); return 0; } } @@ -970,8 +977,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin unsigned long val = simple_strtoul(arg, &p, 0); /* commit=NNN (time in seconds) */ if (*p != '\0' || val >= (unsigned int)-1) { - reiserfs_warning(s, - "reiserfs_parse_options: bad value %s", + reiserfs_warning(s, "super-6508", + "bad value %s for -ocommit\n", arg); return 0; } @@ -979,16 +986,18 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin } if (c == 'w') { - reiserfs_warning(s, "reiserfs: nolargeio option is no longer supported"); + reiserfs_warning(s, "super-6509", "nolargeio option " + "is no longer supported"); return 0; } if (c == 'j') { if (arg && *arg && jdev_name) { if (*jdev_name) { //Hm, already assigned? - reiserfs_warning(s, - "reiserfs_parse_options: journal device was already specified to be %s", - *jdev_name); + reiserfs_warning(s, "super-6510", + "journal device was " + "already specified to " + "be %s", *jdev_name); return 0; } *jdev_name = arg; @@ -1000,29 +1009,35 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin if (sb_any_quota_loaded(s) && (!*arg != !REISERFS_SB(s)->s_qf_names[qtype])) { - reiserfs_warning(s, - "reiserfs_parse_options: cannot change journaled quota options when quota turned on."); + reiserfs_warning(s, "super-6511", + "cannot change journaled " + "quota options when quota " + "turned on."); return 0; } if (*arg) { /* Some filename specified? */ if (REISERFS_SB(s)->s_qf_names[qtype] && strcmp(REISERFS_SB(s)->s_qf_names[qtype], arg)) { - reiserfs_warning(s, - "reiserfs_parse_options: %s quota file already specified.", + reiserfs_warning(s, "super-6512", + "%s quota file " + "already specified.", QTYPE2NAME(qtype)); return 0; } if (strchr(arg, '/')) { - reiserfs_warning(s, - "reiserfs_parse_options: quotafile must be on filesystem root."); + reiserfs_warning(s, "super-6513", + "quotafile must be " + "on filesystem root."); return 0; } qf_names[qtype] = kmalloc(strlen(arg) + 1, GFP_KERNEL); if (!qf_names[qtype]) { - reiserfs_warning(s, - "reiserfs_parse_options: not enough memory for storing quotafile name."); + reiserfs_warning(s, "reiserfs-2502", + "not enough memory " + "for storing " + "quotafile name."); return 0; } strcpy(qf_names[qtype], arg); @@ -1040,21 +1055,24 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin else if (!strcmp(arg, "vfsv0")) *qfmt = QFMT_VFS_V0; else { - reiserfs_warning(s, - "reiserfs_parse_options: unknown quota format specified."); + reiserfs_warning(s, "super-6514", + "unknown quota format " + "specified."); return 0; } if (sb_any_quota_loaded(s) && *qfmt != REISERFS_SB(s)->s_jquota_fmt) { - reiserfs_warning(s, - "reiserfs_parse_options: cannot change journaled quota options when quota turned on."); + reiserfs_warning(s, "super-6515", + "cannot change journaled " + "quota options when quota " + "turned on."); return 0; } } #else if (c == 'u' || c == 'g' || c == 'f') { - reiserfs_warning(s, - "reiserfs_parse_options: journaled quota options not supported."); + reiserfs_warning(s, "reiserfs-2503", "journaled " + "quota options not supported."); return 0; } #endif @@ -1063,15 +1081,15 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin #ifdef CONFIG_QUOTA if (!REISERFS_SB(s)->s_jquota_fmt && !*qfmt && (qf_names[USRQUOTA] || qf_names[GRPQUOTA])) { - reiserfs_warning(s, - "reiserfs_parse_options: journaled quota format not specified."); + reiserfs_warning(s, "super-6515", + "journaled quota format not specified."); return 0; } /* This checking is not precise wrt the quota type but for our purposes it is sufficient */ if (!(*mount_options & (1 << REISERFS_QUOTA)) && sb_any_quota_loaded(s)) { - reiserfs_warning(s, - "reiserfs_parse_options: quota options must be present when quota is turned on."); + reiserfs_warning(s, "super-6516", "quota options must " + "be present when quota is turned on."); return 0; } #endif @@ -1131,14 +1149,15 @@ static void handle_attrs(struct super_block *s) if (reiserfs_attrs(s)) { if (old_format_only(s)) { - reiserfs_warning(s, - "reiserfs: cannot support attributes on 3.5.x disk format"); + reiserfs_warning(s, "super-6517", "cannot support " + "attributes on 3.5.x disk format"); REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); return; } if (!(le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared)) { - reiserfs_warning(s, - "reiserfs: cannot support attributes until flag is set in super-block"); + reiserfs_warning(s, "super-6518", "cannot support " + "attributes until flag is set in " + "super-block"); REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); } } @@ -1316,7 +1335,7 @@ static int read_super_block(struct super_block *s, int offset) bh = sb_bread(s, offset / s->s_blocksize); if (!bh) { - reiserfs_warning(s, "sh-2006: read_super_block: " + reiserfs_warning(s, "sh-2006", "bread failed (dev %s, block %lu, size %lu)", reiserfs_bdevname(s), offset / s->s_blocksize, s->s_blocksize); @@ -1337,8 +1356,8 @@ static int read_super_block(struct super_block *s, int offset) bh = sb_bread(s, offset / s->s_blocksize); if (!bh) { - reiserfs_warning(s, "sh-2007: read_super_block: " - "bread failed (dev %s, block %lu, size %lu)\n", + reiserfs_warning(s, "sh-2007", + "bread failed (dev %s, block %lu, size %lu)", reiserfs_bdevname(s), offset / s->s_blocksize, s->s_blocksize); return 1; @@ -1346,8 +1365,8 @@ static int read_super_block(struct super_block *s, int offset) rs = (struct reiserfs_super_block *)bh->b_data; if (sb_blocksize(rs) != s->s_blocksize) { - reiserfs_warning(s, "sh-2011: read_super_block: " - "can't find a reiserfs filesystem on (dev %s, block %Lu, size %lu)\n", + reiserfs_warning(s, "sh-2011", "can't find a reiserfs " + "filesystem on (dev %s, block %Lu, size %lu)", reiserfs_bdevname(s), (unsigned long long)bh->b_blocknr, s->s_blocksize); @@ -1357,9 +1376,10 @@ static int read_super_block(struct super_block *s, int offset) if (rs->s_v1.s_root_block == cpu_to_le32(-1)) { brelse(bh); - reiserfs_warning(s, - "Unfinished reiserfsck --rebuild-tree run detected. Please run\n" - "reiserfsck --rebuild-tree and wait for a completion. If that fails\n" + reiserfs_warning(s, "super-6519", "Unfinished reiserfsck " + "--rebuild-tree run detected. Please run\n" + "reiserfsck --rebuild-tree and wait for a " + "completion. If that fails\n" "get newer reiserfsprogs package"); return 1; } @@ -1377,10 +1397,9 @@ static int read_super_block(struct super_block *s, int offset) reiserfs_info(s, "found reiserfs format \"3.5\"" " with non-standard journal\n"); else { - reiserfs_warning(s, - "sh-2012: read_super_block: found unknown " - "format \"%u\" of reiserfs with non-standard magic", - sb_version(rs)); + reiserfs_warning(s, "sh-2012", "found unknown " + "format \"%u\" of reiserfs with " + "non-standard magic", sb_version(rs)); return 1; } } else @@ -1410,8 +1429,7 @@ static int reread_meta_blocks(struct super_block *s) ll_rw_block(READ, 1, &(SB_BUFFER_WITH_SB(s))); wait_on_buffer(SB_BUFFER_WITH_SB(s)); if (!buffer_uptodate(SB_BUFFER_WITH_SB(s))) { - reiserfs_warning(s, - "reread_meta_blocks, error reading the super"); + reiserfs_warning(s, "reiserfs-2504", "error reading the super"); return 1; } @@ -1475,10 +1493,10 @@ static __u32 find_hash_out(struct super_block *s) && (yurahash == GET_HASH_VALUE(deh_offset (&(de.de_deh[de.de_entry_num])))))) { - reiserfs_warning(s, - "Unable to automatically detect hash function. " - "Please mount with -o hash={tea,rupasov,r5}", - reiserfs_bdevname(s)); + reiserfs_warning(s, "reiserfs-2506", "Unable to " + "automatically detect hash function. " + "Please mount with -o " + "hash={tea,rupasov,r5}"); hash = UNSET_HASH; break; } @@ -1492,7 +1510,8 @@ static __u32 find_hash_out(struct super_block *s) (deh_offset(&(de.de_deh[de.de_entry_num]))) == r5hash) hash = R5_HASH; else { - reiserfs_warning(s, "Unrecognised hash function"); + reiserfs_warning(s, "reiserfs-2506", + "Unrecognised hash function"); hash = UNSET_HASH; } } while (0); @@ -1520,17 +1539,20 @@ static int what_hash(struct super_block *s) ** mount options */ if (reiserfs_rupasov_hash(s) && code != YURA_HASH) { - reiserfs_warning(s, "Error, %s hash detected, " + reiserfs_warning(s, "reiserfs-2507", + "Error, %s hash detected, " "unable to force rupasov hash", reiserfs_hashname(code)); code = UNSET_HASH; } else if (reiserfs_tea_hash(s) && code != TEA_HASH) { - reiserfs_warning(s, "Error, %s hash detected, " + reiserfs_warning(s, "reiserfs-2508", + "Error, %s hash detected, " "unable to force tea hash", reiserfs_hashname(code)); code = UNSET_HASH; } else if (reiserfs_r5_hash(s) && code != R5_HASH) { - reiserfs_warning(s, "Error, %s hash detected, " + reiserfs_warning(s, "reiserfs-2509", + "Error, %s hash detected, " "unable to force r5 hash", reiserfs_hashname(code)); code = UNSET_HASH; @@ -1589,9 +1611,9 @@ static int function2code(hashf_t func) return 0; } -#define SWARN(silent, s, ...) \ +#define SWARN(silent, s, id, ...) \ if (!(silent)) \ - reiserfs_warning (s, __VA_ARGS__) + reiserfs_warning(s, id, __VA_ARGS__) static int reiserfs_fill_super(struct super_block *s, void *data, int silent) { @@ -1643,8 +1665,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) #endif if (blocks) { - SWARN(silent, s, "jmacd-7: reiserfs_fill_super: resize option " - "for remount only"); + SWARN(silent, s, "jmacd-7", "resize option for remount only"); goto error; } @@ -1653,8 +1674,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) old_format = 1; /* try new format (64-th 1k block), which can contain reiserfs super block */ else if (read_super_block(s, REISERFS_DISK_OFFSET_IN_BYTES)) { - SWARN(silent, s, - "sh-2021: reiserfs_fill_super: can not find reiserfs on %s", + SWARN(silent, s, "sh-2021", "can not find reiserfs on %s", reiserfs_bdevname(s)); goto error; } @@ -1666,13 +1686,12 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) if (s->s_bdev && s->s_bdev->bd_inode && i_size_read(s->s_bdev->bd_inode) < sb_block_count(rs) * sb_blocksize(rs)) { - SWARN(silent, s, - "Filesystem on %s cannot be mounted because it is bigger than the device", - reiserfs_bdevname(s)); - SWARN(silent, s, - "You may need to run fsck or increase size of your LVM partition"); - SWARN(silent, s, - "Or may be you forgot to reboot after fdisk when it told you to"); + SWARN(silent, s, "", "Filesystem cannot be " + "mounted because it is bigger than the device"); + SWARN(silent, s, "", "You may need to run fsck " + "or increase size of your LVM partition"); + SWARN(silent, s, "", "Or may be you forgot to " + "reboot after fdisk when it told you to"); goto error; } @@ -1680,14 +1699,13 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) sbi->s_mount_state = REISERFS_VALID_FS; if ((errval = reiserfs_init_bitmap_cache(s))) { - SWARN(silent, s, - "jmacd-8: reiserfs_fill_super: unable to read bitmap"); + SWARN(silent, s, "jmacd-8", "unable to read bitmap"); goto error; } errval = -EINVAL; #ifdef CONFIG_REISERFS_CHECK - SWARN(silent, s, "CONFIG_REISERFS_CHECK is set ON"); - SWARN(silent, s, "- it is slow mode for debugging."); + SWARN(silent, s, "", "CONFIG_REISERFS_CHECK is set ON"); + SWARN(silent, s, "", "- it is slow mode for debugging."); #endif /* make data=ordered the default */ @@ -1708,8 +1726,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) } // set_device_ro(s->s_dev, 1) ; if (journal_init(s, jdev_name, old_format, commit_max_age)) { - SWARN(silent, s, - "sh-2022: reiserfs_fill_super: unable to initialize journal space"); + SWARN(silent, s, "sh-2022", + "unable to initialize journal space"); goto error; } else { jinit_done = 1; /* once this is set, journal_release must be called @@ -1717,8 +1735,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) */ } if (reread_meta_blocks(s)) { - SWARN(silent, s, - "jmacd-9: reiserfs_fill_super: unable to reread meta blocks after journal init"); + SWARN(silent, s, "jmacd-9", + "unable to reread meta blocks after journal init"); goto error; } @@ -1726,8 +1744,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) goto error; if (bdev_read_only(s->s_bdev) && !(s->s_flags & MS_RDONLY)) { - SWARN(silent, s, - "clm-7000: Detected readonly device, marking FS readonly"); + SWARN(silent, s, "clm-7000", + "Detected readonly device, marking FS readonly"); s->s_flags |= MS_RDONLY; } args.objectid = REISERFS_ROOT_OBJECTID; @@ -1736,8 +1754,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) iget5_locked(s, REISERFS_ROOT_OBJECTID, reiserfs_find_actor, reiserfs_init_locked_inode, (void *)(&args)); if (!root_inode) { - SWARN(silent, s, - "jmacd-10: reiserfs_fill_super: get root inode failed"); + SWARN(silent, s, "jmacd-10", "get root inode failed"); goto error; } @@ -1786,7 +1803,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) * avoiding corruption. -jeffm */ if (bmap_would_wrap(reiserfs_bmap_count(s)) && sb_bmap_nr(rs) != 0) { - reiserfs_warning(s, "super-2030: This file system " + reiserfs_warning(s, "super-2030", "This file system " "claims to use %u bitmap blocks in " "its super block, but requires %u. " "Clearing to zero.", sb_bmap_nr(rs), @@ -2087,8 +2104,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { err = reiserfs_unpack(inode, NULL); if (err) { - reiserfs_warning(sb, - "reiserfs: Unpacking tail of quota file failed" + reiserfs_warning(sb, "super-6520", + "Unpacking tail of quota file failed" " (%d). Cannot turn on quotas.", err); err = -EINVAL; goto out; @@ -2099,8 +2116,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, if (REISERFS_SB(sb)->s_qf_names[type]) { /* Quotafile not of fs root? */ if (path.dentry->d_parent != sb->s_root) - reiserfs_warning(sb, - "reiserfs: Quota file not on filesystem root. " + reiserfs_warning(sb, "super-6521", + "Quota file not on filesystem root. " "Journalled quota will not work."); } diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c index f8121a1147e8..256285dddb20 100644 --- a/fs/reiserfs/tail_conversion.c +++ b/fs/reiserfs/tail_conversion.c @@ -48,9 +48,9 @@ int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode, // FIXME: we could avoid this if (search_for_position_by_key(sb, &end_key, path) == POSITION_FOUND) { - reiserfs_warning(sb, "PAP-14030: direct2indirect: " - "pasted or inserted byte exists in the tree %K. " - "Use fsck to repair.", &end_key); + reiserfs_warning(sb, "PAP-14030", + "pasted or inserted byte exists in " + "the tree %K. Use fsck to repair.", &end_key); pathrelse(path); return -EIO; } diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index e11b00472361..d14f5c2c0e4a 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -259,7 +259,8 @@ static int __xattr_readdir(struct inode *inode, void *dirent, filldir_t filldir) ih = de.de_ih; if (!is_direntry_le_ih(ih)) { - reiserfs_warning(inode->i_sb, "not direntry %h", ih); + reiserfs_warning(inode->i_sb, "jdm-20000", + "not direntry %h", ih); break; } copy_item_head(&tmp_ih, ih); @@ -598,7 +599,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer, if (rxh->h_magic != cpu_to_le32(REISERFS_XATTR_MAGIC)) { unlock_page(page); reiserfs_put_page(page); - reiserfs_warning(inode->i_sb, + reiserfs_warning(inode->i_sb, "jdm-20001", "Invalid magic for xattr (%s) " "associated with %k", name, INODE_PKEY(inode)); @@ -618,7 +619,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer, if (xattr_hash(buffer, isize - sizeof(struct reiserfs_xattr_header)) != hash) { - reiserfs_warning(inode->i_sb, + reiserfs_warning(inode->i_sb, "jdm-20002", "Invalid hash for xattr (%s) associated " "with %k", name, INODE_PKEY(inode)); err = -EIO; @@ -652,7 +653,8 @@ __reiserfs_xattr_del(struct dentry *xadir, const char *name, int namelen) goto out_file; if (!is_reiserfs_priv_object(dentry->d_inode)) { - reiserfs_warning(dir->i_sb, "OID %08x [%.*s/%.*s] doesn't have " + reiserfs_warning(dir->i_sb, "jdm-20003", + "OID %08x [%.*s/%.*s] doesn't have " "priv flag set [parent is %sset].", le32_to_cpu(INODE_PKEY(dentry->d_inode)-> k_objectid), xadir->d_name.len, @@ -750,7 +752,7 @@ int reiserfs_delete_xattrs(struct inode *inode) reiserfs_write_unlock_xattrs(inode->i_sb); dput(root); } else { - reiserfs_warning(inode->i_sb, + reiserfs_warning(inode->i_sb, "jdm-20006", "Couldn't remove all entries in directory"); } unlock_kernel(); @@ -1154,7 +1156,8 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags) } else if (reiserfs_xattrs_optional(s)) { /* Old format filesystem, but optional xattrs have been enabled * at mount time. Error out. */ - reiserfs_warning(s, "xattrs/ACLs not supported on pre v3.6 " + reiserfs_warning(s, "jdm-20005", + "xattrs/ACLs not supported on pre v3.6 " "format filesystem. Failing mount."); err = -EOPNOTSUPP; goto error; @@ -1201,8 +1204,10 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags) /* 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 * check again if we go read-write */ - reiserfs_warning(s, "xattrs/ACLs enabled and couldn't " - "find/create .reiserfs_priv. Failing mount."); + reiserfs_warning(s, "jdm-20006", + "xattrs/ACLs enabled and couldn't " + "find/create .reiserfs_priv. " + "Failing mount."); err = -EOPNOTSUPP; } } diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 65bb5e3e3abe..056e2a3b04e3 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -79,7 +79,10 @@ struct fid; */ #define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ -void reiserfs_warning(struct super_block *s, const char *fmt, ...); +void __reiserfs_warning(struct super_block *s, const char *id, + const char *func, const char *fmt, ...); +#define reiserfs_warning(s, id, fmt, args...) \ + __reiserfs_warning(s, id, __func__, fmt, ##args) /* assertions handling */ /** always check a condition and panic if it's false. */ @@ -558,7 +561,7 @@ static inline int uniqueness2type(__u32 uniqueness) case V1_DIRENTRY_UNIQUENESS: return TYPE_DIRENTRY; default: - reiserfs_warning(NULL, "vs-500: unknown uniqueness %d", + reiserfs_warning(NULL, "vs-500", "unknown uniqueness %d", uniqueness); case V1_ANY_UNIQUENESS: return TYPE_ANY; @@ -578,7 +581,7 @@ static inline __u32 type2uniqueness(int type) case TYPE_DIRENTRY: return V1_DIRENTRY_UNIQUENESS; default: - reiserfs_warning(NULL, "vs-501: unknown type %d", type); + reiserfs_warning(NULL, "vs-501", "unknown type %d", type); case TYPE_ANY: return V1_ANY_UNIQUENESS; } -- cgit v1.2.3-59-g8ed1b From c3a9c2109f84882b9b3178f6b1838d550d3df0ec Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Mon, 30 Mar 2009 14:02:25 -0400 Subject: 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 Signed-off-by: Linus Torvalds --- fs/reiserfs/do_balan.c | 67 ++++++++++++++++++++++-------------------- fs/reiserfs/fix_node.c | 68 ++++++++++++++++++++++--------------------- fs/reiserfs/ibalance.c | 12 ++++---- fs/reiserfs/inode.c | 3 +- fs/reiserfs/item_ops.c | 8 +++-- fs/reiserfs/journal.c | 57 ++++++++++++++++++------------------ fs/reiserfs/lbalance.c | 27 +++++++++-------- fs/reiserfs/namei.c | 18 +++++------- fs/reiserfs/objectid.c | 3 +- fs/reiserfs/prints.c | 33 ++++++++++----------- fs/reiserfs/stree.c | 49 +++++++++++++++---------------- fs/reiserfs/tail_conversion.c | 10 +++---- include/linux/reiserfs_fs.h | 28 ++++++++++++++---- 13 files changed, 200 insertions(+), 183 deletions(-) (limited to 'fs/reiserfs/lbalance.c') diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c index f701f37ddf98..e788fbc3ff6b 100644 --- a/fs/reiserfs/do_balan.c +++ b/fs/reiserfs/do_balan.c @@ -153,8 +153,8 @@ static int balance_leaf_when_delete(struct tree_balance *tb, int flag) default: print_cur_tb("12040"); - reiserfs_panic(tb->tb_sb, - "PAP-12040: balance_leaf_when_delete: unexpectable mode: %s(%d)", + reiserfs_panic(tb->tb_sb, "PAP-12040", + "unexpected mode: %s(%d)", (flag == M_PASTE) ? "PASTE" : ((flag == M_INSERT) ? "INSERT" : @@ -721,8 +721,9 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h } break; default: /* cases d and t */ - reiserfs_panic(tb->tb_sb, - "PAP-12130: balance_leaf: lnum > 0: unexpectable mode: %s(%d)", + reiserfs_panic(tb->tb_sb, "PAP-12130", + "lnum > 0: unexpected mode: " + " %s(%d)", (flag == M_DELETE) ? "DELETE" : ((flag == M_CUT) @@ -1134,8 +1135,8 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h } break; default: /* cases d and t */ - reiserfs_panic(tb->tb_sb, - "PAP-12175: balance_leaf: rnum > 0: unexpectable mode: %s(%d)", + reiserfs_panic(tb->tb_sb, "PAP-12175", + "rnum > 0: unexpected mode: %s(%d)", (flag == M_DELETE) ? "DELETE" : ((flag == M_CUT) ? "CUT" @@ -1165,8 +1166,8 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h not set correctly */ if (tb->CFL[0]) { if (!tb->CFR[0]) - reiserfs_panic(tb->tb_sb, - "vs-12195: balance_leaf: CFR not initialized"); + reiserfs_panic(tb->tb_sb, "vs-12195", + "CFR not initialized"); copy_key(B_N_PDELIM_KEY(tb->CFL[0], tb->lkey[0]), B_N_PDELIM_KEY(tb->CFR[0], tb->rkey[0])); do_balance_mark_internal_dirty(tb, tb->CFL[0], 0); @@ -1472,7 +1473,10 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h && (pos_in_item != ih_item_len(ih_check) || tb->insert_size[0] <= 0)) reiserfs_panic(tb->tb_sb, - "PAP-12235: balance_leaf: pos_in_item must be equal to ih_item_len"); + "PAP-12235", + "pos_in_item " + "must be equal " + "to ih_item_len"); #endif /* CONFIG_REISERFS_CHECK */ leaf_mi = @@ -1532,8 +1536,8 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h } break; default: /* cases d and t */ - reiserfs_panic(tb->tb_sb, - "PAP-12245: balance_leaf: blknum > 2: unexpectable mode: %s(%d)", + reiserfs_panic(tb->tb_sb, "PAP-12245", + "blknum > 2: unexpected mode: %s(%d)", (flag == M_DELETE) ? "DELETE" : ((flag == M_CUT) ? "CUT" @@ -1678,10 +1682,11 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h print_cur_tb("12285"); reiserfs_panic(tb-> tb_sb, - "PAP-12285: balance_leaf: insert_size must be 0 (%d)", - tb-> - insert_size - [0]); + "PAP-12285", + "insert_size " + "must be 0 " + "(%d)", + tb->insert_size[0]); } } #endif /* CONFIG_REISERFS_CHECK */ @@ -1694,11 +1699,10 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h if (flag == M_PASTE && tb->insert_size[0]) { print_cur_tb("12290"); reiserfs_panic(tb->tb_sb, - "PAP-12290: balance_leaf: insert_size is still not 0 (%d)", + "PAP-12290", "insert_size is still not 0 (%d)", tb->insert_size[0]); } #endif /* CONFIG_REISERFS_CHECK */ - return 0; } /* Leaf level of the tree is balanced (end of balance_leaf) */ @@ -1729,8 +1733,7 @@ struct buffer_head *get_FEB(struct tree_balance *tb) break; if (i == MAX_FEB_SIZE) - reiserfs_panic(tb->tb_sb, - "vs-12300: get_FEB: FEB list is empty"); + reiserfs_panic(tb->tb_sb, "vs-12300", "FEB list is empty"); bi.tb = tb; bi.bi_bh = first_b = tb->FEB[i]; @@ -1871,8 +1874,8 @@ static void check_internal_node(struct super_block *s, struct buffer_head *bh, for (i = 0; i <= B_NR_ITEMS(bh); i++, dc++) { if (!is_reusable(s, dc_block_number(dc), 1)) { print_cur_tb(mes); - reiserfs_panic(s, - "PAP-12338: check_internal_node: invalid child pointer %y in %b", + reiserfs_panic(s, "PAP-12338", + "invalid child pointer %y in %b", dc, bh); } } @@ -1894,9 +1897,10 @@ static int check_before_balancing(struct tree_balance *tb) int retval = 0; if (cur_tb) { - reiserfs_panic(tb->tb_sb, "vs-12335: check_before_balancing: " - "suspect that schedule occurred based on cur_tb not being null at this point in code. " - "do_balance cannot properly handle schedule occurring while it runs."); + reiserfs_panic(tb->tb_sb, "vs-12335", "suspect that schedule " + "occurred based on cur_tb not being null at " + "this point in code. do_balance cannot properly " + "handle schedule occurring while it runs."); } /* double check that buffers that we will modify are unlocked. (fix_nodes should already have @@ -1928,8 +1932,8 @@ static void check_after_balance_leaf(struct tree_balance *tb) dc_size(B_N_CHILD (tb->FL[0], get_left_neighbor_position(tb, 0)))) { print_cur_tb("12221"); - reiserfs_panic(tb->tb_sb, - "PAP-12355: check_after_balance_leaf: shift to left was incorrect"); + reiserfs_panic(tb->tb_sb, "PAP-12355", + "shift to left was incorrect"); } } if (tb->rnum[0]) { @@ -1938,8 +1942,8 @@ static void check_after_balance_leaf(struct tree_balance *tb) dc_size(B_N_CHILD (tb->FR[0], get_right_neighbor_position(tb, 0)))) { print_cur_tb("12222"); - reiserfs_panic(tb->tb_sb, - "PAP-12360: check_after_balance_leaf: shift to right was incorrect"); + reiserfs_panic(tb->tb_sb, "PAP-12360", + "shift to right was incorrect"); } } if (PATH_H_PBUFFER(tb->tb_path, 1) && @@ -1964,8 +1968,7 @@ static void check_after_balance_leaf(struct tree_balance *tb) (PATH_H_PBUFFER(tb->tb_path, 1), PATH_H_POSITION(tb->tb_path, 1))), right); - reiserfs_panic(tb->tb_sb, - "PAP-12365: check_after_balance_leaf: S is incorrect"); + reiserfs_panic(tb->tb_sb, "PAP-12365", "S is incorrect"); } } @@ -2100,8 +2103,8 @@ void do_balance(struct tree_balance *tb, /* tree_balance structure */ tb->need_balance_dirty = 0; if (FILESYSTEM_CHANGED_TB(tb)) { - reiserfs_panic(tb->tb_sb, - "clm-6000: do_balance, fs generation has changed\n"); + reiserfs_panic(tb->tb_sb, "clm-6000", "fs generation has " + "changed"); } /* if we have no real work to do */ if (!tb->insert_size[0]) { diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c index 59735a9e2349..bbb37b0589af 100644 --- a/fs/reiserfs/fix_node.c +++ b/fs/reiserfs/fix_node.c @@ -135,8 +135,7 @@ static void create_virtual_node(struct tree_balance *tb, int h) vn->vn_free_ptr += op_create_vi(vn, vi, is_affected, tb->insert_size[0]); if (tb->vn_buf + tb->vn_buf_size < vn->vn_free_ptr) - reiserfs_panic(tb->tb_sb, - "vs-8030: create_virtual_node: " + reiserfs_panic(tb->tb_sb, "vs-8030", "virtual node space consumed"); if (!is_affected) @@ -186,8 +185,9 @@ static void create_virtual_node(struct tree_balance *tb, int h) && I_ENTRY_COUNT(B_N_PITEM_HEAD(Sh, 0)) == 1)) { /* node contains more than 1 item, or item is not directory item, or this item contains more than 1 entry */ print_block(Sh, 0, -1, -1); - reiserfs_panic(tb->tb_sb, - "vs-8045: create_virtual_node: rdkey %k, affected item==%d (mode==%c) Must be %c", + reiserfs_panic(tb->tb_sb, "vs-8045", + "rdkey %k, affected item==%d " + "(mode==%c) Must be %c", key, vn->vn_affected_item_num, vn->vn_mode, M_DELETE); } @@ -1255,8 +1255,8 @@ static int ip_check_balance(struct tree_balance *tb, int h) /* Calculate balance parameters for creating new root. */ if (!Sh) { if (!h) - reiserfs_panic(tb->tb_sb, - "vs-8210: ip_check_balance: S[0] can not be 0"); + reiserfs_panic(tb->tb_sb, "vs-8210", + "S[0] can not be 0"); switch (n_ret_value = get_empty_nodes(tb, h)) { case CARRY_ON: set_parameters(tb, h, 0, 0, 1, NULL, -1, -1); @@ -1266,8 +1266,8 @@ static int ip_check_balance(struct tree_balance *tb, int h) case REPEAT_SEARCH: return n_ret_value; default: - reiserfs_panic(tb->tb_sb, - "vs-8215: ip_check_balance: incorrect return value of get_empty_nodes"); + reiserfs_panic(tb->tb_sb, "vs-8215", "incorrect " + "return value of get_empty_nodes"); } } @@ -2095,38 +2095,38 @@ static void tb_buffer_sanity_check(struct super_block *p_s_sb, if (p_s_bh) { if (atomic_read(&(p_s_bh->b_count)) <= 0) { - reiserfs_panic(p_s_sb, - "jmacd-1: tb_buffer_sanity_check(): negative or zero reference counter for buffer %s[%d] (%b)\n", - descr, level, p_s_bh); + reiserfs_panic(p_s_sb, "jmacd-1", "negative or zero " + "reference counter for buffer %s[%d] " + "(%b)", descr, level, p_s_bh); } if (!buffer_uptodate(p_s_bh)) { - reiserfs_panic(p_s_sb, - "jmacd-2: tb_buffer_sanity_check(): buffer is not up to date %s[%d] (%b)\n", + reiserfs_panic(p_s_sb, "jmacd-2", "buffer is not up " + "to date %s[%d] (%b)", descr, level, p_s_bh); } if (!B_IS_IN_TREE(p_s_bh)) { - reiserfs_panic(p_s_sb, - "jmacd-3: tb_buffer_sanity_check(): buffer is not in tree %s[%d] (%b)\n", + reiserfs_panic(p_s_sb, "jmacd-3", "buffer is not " + "in tree %s[%d] (%b)", descr, level, p_s_bh); } if (p_s_bh->b_bdev != p_s_sb->s_bdev) { - reiserfs_panic(p_s_sb, - "jmacd-4: tb_buffer_sanity_check(): buffer has wrong device %s[%d] (%b)\n", + reiserfs_panic(p_s_sb, "jmacd-4", "buffer has wrong " + "device %s[%d] (%b)", descr, level, p_s_bh); } if (p_s_bh->b_size != p_s_sb->s_blocksize) { - reiserfs_panic(p_s_sb, - "jmacd-5: tb_buffer_sanity_check(): buffer has wrong blocksize %s[%d] (%b)\n", + reiserfs_panic(p_s_sb, "jmacd-5", "buffer has wrong " + "blocksize %s[%d] (%b)", descr, level, p_s_bh); } if (p_s_bh->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { - reiserfs_panic(p_s_sb, - "jmacd-6: tb_buffer_sanity_check(): buffer block number too high %s[%d] (%b)\n", + reiserfs_panic(p_s_sb, "jmacd-6", "buffer block " + "number too high %s[%d] (%b)", descr, level, p_s_bh); } } @@ -2358,14 +2358,14 @@ int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, struct item_head *p_s_ #ifdef CONFIG_REISERFS_CHECK if (cur_tb) { print_cur_tb("fix_nodes"); - reiserfs_panic(p_s_tb->tb_sb, - "PAP-8305: fix_nodes: there is pending do_balance"); + reiserfs_panic(p_s_tb->tb_sb, "PAP-8305", + "there is pending do_balance"); } if (!buffer_uptodate(p_s_tbS0) || !B_IS_IN_TREE(p_s_tbS0)) { - reiserfs_panic(p_s_tb->tb_sb, - "PAP-8320: fix_nodes: S[0] (%b %z) is not uptodate " - "at the beginning of fix_nodes or not in tree (mode %c)", + reiserfs_panic(p_s_tb->tb_sb, "PAP-8320", "S[0] (%b %z) is " + "not uptodate at the beginning of fix_nodes " + "or not in tree (mode %c)", p_s_tbS0, p_s_tbS0, n_op_mode); } @@ -2373,24 +2373,26 @@ int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, struct item_head *p_s_ switch (n_op_mode) { case M_INSERT: if (n_item_num <= 0 || n_item_num > B_NR_ITEMS(p_s_tbS0)) - reiserfs_panic(p_s_tb->tb_sb, - "PAP-8330: fix_nodes: Incorrect item number %d (in S0 - %d) in case of insert", - n_item_num, B_NR_ITEMS(p_s_tbS0)); + reiserfs_panic(p_s_tb->tb_sb, "PAP-8330", "Incorrect " + "item number %d (in S0 - %d) in case " + "of insert", n_item_num, + B_NR_ITEMS(p_s_tbS0)); break; case M_PASTE: case M_DELETE: case M_CUT: if (n_item_num < 0 || n_item_num >= B_NR_ITEMS(p_s_tbS0)) { print_block(p_s_tbS0, 0, -1, -1); - reiserfs_panic(p_s_tb->tb_sb, - "PAP-8335: fix_nodes: Incorrect item number(%d); mode = %c insert_size = %d\n", + reiserfs_panic(p_s_tb->tb_sb, "PAP-8335", "Incorrect " + "item number(%d); mode = %c " + "insert_size = %d", n_item_num, n_op_mode, p_s_tb->insert_size[0]); } break; default: - reiserfs_panic(p_s_tb->tb_sb, - "PAP-8340: fix_nodes: Incorrect mode of operation"); + reiserfs_panic(p_s_tb->tb_sb, "PAP-8340", "Incorrect mode " + "of operation"); } #endif diff --git a/fs/reiserfs/ibalance.c b/fs/reiserfs/ibalance.c index de391a82b999..063b5514fe29 100644 --- a/fs/reiserfs/ibalance.c +++ b/fs/reiserfs/ibalance.c @@ -105,8 +105,8 @@ static void internal_define_dest_src_infos(int shift_mode, break; default: - reiserfs_panic(tb->tb_sb, - "internal_define_dest_src_infos: shift type is unknown (%d)", + reiserfs_panic(tb->tb_sb, "ibalance-1", + "shift type is unknown (%d)", shift_mode); } } @@ -702,8 +702,8 @@ static void balance_internal_when_delete(struct tree_balance *tb, return; } - reiserfs_panic(tb->tb_sb, - "balance_internal_when_delete: unexpected tb->lnum[%d]==%d or tb->rnum[%d]==%d", + reiserfs_panic(tb->tb_sb, "ibalance-2", + "unexpected tb->lnum[%d]==%d or tb->rnum[%d]==%d", h, tb->lnum[h], h, tb->rnum[h]); } @@ -940,8 +940,8 @@ int balance_internal(struct tree_balance *tb, /* tree_balance structure struct block_head *blkh; if (tb->blknum[h] != 1) - reiserfs_panic(NULL, - "balance_internal: One new node required for creating the new root"); + reiserfs_panic(NULL, "ibalance-3", "One new node " + "required for creating the new root"); /* S[h] = empty buffer from the list FEB. */ tbSh = get_FEB(tb); blkh = B_BLK_HEAD(tbSh); diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 95157762b1bf..7ee0097004c0 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -1300,8 +1300,7 @@ static void update_stat_data(struct treepath *path, struct inode *inode, ih = PATH_PITEM_HEAD(path); if (!is_statdata_le_ih(ih)) - reiserfs_panic(inode->i_sb, - "vs-13065: update_stat_data: key %k, found item %h", + reiserfs_panic(inode->i_sb, "vs-13065", "key %k, found item %h", INODE_PKEY(inode), ih); if (stat_data_v1(ih)) { diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c index 8a11cf39f57b..72cb1cc51b87 100644 --- a/fs/reiserfs/item_ops.c +++ b/fs/reiserfs/item_ops.c @@ -517,8 +517,9 @@ static int direntry_create_vi(struct virtual_node *vn, ((is_affected && (vn->vn_mode == M_PASTE || vn->vn_mode == M_CUT)) ? insert_size : 0)) { - reiserfs_panic(NULL, - "vs-8025: set_entry_sizes: (mode==%c, insert_size==%d), invalid length of directory item", + reiserfs_panic(NULL, "vs-8025", "(mode==%c, " + "insert_size==%d), invalid length of " + "directory item", vn->vn_mode, insert_size); } } @@ -549,7 +550,8 @@ static int direntry_check_left(struct virtual_item *vi, int free, } if (entries == dir_u->entry_count) { - reiserfs_panic(NULL, "free space %d, entry_count %d\n", free, + reiserfs_panic(NULL, "item_ops-1", + "free space %d, entry_count %d", free, dir_u->entry_count); } diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 88a031fafd07..774f3ba37409 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -436,8 +436,8 @@ void reiserfs_check_lock_depth(struct super_block *sb, char *caller) { #ifdef CONFIG_SMP if (current->lock_depth < 0) { - reiserfs_panic(sb, "%s called without kernel lock held", - caller); + reiserfs_panic(sb, "journal-1", "%s called without kernel " + "lock held", caller); } #else ; @@ -574,7 +574,7 @@ static inline void put_journal_list(struct super_block *s, struct reiserfs_journal_list *jl) { if (jl->j_refcount < 1) { - reiserfs_panic(s, "trans id %u, refcount at %d", + reiserfs_panic(s, "journal-2", "trans id %u, refcount at %d", jl->j_trans_id, jl->j_refcount); } if (--jl->j_refcount == 0) @@ -1416,8 +1416,7 @@ static int flush_journal_list(struct super_block *s, count = 0; if (j_len_saved > journal->j_trans_max) { - reiserfs_panic(s, - "journal-715: flush_journal_list, length is %lu, trans id %lu\n", + reiserfs_panic(s, "journal-715", "length is %lu, trans id %lu", j_len_saved, jl->j_trans_id); return 0; } @@ -1449,8 +1448,8 @@ static int flush_journal_list(struct super_block *s, ** or wait on a more recent transaction, or just ignore it */ if (atomic_read(&(journal->j_wcount)) != 0) { - reiserfs_panic(s, - "journal-844: panic journal list is flushing, wcount is not 0\n"); + reiserfs_panic(s, "journal-844", "journal list is flushing, " + "wcount is not 0"); } cn = jl->j_realblock; while (cn) { @@ -1551,13 +1550,13 @@ static int flush_journal_list(struct super_block *s, while (cn) { if (test_bit(BLOCK_NEEDS_FLUSH, &cn->state)) { if (!cn->bh) { - reiserfs_panic(s, - "journal-1011: cn->bh is NULL\n"); + reiserfs_panic(s, "journal-1011", + "cn->bh is NULL"); } wait_on_buffer(cn->bh); if (!cn->bh) { - reiserfs_panic(s, - "journal-1012: cn->bh is NULL\n"); + reiserfs_panic(s, "journal-1012", + "cn->bh is NULL"); } if (unlikely(!buffer_uptodate(cn->bh))) { #ifdef CONFIG_REISERFS_CHECK @@ -3255,8 +3254,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, PROC_INFO_INC(p_s_sb, journal.mark_dirty); if (th->t_trans_id != journal->j_trans_id) { - reiserfs_panic(th->t_super, - "journal-1577: handle trans id %ld != current trans id %ld\n", + reiserfs_panic(th->t_super, "journal-1577", + "handle trans id %ld != current trans id %ld", th->t_trans_id, journal->j_trans_id); } @@ -3295,8 +3294,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ** Nothing can be done here, except make the FS readonly or panic. */ if (journal->j_len >= journal->j_trans_max) { - reiserfs_panic(th->t_super, - "journal-1413: journal_mark_dirty: j_len (%lu) is too big\n", + reiserfs_panic(th->t_super, "journal-1413", + "j_len (%lu) is too big", journal->j_len); } @@ -3316,7 +3315,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, if (!cn) { cn = get_cnode(p_s_sb); if (!cn) { - reiserfs_panic(p_s_sb, "get_cnode failed!\n"); + reiserfs_panic(p_s_sb, "journal-4", + "get_cnode failed!"); } if (th->t_blocks_logged == th->t_blocks_allocated) { @@ -3584,8 +3584,8 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, BUG_ON(!th->t_trans_id); if (th->t_trans_id != journal->j_trans_id) { - reiserfs_panic(th->t_super, - "journal-1577: handle trans id %ld != current trans id %ld\n", + reiserfs_panic(th->t_super, "journal-1577", + "handle trans id %ld != current trans id %ld", th->t_trans_id, journal->j_trans_id); } @@ -3664,8 +3664,8 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, } if (journal->j_start > SB_ONDISK_JOURNAL_SIZE(p_s_sb)) { - reiserfs_panic(p_s_sb, - "journal-003: journal_end: j_start (%ld) is too high\n", + reiserfs_panic(p_s_sb, "journal-003", + "j_start (%ld) is too high", journal->j_start); } return 1; @@ -3710,8 +3710,8 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, /* set the bit for this block in the journal bitmap for this transaction */ jb = journal->j_current_jl->j_list_bitmap; if (!jb) { - reiserfs_panic(p_s_sb, - "journal-1702: journal_mark_freed, journal_list_bitmap is NULL\n"); + reiserfs_panic(p_s_sb, "journal-1702", + "journal_list_bitmap is NULL"); } set_bit_in_list_bitmap(p_s_sb, blocknr, jb); @@ -4066,8 +4066,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, if (buffer_journaled(cn->bh)) { jl_cn = get_cnode(p_s_sb); if (!jl_cn) { - reiserfs_panic(p_s_sb, - "journal-1676, get_cnode returned NULL\n"); + reiserfs_panic(p_s_sb, "journal-1676", + "get_cnode returned NULL"); } if (i == 0) { jl->j_realblock = jl_cn; @@ -4083,8 +4083,9 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, if (is_block_in_log_or_reserved_area (p_s_sb, cn->bh->b_blocknr)) { - reiserfs_panic(p_s_sb, - "journal-2332: Trying to log block %lu, which is a log block\n", + reiserfs_panic(p_s_sb, "journal-2332", + "Trying to log block %lu, " + "which is a log block", cn->bh->b_blocknr); } jl_cn->blocknr = cn->bh->b_blocknr; @@ -4268,8 +4269,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, get_list_bitmap(p_s_sb, journal->j_current_jl); if (!(journal->j_current_jl->j_list_bitmap)) { - reiserfs_panic(p_s_sb, - "journal-1996: do_journal_end, could not get a list bitmap\n"); + reiserfs_panic(p_s_sb, "journal-1996", + "could not get a list bitmap"); } atomic_set(&(journal->j_jlock), 0); diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c index 381339b432e7..67f1d1de213d 100644 --- a/fs/reiserfs/lbalance.c +++ b/fs/reiserfs/lbalance.c @@ -168,10 +168,11 @@ static int leaf_copy_boundary_item(struct buffer_info *dest_bi, if (bytes_or_entries == ih_item_len(ih) && is_indirect_le_ih(ih)) if (get_ih_free_space(ih)) - reiserfs_panic(NULL, - "vs-10020: leaf_copy_boundary_item: " - "last unformatted node must be filled entirely (%h)", - ih); + reiserfs_panic(sb_from_bi(dest_bi), + "vs-10020", + "last unformatted node " + "must be filled " + "entirely (%h)", ih); } #endif @@ -622,9 +623,8 @@ static void leaf_define_dest_src_infos(int shift_mode, struct tree_balance *tb, break; default: - reiserfs_panic(NULL, - "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)", - shift_mode); + reiserfs_panic(sb_from_bi(src_bi), "vs-10250", + "shift type is unknown (%d)", shift_mode); } RFALSE(!src_bi->bi_bh || !dest_bi->bi_bh, "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly", @@ -674,9 +674,9 @@ int leaf_shift_left(struct tree_balance *tb, int shift_num, int shift_bytes) #ifdef CONFIG_REISERFS_CHECK if (tb->tb_mode == M_PASTE || tb->tb_mode == M_INSERT) { print_cur_tb("vs-10275"); - reiserfs_panic(tb->tb_sb, - "vs-10275: leaf_shift_left: balance condition corrupted (%c)", - tb->tb_mode); + reiserfs_panic(tb->tb_sb, "vs-10275", + "balance condition corrupted " + "(%c)", tb->tb_mode); } #endif @@ -889,9 +889,12 @@ void leaf_paste_in_buffer(struct buffer_info *bi, int affected_item_num, #ifdef CONFIG_REISERFS_CHECK if (zeros_number > paste_size) { + struct super_block *sb = NULL; + if (bi && bi->tb) + sb = bi->tb->tb_sb; print_cur_tb("10177"); - reiserfs_panic(NULL, - "vs-10177: leaf_paste_in_buffer: ero number == %d, paste_size == %d", + reiserfs_panic(sb, "vs-10177", + "zeros_number == %d, paste_size == %d", zeros_number, paste_size); } #endif /* CONFIG_REISERFS_CHECK */ diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index bb41c6e7c79b..ef41cc882bd9 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -145,10 +145,9 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, if (!is_direntry_le_ih(de->de_ih) || COMP_SHORT_KEYS(&(de->de_ih->ih_key), key)) { print_block(de->de_bh, 0, -1, -1); - reiserfs_panic(sb, - "vs-7005: search_by_entry_key: found item %h is not directory item or " - "does not belong to the same directory as key %K", - de->de_ih, key); + reiserfs_panic(sb, "vs-7005", "found item %h is not directory " + "item or does not belong to the same directory " + "as key %K", de->de_ih, key); } #endif /* CONFIG_REISERFS_CHECK */ @@ -1193,15 +1192,14 @@ static int entry_points_to_object(const char *name, int len, if (inode) { if (!de_visible(de->de_deh + de->de_entry_num)) - reiserfs_panic(NULL, - "vs-7042: entry_points_to_object: entry must be visible"); + reiserfs_panic(inode->i_sb, "vs-7042", + "entry must be visible"); return (de->de_objectid == inode->i_ino) ? 1 : 0; } /* this must be added hidden entry */ if (de_visible(de->de_deh + de->de_entry_num)) - reiserfs_panic(NULL, - "vs-7043: entry_points_to_object: entry must be visible"); + reiserfs_panic(NULL, "vs-7043", "entry must be visible"); return 1; } @@ -1315,8 +1313,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, new_dentry->d_name.len, old_inode, 0); if (retval == -EEXIST) { if (!new_dentry_inode) { - reiserfs_panic(old_dir->i_sb, - "vs-7050: new entry is found, new inode == 0\n"); + reiserfs_panic(old_dir->i_sb, "vs-7050", + "new entry is found, new inode == 0"); } } else if (retval) { int err = journal_end(&th, old_dir->i_sb, jbegin_count); diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c index a3a5f43ff443..90e4e52f857b 100644 --- a/fs/reiserfs/objectid.c +++ b/fs/reiserfs/objectid.c @@ -18,8 +18,7 @@ static void check_objectid_map(struct super_block *s, __le32 * map) { if (le32_to_cpu(map[0]) != 1) - reiserfs_panic(s, - "vs-15010: check_objectid_map: map corrupted: %lx", + reiserfs_panic(s, "vs-15010", "map corrupted: %lx", (long unsigned int)le32_to_cpu(map[0])); // FIXME: add something else here diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c index de71372f0dfe..1964acb6eb17 100644 --- a/fs/reiserfs/prints.c +++ b/fs/reiserfs/prints.c @@ -353,14 +353,21 @@ void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...) extern struct tree_balance *cur_tb; #endif -void reiserfs_panic(struct super_block *sb, const char *fmt, ...) +void __reiserfs_panic(struct super_block *sb, const char *id, + const char *function, const char *fmt, ...) { do_reiserfs_warning(fmt); +#ifdef CONFIG_REISERFS_CHECK dump_stack(); - - panic(KERN_EMERG "REISERFS: panic (device %s): %s\n", - reiserfs_bdevname(sb), error_buf); +#endif + if (sb) + panic(KERN_WARNING "REISERFS panic (device %s): %s%s%s: %s\n", + sb->s_id, id ? id : "", id ? " " : "", + function, error_buf); + else + panic(KERN_WARNING "REISERFS panic: %s%s%s: %s\n", + id ? id : "", id ? " " : "", function, error_buf); } void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...) @@ -681,12 +688,10 @@ static void check_leaf_block_head(struct buffer_head *bh) blkh = B_BLK_HEAD(bh); nr = blkh_nr_item(blkh); if (nr > (bh->b_size - BLKH_SIZE) / IH_SIZE) - reiserfs_panic(NULL, - "vs-6010: check_leaf_block_head: invalid item number %z", + reiserfs_panic(NULL, "vs-6010", "invalid item number %z", bh); if (blkh_free_space(blkh) > bh->b_size - BLKH_SIZE - IH_SIZE * nr) - reiserfs_panic(NULL, - "vs-6020: check_leaf_block_head: invalid free space %z", + reiserfs_panic(NULL, "vs-6020", "invalid free space %z", bh); } @@ -697,21 +702,15 @@ static void check_internal_block_head(struct buffer_head *bh) blkh = B_BLK_HEAD(bh); if (!(B_LEVEL(bh) > DISK_LEAF_NODE_LEVEL && B_LEVEL(bh) <= MAX_HEIGHT)) - reiserfs_panic(NULL, - "vs-6025: check_internal_block_head: invalid level %z", - bh); + reiserfs_panic(NULL, "vs-6025", "invalid level %z", bh); if (B_NR_ITEMS(bh) > (bh->b_size - BLKH_SIZE) / IH_SIZE) - reiserfs_panic(NULL, - "vs-6030: check_internal_block_head: invalid item number %z", - bh); + reiserfs_panic(NULL, "vs-6030", "invalid item number %z", bh); if (B_FREE_SPACE(bh) != bh->b_size - BLKH_SIZE - KEY_SIZE * B_NR_ITEMS(bh) - DC_SIZE * (B_NR_ITEMS(bh) + 1)) - reiserfs_panic(NULL, - "vs-6040: check_internal_block_head: invalid free space %z", - bh); + reiserfs_panic(NULL, "vs-6040", "invalid free space %z", bh); } diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index f328d27a19d5..2de1e309124b 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -366,9 +366,8 @@ inline void decrement_bcount(struct buffer_head *p_s_bh) put_bh(p_s_bh); return; } - reiserfs_panic(NULL, - "PAP-5070: decrement_bcount: trying to free free buffer %b", - p_s_bh); + reiserfs_panic(NULL, "PAP-5070", + "trying to free free buffer %b", p_s_bh); } } @@ -713,8 +712,8 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* #ifdef CONFIG_REISERFS_CHECK if (cur_tb) { print_cur_tb("5140"); - reiserfs_panic(p_s_sb, - "PAP-5140: search_by_key: schedule occurred in do_balance!"); + reiserfs_panic(p_s_sb, "PAP-5140", + "schedule occurred in do_balance!"); } #endif @@ -1511,8 +1510,8 @@ static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th, /* look for the last byte of the tail */ if (search_for_position_by_key(inode->i_sb, &tail_key, path) == POSITION_NOT_FOUND) - reiserfs_panic(inode->i_sb, - "vs-5615: indirect_to_direct_roll_back: found invalid item"); + reiserfs_panic(inode->i_sb, "vs-5615", + "found invalid item"); RFALSE(path->pos_in_item != ih_item_len(PATH_PITEM_HEAD(path)) - 1, "vs-5616: appended bytes found"); @@ -1612,8 +1611,8 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, print_block(PATH_PLAST_BUFFER(p_s_path), 3, PATH_LAST_POSITION(p_s_path) - 1, PATH_LAST_POSITION(p_s_path) + 1); - reiserfs_panic(p_s_sb, - "PAP-5580: reiserfs_cut_from_item: item to convert does not exist (%K)", + reiserfs_panic(p_s_sb, "PAP-5580", "item to " + "convert does not exist (%K)", p_s_item_key); } continue; @@ -1693,22 +1692,20 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, sure, that we exactly remove last unformatted node pointer of the item */ if (!is_indirect_le_ih(le_ih)) - reiserfs_panic(p_s_sb, - "vs-5652: reiserfs_cut_from_item: " + reiserfs_panic(p_s_sb, "vs-5652", "item must be indirect %h", le_ih); if (c_mode == M_DELETE && ih_item_len(le_ih) != UNFM_P_SIZE) - reiserfs_panic(p_s_sb, - "vs-5653: reiserfs_cut_from_item: " - "completing indirect2direct conversion indirect item %h " - "being deleted must be of 4 byte long", - le_ih); + reiserfs_panic(p_s_sb, "vs-5653", "completing " + "indirect2direct conversion indirect " + "item %h being deleted must be of " + "4 byte long", le_ih); if (c_mode == M_CUT && s_cut_balance.insert_size[0] != -UNFM_P_SIZE) { - reiserfs_panic(p_s_sb, - "vs-5654: reiserfs_cut_from_item: " - "can not complete indirect2direct conversion of %h (CUT, insert_size==%d)", + reiserfs_panic(p_s_sb, "vs-5654", "can not complete " + "indirect2direct conversion of %h " + "(CUT, insert_size==%d)", le_ih, s_cut_balance.insert_size[0]); } /* it would be useful to make sure, that right neighboring @@ -1923,10 +1920,10 @@ static void check_research_for_paste(struct treepath *path, || op_bytes_number(found_ih, get_last_bh(path)->b_size) != pos_in_item(path)) - reiserfs_panic(NULL, - "PAP-5720: check_research_for_paste: " - "found direct item %h or position (%d) does not match to key %K", - found_ih, pos_in_item(path), p_s_key); + reiserfs_panic(NULL, "PAP-5720", "found direct item " + "%h or position (%d) does not match " + "to key %K", found_ih, + pos_in_item(path), p_s_key); } if (is_indirect_le_ih(found_ih)) { if (le_ih_k_offset(found_ih) + @@ -1935,9 +1932,9 @@ static void check_research_for_paste(struct treepath *path, cpu_key_k_offset(p_s_key) || I_UNFM_NUM(found_ih) != pos_in_item(path) || get_ih_free_space(found_ih) != 0) - reiserfs_panic(NULL, - "PAP-5730: check_research_for_paste: " - "found indirect item (%h) or position (%d) does not match to key (%K)", + reiserfs_panic(NULL, "PAP-5730", "found indirect " + "item (%h) or position (%d) does not " + "match to key (%K)", found_ih, pos_in_item(path), p_s_key); } } diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c index 256285dddb20..f8449cb74b53 100644 --- a/fs/reiserfs/tail_conversion.c +++ b/fs/reiserfs/tail_conversion.c @@ -92,8 +92,7 @@ int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode, last item of the file */ if (search_for_position_by_key(sb, &end_key, path) == POSITION_FOUND) - reiserfs_panic(sb, - "PAP-14050: direct2indirect: " + reiserfs_panic(sb, "PAP-14050", "direct item (%K) not found", &end_key); p_le_ih = PATH_PITEM_HEAD(path); RFALSE(!is_direct_le_ih(p_le_ih), @@ -214,8 +213,7 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in /* re-search indirect item */ if (search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path) == POSITION_NOT_FOUND) - reiserfs_panic(p_s_sb, - "PAP-5520: indirect2direct: " + reiserfs_panic(p_s_sb, "PAP-5520", "item to be converted %K does not exist", p_s_item_key); copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path)); @@ -224,8 +222,8 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in (ih_item_len(&s_ih) / UNFM_P_SIZE - 1) * p_s_sb->s_blocksize; if (pos != pos1) - reiserfs_panic(p_s_sb, "vs-5530: indirect2direct: " - "tail position changed while we were reading it"); + reiserfs_panic(p_s_sb, "vs-5530", "tail position " + "changed while we were reading it"); #endif } 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, /* assertions handling */ /** always check a condition and panic if it's false. */ -#define __RASSERT( cond, scond, format, args... ) \ -if( !( cond ) ) \ - reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ - __FILE__ ":%i:%s: " format "\n", \ - in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __func__ , ##args ) +#define __RASSERT(cond, scond, format, args...) \ +do { \ + if (!(cond)) \ + reiserfs_panic(NULL, "assertion failure", "(" #cond ") at " \ + __FILE__ ":%i:%s: " format "\n", \ + in_interrupt() ? -1 : task_pid_nr(current), \ + __LINE__, __func__ , ##args); \ +} while (0) #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) @@ -1448,6 +1451,16 @@ struct buffer_info { int bi_position; }; +static inline struct super_block *sb_from_tb(struct tree_balance *tb) +{ + return tb ? tb->tb_sb : NULL; +} + +static inline struct super_block *sb_from_bi(struct buffer_info *bi) +{ + return bi ? sb_from_tb(bi->tb) : NULL; +} + /* there are 4 types of items: stat data, directory item, indirect, direct. +-------------------+------------+--------------+------------+ | | k_offset | k_uniqueness | mergeable? | @@ -1988,8 +2001,11 @@ int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, void unfix_nodes(struct tree_balance *); /* prints.c */ -void reiserfs_panic(struct super_block *s, const char *fmt, ...) +void __reiserfs_panic(struct super_block *s, const char *id, + const char *function, const char *fmt, ...) __attribute__ ((noreturn)); +#define reiserfs_panic(s, id, fmt, args...) \ + __reiserfs_panic(s, id, __func__, fmt, ##args) void reiserfs_info(struct super_block *s, const char *fmt, ...); void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...); void print_indirect_item(struct buffer_head *bh, int item_num); -- cgit v1.2.3-59-g8ed1b From 0030b64570c862f04c1550ba4a0bf7a9c128162a Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Mon, 30 Mar 2009 14:02:28 -0400 Subject: reiserfs: use reiserfs_error() This patch makes many paths that are currently using warnings to handle the error. Signed-off-by: Jeff Mahoney Signed-off-by: Linus Torvalds --- fs/reiserfs/bitmap.c | 56 ++++++++++++++++++++++--------------------- fs/reiserfs/inode.c | 45 ++++++++++++++++------------------ fs/reiserfs/lbalance.c | 20 ++++++++-------- fs/reiserfs/namei.c | 24 +++++++++---------- fs/reiserfs/objectid.c | 4 ++-- fs/reiserfs/stree.c | 26 ++++++++++---------- fs/reiserfs/super.c | 15 ++++++------ fs/reiserfs/tail_conversion.c | 6 ++--- fs/reiserfs/xattr.c | 21 ++++++++-------- 9 files changed, 107 insertions(+), 110 deletions(-) (limited to 'fs/reiserfs/lbalance.c') diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index 51b116103041..9fc228703ef0 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c @@ -64,9 +64,9 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value) unsigned int bmap_count = reiserfs_bmap_count(s); if (block == 0 || block >= SB_BLOCK_COUNT(s)) { - reiserfs_warning(s, "vs-4010", - "block number is out of range %lu (%u)", - block, SB_BLOCK_COUNT(s)); + reiserfs_error(s, "vs-4010", + "block number is out of range %lu (%u)", + block, SB_BLOCK_COUNT(s)); return 0; } @@ -79,30 +79,30 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value) b_blocknr_t bmap1 = REISERFS_SB(s)->s_sbh->b_blocknr + 1; if (block >= bmap1 && block <= bmap1 + bmap_count) { - reiserfs_warning(s, "vs-4019", "bitmap block %lu(%u) " - "can't be freed or reused", - block, bmap_count); + reiserfs_error(s, "vs-4019", "bitmap block %lu(%u) " + "can't be freed or reused", + block, bmap_count); return 0; } } else { if (offset == 0) { - reiserfs_warning(s, "vs-4020", "bitmap block %lu(%u) " - "can't be freed or reused", - block, bmap_count); + reiserfs_error(s, "vs-4020", "bitmap block %lu(%u) " + "can't be freed or reused", + block, bmap_count); return 0; } } if (bmap >= bmap_count) { - reiserfs_warning(s, "vs-4030", "bitmap for requested block " - "is out of range: block=%lu, bitmap_nr=%u", - block, bmap); + reiserfs_error(s, "vs-4030", "bitmap for requested block " + "is out of range: block=%lu, bitmap_nr=%u", + block, bmap); return 0; } if (bit_value == 0 && block == SB_ROOT_BLOCK(s)) { - reiserfs_warning(s, "vs-4050", "this is root block (%u), " - "it must be busy", SB_ROOT_BLOCK(s)); + reiserfs_error(s, "vs-4050", "this is root block (%u), " + "it must be busy", SB_ROOT_BLOCK(s)); return 0; } @@ -153,8 +153,8 @@ static int scan_bitmap_block(struct reiserfs_transaction_handle *th, /* - I mean `a window of zero bits' as in description of this function - Zam. */ if (!bi) { - reiserfs_warning(s, "jdm-4055", "NULL bitmap info pointer " - "for bitmap %d", bmap_n); + reiserfs_error(s, "jdm-4055", "NULL bitmap info pointer " + "for bitmap %d", bmap_n); return 0; } @@ -399,8 +399,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th, get_bit_address(s, block, &nr, &offset); if (nr >= reiserfs_bmap_count(s)) { - reiserfs_warning(s, "vs-4075", "block %lu is out of range", - block); + reiserfs_error(s, "vs-4075", "block %lu is out of range", + block); return; } @@ -412,8 +412,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th, /* clear bit for the given block in bit map */ if (!reiserfs_test_and_clear_le_bit(offset, bmbh->b_data)) { - reiserfs_warning(s, "vs-4080", - "block %lu: bit already cleared", block); + reiserfs_error(s, "vs-4080", + "block %lu: bit already cleared", block); } apbi[nr].free_count++; journal_mark_dirty(th, s, bmbh); @@ -440,7 +440,7 @@ void reiserfs_free_block(struct reiserfs_transaction_handle *th, return; if (block > sb_block_count(REISERFS_SB(s)->s_rs)) { - reiserfs_panic(th->t_super, "bitmap-4072", + reiserfs_error(th->t_super, "bitmap-4072", "Trying to free block outside file system " "boundaries (%lu > %lu)", block, sb_block_count(REISERFS_SB(s)->s_rs)); @@ -472,8 +472,8 @@ static void __discard_prealloc(struct reiserfs_transaction_handle *th, BUG_ON(!th->t_trans_id); #ifdef CONFIG_REISERFS_CHECK if (ei->i_prealloc_count < 0) - reiserfs_warning(th->t_super, "zam-4001", - "inode has negative prealloc blocks count."); + reiserfs_error(th->t_super, "zam-4001", + "inode has negative prealloc blocks count."); #endif while (ei->i_prealloc_count > 0) { reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block); @@ -509,9 +509,9 @@ void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th) i_prealloc_list); #ifdef CONFIG_REISERFS_CHECK if (!ei->i_prealloc_count) { - reiserfs_warning(th->t_super, "zam-4001", - "inode is in prealloc list but has " - "no preallocated blocks."); + reiserfs_error(th->t_super, "zam-4001", + "inode is in prealloc list but has " + "no preallocated blocks."); } #endif __discard_prealloc(th, ei); @@ -1213,7 +1213,9 @@ void reiserfs_cache_bitmap_metadata(struct super_block *sb, unsigned long *cur = (unsigned long *)(bh->b_data + bh->b_size); /* The first bit must ALWAYS be 1 */ - BUG_ON(!reiserfs_test_le_bit(0, (unsigned long *)bh->b_data)); + if (!reiserfs_test_le_bit(0, (unsigned long *)bh->b_data)) + reiserfs_error(sb, "reiserfs-2025", "bitmap block %lu is " + "corrupted: first bit must be 1", bh->b_blocknr); info->free_count = 0; diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 7ee0097004c0..fab0373ad6e3 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -841,12 +841,12 @@ int reiserfs_get_block(struct inode *inode, sector_t block, tail_offset); if (retval) { if (retval != -ENOSPC) - reiserfs_warning(inode->i_sb, - "clm-6004", - "convert tail failed " - "inode %lu, error %d", - inode->i_ino, - retval); + reiserfs_error(inode->i_sb, + "clm-6004", + "convert tail failed " + "inode %lu, error %d", + inode->i_ino, + retval); if (allocated_block_nr) { /* the bitmap, the super, and the stat data == 3 */ if (!th) @@ -1332,10 +1332,9 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, /* look for the object's stat data */ retval = search_item(inode->i_sb, &key, &path); if (retval == IO_ERROR) { - reiserfs_warning(inode->i_sb, "vs-13050", - "i/o failure occurred trying to " - "update %K stat data", - &key); + reiserfs_error(inode->i_sb, "vs-13050", + "i/o failure occurred trying to " + "update %K stat data", &key); return; } if (retval == ITEM_NOT_FOUND) { @@ -1424,9 +1423,9 @@ void reiserfs_read_locked_inode(struct inode *inode, /* look for the object's stat data */ retval = search_item(inode->i_sb, &key, &path_to_sd); if (retval == IO_ERROR) { - reiserfs_warning(inode->i_sb, "vs-13070", - "i/o failure occurred trying to find " - "stat data of %K", &key); + reiserfs_error(inode->i_sb, "vs-13070", + "i/o failure occurred trying to find " + "stat data of %K", &key); reiserfs_make_bad_inode(inode); return; } @@ -1678,8 +1677,8 @@ static int reiserfs_new_directory(struct reiserfs_transaction_handle *th, /* look for place in the tree for new item */ retval = search_item(sb, &key, path); if (retval == IO_ERROR) { - reiserfs_warning(sb, "vs-13080", - "i/o failure occurred creating new directory"); + reiserfs_error(sb, "vs-13080", + "i/o failure occurred creating new directory"); return -EIO; } if (retval == ITEM_FOUND) { @@ -1718,8 +1717,8 @@ static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct i /* look for place in the tree for new item */ retval = search_item(sb, &key, path); if (retval == IO_ERROR) { - reiserfs_warning(sb, "vs-13080", - "i/o failure occurred creating new symlink"); + reiserfs_error(sb, "vs-13080", + "i/o failure occurred creating new symlink"); return -EIO; } if (retval == ITEM_FOUND) { @@ -2043,10 +2042,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 ** call prepare_write */ - reiserfs_warning(p_s_inode->i_sb, "clm-6000", - "error reading block %lu on dev %s", - bh->b_blocknr, - reiserfs_bdevname(p_s_inode->i_sb)); + reiserfs_error(p_s_inode->i_sb, "clm-6000", + "error reading block %lu", bh->b_blocknr); error = -EIO; goto unlock; } @@ -2088,9 +2085,9 @@ int reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) // and get_block_create_0 could not find a block to read in, // which is ok. if (error != -ENOENT) - reiserfs_warning(p_s_inode->i_sb, "clm-6001", - "grab_tail_page failed %d", - error); + reiserfs_error(p_s_inode->i_sb, "clm-6001", + "grab_tail_page failed %d", + error); page = NULL; bh = NULL; } diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c index 67f1d1de213d..21a171ceba1d 100644 --- a/fs/reiserfs/lbalance.c +++ b/fs/reiserfs/lbalance.c @@ -1291,17 +1291,17 @@ void leaf_paste_entries(struct buffer_info *bi, prev = (i != 0) ? deh_location(&(deh[i - 1])) : 0; if (prev && prev <= deh_location(&(deh[i]))) - reiserfs_warning(NULL, "vs-10240", - "directory item (%h) " - "corrupted (prev %a, " - "cur(%d) %a)", - ih, deh + i - 1, i, deh + i); + reiserfs_error(sb_from_bi(bi), "vs-10240", + "directory item (%h) " + "corrupted (prev %a, " + "cur(%d) %a)", + ih, deh + i - 1, i, deh + i); if (next && next >= deh_location(&(deh[i]))) - reiserfs_warning(NULL, "vs-10250", - "directory item (%h) " - "corrupted (cur(%d) %a, " - "next %a)", - ih, i, deh + i, deh + i + 1); + reiserfs_error(sb_from_bi(bi), "vs-10250", + "directory item (%h) " + "corrupted (cur(%d) %a, " + "next %a)", + ih, i, deh + i, deh + i + 1); } } #endif diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index ef41cc882bd9..3ce3f8b1690d 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -120,8 +120,8 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, switch (retval) { case ITEM_NOT_FOUND: if (!PATH_LAST_POSITION(path)) { - reiserfs_warning(sb, "vs-7000", "search_by_key " - "returned item position == 0"); + reiserfs_error(sb, "vs-7000", "search_by_key " + "returned item position == 0"); pathrelse(path); return IO_ERROR; } @@ -135,7 +135,7 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, default: pathrelse(path); - reiserfs_warning(sb, "vs-7002", "no path to here"); + reiserfs_error(sb, "vs-7002", "no path to here"); return IO_ERROR; } @@ -298,7 +298,7 @@ static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen, search_by_entry_key(dir->i_sb, &key_to_search, path_to_entry, de); if (retval == IO_ERROR) { - reiserfs_warning(dir->i_sb, "zam-7001", "io error"); + reiserfs_error(dir->i_sb, "zam-7001", "io error"); return IO_ERROR; } @@ -481,9 +481,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, } if (retval != NAME_FOUND) { - reiserfs_warning(dir->i_sb, "zam-7002", - "reiserfs_find_entry() returned " - "unexpected value (%d)", retval); + reiserfs_error(dir->i_sb, "zam-7002", + "reiserfs_find_entry() returned " + "unexpected value (%d)", retval); } return -EEXIST; @@ -899,9 +899,9 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) goto end_rmdir; if (inode->i_nlink != 2 && inode->i_nlink != 1) - reiserfs_warning(inode->i_sb, "reiserfs-7040", - "empty directory has nlink != 2 (%d)", - inode->i_nlink); + reiserfs_error(inode->i_sb, "reiserfs-7040", + "empty directory has nlink != 2 (%d)", + inode->i_nlink); clear_nlink(inode); inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; @@ -1494,8 +1494,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, if (reiserfs_cut_from_item (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL, 0) < 0) - reiserfs_warning(old_dir->i_sb, "vs-7060", - "couldn't not cut old name. Fsck later?"); + reiserfs_error(old_dir->i_sb, "vs-7060", + "couldn't not cut old name. Fsck later?"); old_dir->i_size -= DEH_SIZE + old_de.de_entrylen; diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c index 90e4e52f857b..d2d6b5650188 100644 --- a/fs/reiserfs/objectid.c +++ b/fs/reiserfs/objectid.c @@ -159,8 +159,8 @@ void reiserfs_release_objectid(struct reiserfs_transaction_handle *th, i += 2; } - reiserfs_warning(s, "vs-15011", "tried to free free object id (%lu)", - (long unsigned)objectid_to_release); + reiserfs_error(s, "vs-15011", "tried to free free object id (%lu)", + (long unsigned)objectid_to_release); } int reiserfs_convert_objectid_map_v1(struct super_block *s) diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 2de1e309124b..ec837a250a4f 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -720,9 +720,9 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* // make sure, that the node contents look like a node of // certain level if (!is_tree_node(p_s_bh, expected_level)) { - reiserfs_warning(p_s_sb, "vs-5150", - "invalid format found in block %ld. " - "Fsck?", p_s_bh->b_blocknr); + reiserfs_error(p_s_sb, "vs-5150", + "invalid format found in block %ld. " + "Fsck?", p_s_bh->b_blocknr); pathrelse(p_s_search_path); return IO_ERROR; } @@ -1336,9 +1336,9 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, while (1) { retval = search_item(th->t_super, &cpu_key, &path); if (retval == IO_ERROR) { - reiserfs_warning(th->t_super, "vs-5350", - "i/o failure occurred trying " - "to delete %K", &cpu_key); + reiserfs_error(th->t_super, "vs-5350", + "i/o failure occurred trying " + "to delete %K", &cpu_key); break; } if (retval != ITEM_FOUND) { @@ -1737,7 +1737,7 @@ static void truncate_directory(struct reiserfs_transaction_handle *th, { BUG_ON(!th->t_trans_id); if (inode->i_nlink) - reiserfs_warning(inode->i_sb, "vs-5655", "link count != 0"); + reiserfs_error(inode->i_sb, "vs-5655", "link count != 0"); set_le_key_k_offset(KEY_FORMAT_3_5, INODE_PKEY(inode), DOT_OFFSET); set_le_key_k_type(KEY_FORMAT_3_5, INODE_PKEY(inode), TYPE_DIRENTRY); @@ -1790,16 +1790,16 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p search_for_position_by_key(p_s_inode->i_sb, &s_item_key, &s_search_path); if (retval == IO_ERROR) { - reiserfs_warning(p_s_inode->i_sb, "vs-5657", - "i/o failure occurred trying to truncate %K", - &s_item_key); + reiserfs_error(p_s_inode->i_sb, "vs-5657", + "i/o failure occurred trying to truncate %K", + &s_item_key); err = -EIO; goto out; } if (retval == POSITION_FOUND || retval == FILE_NOT_FOUND) { - reiserfs_warning(p_s_inode->i_sb, "PAP-5660", - "wrong result %d of search for %K", retval, - &s_item_key); + reiserfs_error(p_s_inode->i_sb, "PAP-5660", + "wrong result %d of search for %K", retval, + &s_item_key); err = -EIO; goto out; diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index bfc276c8e978..fc7cb4661ee0 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -195,9 +195,8 @@ static int finish_unfinished(struct super_block *s) while (!retval) { retval = search_item(s, &max_cpu_key, &path); if (retval != ITEM_NOT_FOUND) { - reiserfs_warning(s, "vs-2140", - "search_by_key returned %d", - retval); + reiserfs_error(s, "vs-2140", + "search_by_key returned %d", retval); break; } @@ -378,9 +377,9 @@ void add_save_link(struct reiserfs_transaction_handle *th, retval = search_item(inode->i_sb, &key, &path); if (retval != ITEM_NOT_FOUND) { if (retval != -ENOSPC) - reiserfs_warning(inode->i_sb, "vs-2100", - "search_by_key (%K) returned %d", &key, - retval); + reiserfs_error(inode->i_sb, "vs-2100", + "search_by_key (%K) returned %d", &key, + retval); pathrelse(&path); return; } @@ -393,8 +392,8 @@ void add_save_link(struct reiserfs_transaction_handle *th, reiserfs_insert_item(th, &path, &key, &ih, NULL, (char *)&link); if (retval) { if (retval != -ENOSPC) - reiserfs_warning(inode->i_sb, "vs-2120", - "insert_item returned %d", retval); + reiserfs_error(inode->i_sb, "vs-2120", + "insert_item returned %d", retval); } else { if (truncate) REISERFS_I(inode)->i_flags |= diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c index f8449cb74b53..083f74435f65 100644 --- a/fs/reiserfs/tail_conversion.c +++ b/fs/reiserfs/tail_conversion.c @@ -48,9 +48,9 @@ int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode, // FIXME: we could avoid this if (search_for_position_by_key(sb, &end_key, path) == POSITION_FOUND) { - reiserfs_warning(sb, "PAP-14030", - "pasted or inserted byte exists in " - "the tree %K. Use fsck to repair.", &end_key); + reiserfs_error(sb, "PAP-14030", + "pasted or inserted byte exists in " + "the tree %K. Use fsck to repair.", &end_key); pathrelse(path); return -EIO; } diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index d14f5c2c0e4a..bab77fe5f177 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -259,8 +259,8 @@ static int __xattr_readdir(struct inode *inode, void *dirent, filldir_t filldir) ih = de.de_ih; if (!is_direntry_le_ih(ih)) { - reiserfs_warning(inode->i_sb, "jdm-20000", - "not direntry %h", ih); + reiserfs_error(inode->i_sb, "jdm-20000", + "not direntry %h", ih); break; } copy_item_head(&tmp_ih, ih); @@ -653,15 +653,14 @@ __reiserfs_xattr_del(struct dentry *xadir, const char *name, int namelen) goto out_file; if (!is_reiserfs_priv_object(dentry->d_inode)) { - reiserfs_warning(dir->i_sb, "jdm-20003", - "OID %08x [%.*s/%.*s] doesn't have " - "priv flag set [parent is %sset].", - le32_to_cpu(INODE_PKEY(dentry->d_inode)-> - k_objectid), xadir->d_name.len, - xadir->d_name.name, namelen, name, - is_reiserfs_priv_object(xadir-> - d_inode) ? "" : - "not "); + reiserfs_error(dir->i_sb, "jdm-20003", + "OID %08x [%.*s/%.*s] doesn't have " + "priv flag set [parent is %sset].", + le32_to_cpu(INODE_PKEY(dentry->d_inode)-> + k_objectid), xadir->d_name.len, + xadir->d_name.name, namelen, name, + is_reiserfs_priv_object(xadir->d_inode) ? "" : + "not "); dput(dentry); return -EIO; } -- cgit v1.2.3-59-g8ed1b From 0222e6571c332563a48d4cf5487b67feabe60b5e Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Mon, 30 Mar 2009 14:02:44 -0400 Subject: reiserfs: strip trailing whitespace This patch strips trailing whitespace from the reiserfs code. Signed-off-by: Jeff Mahoney Signed-off-by: Linus Torvalds --- fs/reiserfs/README | 4 +- fs/reiserfs/do_balan.c | 14 ++--- fs/reiserfs/file.c | 8 +-- fs/reiserfs/fix_node.c | 38 ++++++------- fs/reiserfs/hashes.c | 2 +- fs/reiserfs/ibalance.c | 10 ++-- fs/reiserfs/inode.c | 52 +++++++++--------- fs/reiserfs/ioctl.c | 2 +- fs/reiserfs/journal.c | 120 ++++++++++++++++++++--------------------- fs/reiserfs/lbalance.c | 18 +++---- fs/reiserfs/namei.c | 30 +++++------ fs/reiserfs/objectid.c | 2 +- fs/reiserfs/prints.c | 26 ++++----- fs/reiserfs/procfs.c | 2 +- fs/reiserfs/resize.c | 6 +-- fs/reiserfs/stree.c | 8 +-- fs/reiserfs/super.c | 10 ++-- fs/reiserfs/tail_conversion.c | 2 +- include/linux/reiserfs_fs_sb.h | 14 ++--- 19 files changed, 184 insertions(+), 184 deletions(-) (limited to 'fs/reiserfs/lbalance.c') diff --git a/fs/reiserfs/README b/fs/reiserfs/README index 90e1670e4e6f..14e8c9d460e5 100644 --- a/fs/reiserfs/README +++ b/fs/reiserfs/README @@ -1,4 +1,4 @@ -[LICENSING] +[LICENSING] ReiserFS is hereby licensed under the GNU General Public License version 2. @@ -31,7 +31,7 @@ the GPL as not allowing those additional licensing options, you read it wrongly, and Richard Stallman agrees with me, when carefully read you can see that those restrictions on additional terms do not apply to the owner of the copyright, and my interpretation of this shall -govern for this license. +govern for this license. Finally, nothing in this license shall be interpreted to allow you to fail to fairly credit me, or to remove my credits, without my diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c index 723a7f4011d0..4beb964a2a3e 100644 --- a/fs/reiserfs/do_balan.c +++ b/fs/reiserfs/do_balan.c @@ -76,21 +76,21 @@ inline void do_balance_mark_leaf_dirty(struct tree_balance *tb, #define do_balance_mark_internal_dirty do_balance_mark_leaf_dirty #define do_balance_mark_sb_dirty do_balance_mark_leaf_dirty -/* summary: +/* summary: if deleting something ( tb->insert_size[0] < 0 ) return(balance_leaf_when_delete()); (flag d handled here) else if lnum is larger than 0 we put items into the left node if rnum is larger than 0 we put items into the right node if snum1 is larger than 0 we put items into the new node s1 - if snum2 is larger than 0 we put items into the new node s2 + if snum2 is larger than 0 we put items into the new node s2 Note that all *num* count new items being created. It would be easier to read balance_leaf() if each of these summary lines was a separate procedure rather than being inlined. I think that there are many passages here and in balance_leaf_when_delete() in which two calls to one procedure can replace two passages, and it -might save cache space and improve software maintenance costs to do so. +might save cache space and improve software maintenance costs to do so. Vladimir made the perceptive comment that we should offload most of the decision making in this function into fix_nodes/check_balance, and @@ -288,15 +288,15 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h ) { struct buffer_head *tbS0 = PATH_PLAST_BUFFER(tb->tb_path); - int item_pos = PATH_LAST_POSITION(tb->tb_path); /* index into the array of item headers in S[0] + int item_pos = PATH_LAST_POSITION(tb->tb_path); /* index into the array of item headers in S[0] of the affected item */ struct buffer_info bi; struct buffer_head *S_new[2]; /* new nodes allocated to hold what could not fit into S */ int snum[2]; /* number of items that will be placed into S_new (includes partially shifted items) */ - int sbytes[2]; /* if an item is partially shifted into S_new then - if it is a directory item + int sbytes[2]; /* if an item is partially shifted into S_new then + if it is a directory item it is the number of entries from the item that are shifted into S_new else it is the number of bytes from the item that are shifted into S_new @@ -1983,7 +1983,7 @@ static inline void do_balance_starts(struct tree_balance *tb) /* store_print_tb (tb); */ /* do not delete, just comment it out */ -/* print_tb(flag, PATH_LAST_POSITION(tb->tb_path), tb->tb_path->pos_in_item, tb, +/* print_tb(flag, PATH_LAST_POSITION(tb->tb_path), tb->tb_path->pos_in_item, tb, "check");*/ RFALSE(check_before_balancing(tb), "PAP-12340: locked buffers in TB"); #ifdef CONFIG_REISERFS_CHECK diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 47bab8978be1..f0160ee03e17 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c @@ -20,14 +20,14 @@ ** insertion/balancing, for files that are written in one write. ** It avoids unnecessary tail packings (balances) for files that are written in ** multiple writes and are small enough to have tails. -** +** ** file_release is called by the VFS layer when the file is closed. If ** this is the last open file descriptor, and the file ** small enough to have a tail, and the tail is currently in an ** unformatted node, the tail is converted back into a direct item. -** +** ** We use reiserfs_truncate_file to pack the tail, since it already has -** all the conditions coded. +** all the conditions coded. */ static int reiserfs_file_release(struct inode *inode, struct file *filp) { @@ -223,7 +223,7 @@ int reiserfs_commit_page(struct inode *inode, struct page *page, } /* Write @count bytes at position @ppos in a file indicated by @file - from the buffer @buf. + from the buffer @buf. generic_file_write() is only appropriate for filesystems that are not seeking to optimize performance and want something simple that works. It is not for serious use by general purpose filesystems, excepting the one that it was diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c index aee50c97988d..a3be7da3e2b9 100644 --- a/fs/reiserfs/fix_node.c +++ b/fs/reiserfs/fix_node.c @@ -30,8 +30,8 @@ ** get_direct_parent ** get_neighbors ** fix_nodes - ** - ** + ** + ** **/ #include @@ -377,9 +377,9 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h, int needed_nodes; int start_item, /* position of item we start filling node from */ end_item, /* position of item we finish filling node by */ - start_bytes, /* number of first bytes (entries for directory) of start_item-th item + start_bytes, /* number of first bytes (entries for directory) of start_item-th item we do not include into node that is being filled */ - end_bytes; /* number of last bytes (entries for directory) of end_item-th item + end_bytes; /* number of last bytes (entries for directory) of end_item-th item we do node include into node that is being filled */ int split_item_positions[2]; /* these are positions in virtual item of items, that are split between S[0] and @@ -569,7 +569,7 @@ extern struct tree_balance *cur_tb; /* Set parameters for balancing. * Performs write of results of analysis of balancing into structure tb, - * where it will later be used by the functions that actually do the balancing. + * where it will later be used by the functions that actually do the balancing. * Parameters: * tb tree_balance structure; * h current level of the node; @@ -1204,7 +1204,7 @@ static inline int can_node_be_removed(int mode, int lfree, int sfree, int rfree, * h current level of the node; * inum item number in S[h]; * mode i - insert, p - paste; - * Returns: 1 - schedule occurred; + * Returns: 1 - schedule occurred; * 0 - balancing for higher levels needed; * -1 - no balancing for higher levels needed; * -2 - no disk space. @@ -1239,7 +1239,7 @@ static int ip_check_balance(struct tree_balance *tb, int h) /* we perform 8 calls to get_num_ver(). For each call we calculate five parameters. where 4th parameter is s1bytes and 5th - s2bytes */ - short snum012[40] = { 0, }; /* s0num, s1num, s2num for 8 cases + short snum012[40] = { 0, }; /* s0num, s1num, s2num for 8 cases 0,1 - do not shift and do not shift but bottle 2 - shift only whole item to left 3 - shift to left and bottle as much as possible @@ -1288,7 +1288,7 @@ static int ip_check_balance(struct tree_balance *tb, int h) create_virtual_node(tb, h); - /* + /* determine maximal number of items we can shift to the left neighbor (in tb structure) and the maximal number of bytes that can flow to the left neighbor from the left most liquid item that cannot be shifted from S[0] entirely (returned value) @@ -1349,13 +1349,13 @@ static int ip_check_balance(struct tree_balance *tb, int h) { int lpar, rpar, nset, lset, rset, lrset; - /* + /* * regular overflowing of the node */ - /* get_num_ver works in 2 modes (FLOW & NO_FLOW) + /* get_num_ver works in 2 modes (FLOW & NO_FLOW) lpar, rpar - number of items we can shift to left/right neighbor (including splitting item) - nset, lset, rset, lrset - shows, whether flowing items give better packing + nset, lset, rset, lrset - shows, whether flowing items give better packing */ #define FLOW 1 #define NO_FLOW 0 /* do not any splitting */ @@ -1545,7 +1545,7 @@ static int ip_check_balance(struct tree_balance *tb, int h) * h current level of the node; * inum item number in S[h]; * mode i - insert, p - paste; - * Returns: 1 - schedule occurred; + * Returns: 1 - schedule occurred; * 0 - balancing for higher levels needed; * -1 - no balancing for higher levels needed; * -2 - no disk space. @@ -1728,7 +1728,7 @@ static int dc_check_balance_internal(struct tree_balance *tb, int h) * h current level of the node; * inum item number in S[h]; * mode i - insert, p - paste; - * Returns: 1 - schedule occurred; + * Returns: 1 - schedule occurred; * 0 - balancing for higher levels needed; * -1 - no balancing for higher levels needed; * -2 - no disk space. @@ -1822,7 +1822,7 @@ static int dc_check_balance_leaf(struct tree_balance *tb, int h) * h current level of the node; * inum item number in S[h]; * mode d - delete, c - cut. - * Returns: 1 - schedule occurred; + * Returns: 1 - schedule occurred; * 0 - balancing for higher levels needed; * -1 - no balancing for higher levels needed; * -2 - no disk space. @@ -1851,7 +1851,7 @@ static int dc_check_balance(struct tree_balance *tb, int h) * h current level of the node; * inum item number in S[h]; * mode i - insert, p - paste, d - delete, c - cut. - * Returns: 1 - schedule occurred; + * Returns: 1 - schedule occurred; * 0 - balancing for higher levels needed; * -1 - no balancing for higher levels needed; * -2 - no disk space. @@ -2296,15 +2296,15 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *p_s_tb) * analyze what and where should be moved; * get sufficient number of new nodes; * Balancing will start only after all resources will be collected at a time. - * + * * When ported to SMP kernels, only at the last moment after all needed nodes * are collected in cache, will the resources be locked using the usual * textbook ordered lock acquisition algorithms. Note that ensuring that * this code neither write locks what it does not need to write lock nor locks out of order * will be a pain in the butt that could have been avoided. Grumble grumble. -Hans - * + * * fix is meant in the sense of render unchanging - * + * * Latency might be improved by first gathering a list of what buffers are needed * and then getting as many of them in parallel as possible? -Hans * @@ -2316,7 +2316,7 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *p_s_tb) * ins_ih & ins_sd are used when inserting * Returns: 1 - schedule occurred while the function worked; * 0 - schedule didn't occur while the function worked; - * -1 - if no_disk_space + * -1 - if no_disk_space */ int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, struct item_head *p_s_ins_ih, // item head of item being inserted diff --git a/fs/reiserfs/hashes.c b/fs/reiserfs/hashes.c index e664ac16fad9..6471c670743e 100644 --- a/fs/reiserfs/hashes.c +++ b/fs/reiserfs/hashes.c @@ -7,7 +7,7 @@ * (see Applied Cryptography, 2nd edition, p448). * * Jeremy Fitzhardinge 1998 - * + * * Jeremy has agreed to the contents of reiserfs/README. -Hans * Yura's function is added (04/07/2000) */ diff --git a/fs/reiserfs/ibalance.c b/fs/reiserfs/ibalance.c index 063b5514fe29..2074fd95046b 100644 --- a/fs/reiserfs/ibalance.c +++ b/fs/reiserfs/ibalance.c @@ -278,7 +278,7 @@ static void internal_delete_childs(struct buffer_info *cur_bi, int from, int n) /* copy cpy_num node pointers and cpy_num - 1 items from buffer src to buffer dest * last_first == FIRST_TO_LAST means, that we copy first items from src to tail of dest - * last_first == LAST_TO_FIRST means, that we copy last items from src to head of dest + * last_first == LAST_TO_FIRST means, that we copy last items from src to head of dest */ static void internal_copy_pointers_items(struct buffer_info *dest_bi, struct buffer_head *src, @@ -385,7 +385,7 @@ static void internal_move_pointers_items(struct buffer_info *dest_bi, if (last_first == FIRST_TO_LAST) { /* shift_left occurs */ first_pointer = 0; first_item = 0; - /* delete cpy_num - del_par pointers and keys starting for pointers with first_pointer, + /* delete cpy_num - del_par pointers and keys starting for pointers with first_pointer, for key - with first_item */ internal_delete_pointers_items(src_bi, first_pointer, first_item, cpy_num - del_par); @@ -453,7 +453,7 @@ static void internal_insert_key(struct buffer_info *dest_bi, int dest_position_b } } -/* Insert d_key'th (delimiting) key from buffer cfl to tail of dest. +/* Insert d_key'th (delimiting) key from buffer cfl to tail of dest. * Copy pointer_amount node pointers and pointer_amount - 1 items from buffer src to buffer dest. * Replace d_key'th key in buffer cfl. * Delete pointer_amount items and node pointers from buffer src. @@ -518,7 +518,7 @@ static void internal_shift1_left(struct tree_balance *tb, /* internal_move_pointers_items (tb->L[h], tb->S[h], FIRST_TO_LAST, pointer_amount, 1); */ } -/* Insert d_key'th (delimiting) key from buffer cfr to head of dest. +/* Insert d_key'th (delimiting) key from buffer cfr to head of dest. * Copy n node pointers and n - 1 items from buffer src to buffer dest. * Replace d_key'th key in buffer cfr. * Delete n items and node pointers from buffer src. @@ -749,7 +749,7 @@ int balance_internal(struct tree_balance *tb, /* tree_balance structure this means that new pointers and items must be inserted AFTER * child_pos } - else + else { it is the position of the leftmost pointer that must be deleted (together with its corresponding key to the left of the pointer) diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index fcd302d81447..d106edaef64f 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -52,7 +52,7 @@ void reiserfs_delete_inode(struct inode *inode) /* Do quota update inside a transaction for journaled quotas. We must do that * after delete_object so that quota updates go into the same transaction as * stat data deletion */ - if (!err) + if (!err) DQUOT_FREE_INODE(inode); if (journal_end(&th, inode->i_sb, jbegin_count)) @@ -363,7 +363,7 @@ static int _get_block_create_0(struct inode *inode, sector_t block, } /* make sure we don't read more bytes than actually exist in ** the file. This can happen in odd cases where i_size isn't - ** correct, and when direct item padding results in a few + ** correct, and when direct item padding results in a few ** extra bytes at the end of the direct item */ if ((le_ih_k_offset(ih) + path.pos_in_item) > inode->i_size) @@ -438,15 +438,15 @@ static int reiserfs_bmap(struct inode *inode, sector_t block, ** -ENOENT instead of a valid buffer. block_prepare_write expects to ** be able to do i/o on the buffers returned, unless an error value ** is also returned. -** +** ** So, this allows block_prepare_write to be used for reading a single block ** in a page. Where it does not produce a valid page for holes, or past the ** end of the file. This turns out to be exactly what we need for reading ** tails for conversion. ** ** The point of the wrapper is forcing a certain value for create, even -** though the VFS layer is calling this function with create==1. If you -** don't want to send create == GET_BLOCK_NO_HOLE to reiserfs_get_block, +** though the VFS layer is calling this function with create==1. If you +** don't want to send create == GET_BLOCK_NO_HOLE to reiserfs_get_block, ** don't use this function. */ static int reiserfs_get_block_create_0(struct inode *inode, sector_t block, @@ -602,7 +602,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block, int done; int fs_gen; struct reiserfs_transaction_handle *th = NULL; - /* space reserved in transaction batch: + /* space reserved in transaction batch: . 3 balancings in direct->indirect conversion . 1 block involved into reiserfs_update_sd() XXX in practically impossible worst case direct2indirect() @@ -754,7 +754,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block, reiserfs_write_unlock(inode->i_sb); /* the item was found, so new blocks were not added to the file - ** there is no need to make sure the inode is updated with this + ** there is no need to make sure the inode is updated with this ** transaction */ return retval; @@ -986,7 +986,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block, /* this loop could log more blocks than we had originally asked ** for. So, we have to allow the transaction to end if it is - ** too big or too full. Update the inode so things are + ** too big or too full. Update the inode so things are ** consistent if we crash before the function returns ** ** release the path so that anybody waiting on the path before @@ -997,7 +997,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block, if (retval) goto failure; } - /* inserting indirect pointers for a hole can take a + /* inserting indirect pointers for a hole can take a ** long time. reschedule if needed */ cond_resched(); @@ -1444,7 +1444,7 @@ void reiserfs_read_locked_inode(struct inode *inode, update sd on unlink all that is required is to check for nlink here. This bug was first found by Sizif when debugging SquidNG/Butterfly, forgotten, and found again after Philippe - Gramoulle reproduced it. + Gramoulle reproduced it. More logical fix would require changes in fs/inode.c:iput() to remove inode from hash-table _after_ fs cleaned disk stuff up and @@ -1619,7 +1619,7 @@ int reiserfs_write_inode(struct inode *inode, int do_sync) if (inode->i_sb->s_flags & MS_RDONLY) return -EROFS; /* memory pressure can sometimes initiate write_inode calls with sync == 1, - ** these cases are just when the system needs ram, not when the + ** these cases are just when the system needs ram, not when the ** inode needs to reach disk for safety, and they can safely be ** ignored because the altered inode has already been logged. */ @@ -1736,7 +1736,7 @@ static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct i /* inserts the stat data into the tree, and then calls reiserfs_new_directory (to insert ".", ".." item if new object is directory) or reiserfs_new_symlink (to insert symlink body if new - object is symlink) or nothing (if new object is regular file) + object is symlink) or nothing (if new object is regular file) NOTE! uid and gid must already be set in the inode. If we return non-zero due to an error, we have to drop the quota previously allocated @@ -1744,7 +1744,7 @@ static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct i if we return non-zero, we also end the transaction. */ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, struct inode *dir, int mode, const char *symname, - /* 0 for regular, EMTRY_DIR_SIZE for dirs, + /* 0 for regular, EMTRY_DIR_SIZE for dirs, strlen (symname) for symlinks) */ loff_t i_size, struct dentry *dentry, struct inode *inode, @@ -1794,7 +1794,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, goto out_bad_inode; } if (old_format_only(sb)) - /* not a perfect generation count, as object ids can be reused, but + /* not a perfect generation count, as object ids can be reused, but ** this is as good as reiserfs can do right now. ** note that the private part of inode isn't filled in yet, we have ** to use the directory. @@ -2081,7 +2081,7 @@ int reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) if (p_s_inode->i_size > 0) { if ((error = grab_tail_page(p_s_inode, &page, &bh))) { - // -ENOENT means we truncated past the end of the file, + // -ENOENT means we truncated past the end of the file, // and get_block_create_0 could not find a block to read in, // which is ok. if (error != -ENOENT) @@ -2093,11 +2093,11 @@ int reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) } } - /* so, if page != NULL, we have a buffer head for the offset at - ** the end of the file. if the bh is mapped, and bh->b_blocknr != 0, - ** then we have an unformatted node. Otherwise, we have a direct item, - ** and no zeroing is required on disk. We zero after the truncate, - ** because the truncate might pack the item anyway + /* so, if page != NULL, we have a buffer head for the offset at + ** the end of the file. if the bh is mapped, and bh->b_blocknr != 0, + ** then we have an unformatted node. Otherwise, we have a direct item, + ** and no zeroing is required on disk. We zero after the truncate, + ** because the truncate might pack the item anyway ** (it will unmap bh if it packs). */ /* it is enough to reserve space in transaction for 2 balancings: @@ -2306,8 +2306,8 @@ static int map_block_for_writepage(struct inode *inode, return retval; } -/* - * mason@suse.com: updated in 2.5.54 to follow the same general io +/* + * mason@suse.com: updated in 2.5.54 to follow the same general io * start/recovery path as __block_write_full_page, along with special * code to handle reiserfs tails. */ @@ -2447,7 +2447,7 @@ static int reiserfs_write_full_page(struct page *page, unlock_page(page); /* - * since any buffer might be the only dirty buffer on the page, + * since any buffer might be the only dirty buffer on the page, * the first submit_bh can bring the page out of writeback. * be careful with the buffers. */ @@ -2466,8 +2466,8 @@ static int reiserfs_write_full_page(struct page *page, if (nr == 0) { /* * if this page only had a direct item, it is very possible for - * no io to be required without there being an error. Or, - * someone else could have locked them and sent them down the + * no io to be required without there being an error. Or, + * someone else could have locked them and sent them down the * pipe without locking the page */ bh = head; @@ -2486,7 +2486,7 @@ static int reiserfs_write_full_page(struct page *page, fail: /* catches various errors, we need to make sure any valid dirty blocks - * get to the media. The page is currently locked and not marked for + * get to the media. The page is currently locked and not marked for * writeback */ ClearPageUptodate(page); diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index 830332021ed4..0ccc3fdda7bf 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c @@ -189,7 +189,7 @@ int reiserfs_unpack(struct inode *inode, struct file *filp) } /* we unpack by finding the page with the tail, and calling - ** reiserfs_prepare_write on that page. This will force a + ** reiserfs_prepare_write on that page. This will force a ** reiserfs_get_block to unpack the tail for us. */ index = inode->i_size >> PAGE_CACHE_SHIFT; diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index db91754cfb83..4f787462becc 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -1,36 +1,36 @@ /* ** Write ahead logging implementation copyright Chris Mason 2000 ** -** The background commits make this code very interelated, and +** The background commits make this code very interelated, and ** overly complex. I need to rethink things a bit....The major players: ** -** journal_begin -- call with the number of blocks you expect to log. +** journal_begin -- call with the number of blocks you expect to log. ** If the current transaction is too -** old, it will block until the current transaction is +** old, it will block until the current transaction is ** finished, and then start a new one. -** Usually, your transaction will get joined in with +** Usually, your transaction will get joined in with ** previous ones for speed. ** -** journal_join -- same as journal_begin, but won't block on the current +** journal_join -- same as journal_begin, but won't block on the current ** transaction regardless of age. Don't ever call -** this. Ever. There are only two places it should be +** this. Ever. There are only two places it should be ** called from, and they are both inside this file. ** -** journal_mark_dirty -- adds blocks into this transaction. clears any flags +** journal_mark_dirty -- adds blocks into this transaction. clears any flags ** that might make them get sent to disk -** and then marks them BH_JDirty. Puts the buffer head -** into the current transaction hash. +** and then marks them BH_JDirty. Puts the buffer head +** into the current transaction hash. ** ** journal_end -- if the current transaction is batchable, it does nothing ** otherwise, it could do an async/synchronous commit, or -** a full flush of all log and real blocks in the +** a full flush of all log and real blocks in the ** transaction. ** -** flush_old_commits -- if the current transaction is too old, it is ended and -** commit blocks are sent to disk. Forces commit blocks -** to disk for all backgrounded commits that have been +** flush_old_commits -- if the current transaction is too old, it is ended and +** commit blocks are sent to disk. Forces commit blocks +** to disk for all backgrounded commits that have been ** around too long. -** -- Note, if you call this as an immediate flush from +** -- Note, if you call this as an immediate flush from ** from within kupdate, it will ignore the immediate flag */ @@ -212,7 +212,7 @@ static void allocate_bitmap_nodes(struct super_block *p_s_sb) list_add(&bn->list, &journal->j_bitmap_nodes); journal->j_free_bitmap_nodes++; } else { - break; // this is ok, we'll try again when more are needed + break; /* this is ok, we'll try again when more are needed */ } } } @@ -283,7 +283,7 @@ static int free_bitmap_nodes(struct super_block *p_s_sb) } /* -** get memory for JOURNAL_NUM_BITMAPS worth of bitmaps. +** get memory for JOURNAL_NUM_BITMAPS worth of bitmaps. ** jb_array is the array to be filled in. */ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, @@ -315,7 +315,7 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, } /* -** find an available list bitmap. If you can't find one, flush a commit list +** find an available list bitmap. If you can't find one, flush a commit list ** and try again */ static struct reiserfs_list_bitmap *get_list_bitmap(struct super_block *p_s_sb, @@ -348,7 +348,7 @@ static struct reiserfs_list_bitmap *get_list_bitmap(struct super_block *p_s_sb, return jb; } -/* +/* ** allocates a new chunk of X nodes, and links them all together as a list. ** Uses the cnode->next and cnode->prev pointers ** returns NULL on failure @@ -376,7 +376,7 @@ static struct reiserfs_journal_cnode *allocate_cnodes(int num_cnodes) } /* -** pulls a cnode off the free list, or returns NULL on failure +** pulls a cnode off the free list, or returns NULL on failure */ static struct reiserfs_journal_cnode *get_cnode(struct super_block *p_s_sb) { @@ -403,7 +403,7 @@ static struct reiserfs_journal_cnode *get_cnode(struct super_block *p_s_sb) } /* -** returns a cnode to the free list +** returns a cnode to the free list */ static void free_cnode(struct super_block *p_s_sb, struct reiserfs_journal_cnode *cn) @@ -1192,8 +1192,8 @@ static int flush_commit_list(struct super_block *s, } /* -** flush_journal_list frequently needs to find a newer transaction for a given block. This does that, or -** returns NULL if it can't find anything +** flush_journal_list frequently needs to find a newer transaction for a given block. This does that, or +** returns NULL if it can't find anything */ static struct reiserfs_journal_list *find_newer_jl_for_cn(struct reiserfs_journal_cnode @@ -1335,8 +1335,8 @@ static int update_journal_header_block(struct super_block *p_s_sb, return _update_journal_header_block(p_s_sb, offset, trans_id); } -/* -** flush any and all journal lists older than you are +/* +** flush any and all journal lists older than you are ** can only be called from flush_journal_list */ static int flush_older_journal_lists(struct super_block *p_s_sb, @@ -1382,8 +1382,8 @@ static void del_from_work_list(struct super_block *s, ** always set flushall to 1, unless you are calling from inside ** flush_journal_list ** -** IMPORTANT. This can only be called while there are no journal writers, -** and the journal is locked. That means it can only be called from +** IMPORTANT. This can only be called while there are no journal writers, +** and the journal is locked. That means it can only be called from ** do_journal_end, or by journal_release */ static int flush_journal_list(struct super_block *s, @@ -1429,7 +1429,7 @@ static int flush_journal_list(struct super_block *s, goto flush_older_and_return; } - /* start by putting the commit list on disk. This will also flush + /* start by putting the commit list on disk. This will also flush ** the commit lists of any olders transactions */ flush_commit_list(s, jl, 1); @@ -1444,8 +1444,8 @@ static int flush_journal_list(struct super_block *s, goto flush_older_and_return; } - /* loop through each cnode, see if we need to write it, - ** or wait on a more recent transaction, or just ignore it + /* loop through each cnode, see if we need to write it, + ** or wait on a more recent transaction, or just ignore it */ if (atomic_read(&(journal->j_wcount)) != 0) { reiserfs_panic(s, "journal-844", "journal list is flushing, " @@ -1473,8 +1473,8 @@ static int flush_journal_list(struct super_block *s, if (!pjl && cn->bh) { saved_bh = cn->bh; - /* we do this to make sure nobody releases the buffer while - ** we are working with it + /* we do this to make sure nobody releases the buffer while + ** we are working with it */ get_bh(saved_bh); @@ -1497,8 +1497,8 @@ static int flush_journal_list(struct super_block *s, goto free_cnode; } - /* bh == NULL when the block got to disk on its own, OR, - ** the block got freed in a future transaction + /* bh == NULL when the block got to disk on its own, OR, + ** the block got freed in a future transaction */ if (saved_bh == NULL) { goto free_cnode; @@ -1586,7 +1586,7 @@ static int flush_journal_list(struct super_block *s, __func__); flush_older_and_return: - /* before we can update the journal header block, we _must_ flush all + /* before we can update the journal header block, we _must_ flush all ** real blocks from all older transactions to disk. This is because ** once the header block is updated, this transaction will not be ** replayed after a crash @@ -1596,7 +1596,7 @@ static int flush_journal_list(struct super_block *s, } err = journal->j_errno; - /* before we can remove everything from the hash tables for this + /* before we can remove everything from the hash tables for this ** transaction, we must make sure it can never be replayed ** ** since we are only called from do_journal_end, we know for sure there @@ -2016,9 +2016,9 @@ static int journal_compare_desc_commit(struct super_block *p_s_sb, return 0; } -/* returns 0 if it did not find a description block +/* returns 0 if it did not find a description block ** returns -1 if it found a corrupt commit block -** returns 1 if both desc and commit were valid +** returns 1 if both desc and commit were valid */ static int journal_transaction_is_valid(struct super_block *p_s_sb, struct buffer_head *d_bh, @@ -2380,8 +2380,8 @@ static int journal_read(struct super_block *p_s_sb) bdevname(journal->j_dev_bd, b)); start = get_seconds(); - /* step 1, read in the journal header block. Check the transaction it says - ** is the first unflushed, and if that transaction is not valid, + /* step 1, read in the journal header block. Check the transaction it says + ** is the first unflushed, and if that transaction is not valid, ** replay is done */ journal->j_header_bh = journal_bread(p_s_sb, @@ -2406,8 +2406,8 @@ static int journal_read(struct super_block *p_s_sb) le32_to_cpu(jh->j_last_flush_trans_id)); valid_journal_header = 1; - /* now, we try to read the first unflushed offset. If it is not valid, - ** there is nothing more we can do, and it makes no sense to read + /* now, we try to read the first unflushed offset. If it is not valid, + ** there is nothing more we can do, and it makes no sense to read ** through the whole log. */ d_bh = @@ -2919,7 +2919,7 @@ int journal_transaction_should_end(struct reiserfs_transaction_handle *th, return 0; } -/* this must be called inside a transaction, and requires the +/* this must be called inside a transaction, and requires the ** kernel_lock to be held */ void reiserfs_block_writes(struct reiserfs_transaction_handle *th) @@ -3040,7 +3040,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th, now = get_seconds(); /* if there is no room in the journal OR - ** if this transaction is too old, and we weren't called joinable, wait for it to finish before beginning + ** if this transaction is too old, and we weren't called joinable, wait for it to finish before beginning ** we don't sleep if there aren't other writers */ @@ -3240,7 +3240,7 @@ int journal_begin(struct reiserfs_transaction_handle *th, ** ** if it was dirty, cleans and files onto the clean list. I can't let it be dirty again until the ** transaction is committed. -** +** ** if j_len, is bigger than j_len_alloc, it pushes j_len_alloc to 10 + j_len. */ int journal_mark_dirty(struct reiserfs_transaction_handle *th, @@ -3290,7 +3290,7 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, atomic_read(&(journal->j_wcount))); return 1; } - /* this error means I've screwed up, and we've overflowed the transaction. + /* this error means I've screwed up, and we've overflowed the transaction. ** Nothing can be done here, except make the FS readonly or panic. */ if (journal->j_len >= journal->j_trans_max) { @@ -3380,7 +3380,7 @@ int journal_end(struct reiserfs_transaction_handle *th, } } -/* removes from the current transaction, relsing and descrementing any counters. +/* removes from the current transaction, relsing and descrementing any counters. ** also files the removed buffer directly onto the clean list ** ** called by journal_mark_freed when a block has been deleted @@ -3478,7 +3478,7 @@ static int can_dirty(struct reiserfs_journal_cnode *cn) } /* syncs the commit blocks, but does not force the real buffers to disk -** will wait until the current transaction is done/committed before returning +** will wait until the current transaction is done/committed before returning */ int journal_end_sync(struct reiserfs_transaction_handle *th, struct super_block *p_s_sb, unsigned long nblocks) @@ -3560,13 +3560,13 @@ int reiserfs_flush_old_commits(struct super_block *p_s_sb) /* ** returns 0 if do_journal_end should return right away, returns 1 if do_journal_end should finish the commit -** -** if the current transaction is too old, but still has writers, this will wait on j_join_wait until all +** +** if the current transaction is too old, but still has writers, this will wait on j_join_wait until all ** the writers are done. By the time it wakes up, the transaction it was called has already ended, so it just ** flushes the commit list and returns 0. ** ** Won't batch when flush or commit_now is set. Also won't batch when others are waiting on j_join_wait. -** +** ** Note, we can't allow the journal_end to proceed while there are still writers in the log. */ static int check_journal_end(struct reiserfs_transaction_handle *th, @@ -3594,7 +3594,7 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, atomic_dec(&(journal->j_wcount)); } - /* BUG, deal with case where j_len is 0, but people previously freed blocks need to be released + /* BUG, deal with case where j_len is 0, but people previously freed blocks need to be released ** will be dealt with by next transaction that actually writes something, but should be taken ** care of in this trans */ @@ -3603,7 +3603,7 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, /* if wcount > 0, and we are called to with flush or commit_now, ** we wait on j_join_wait. We will wake up when the last writer has ** finished the transaction, and started it on its way to the disk. - ** Then, we flush the commit or journal list, and just return 0 + ** Then, we flush the commit or journal list, and just return 0 ** because the rest of journal end was already done for this transaction. */ if (atomic_read(&(journal->j_wcount)) > 0) { @@ -3674,7 +3674,7 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, /* ** Does all the work that makes deleting blocks safe. ** when deleting a block mark BH_JNew, just remove it from the current transaction, clean it's buffer_head and move on. -** +** ** otherwise: ** set a bit for the block in the journal bitmap. That will prevent it from being allocated for unformatted nodes ** before this transaction has finished. @@ -3878,7 +3878,7 @@ extern struct tree_balance *cur_tb; ** be written to disk while we are altering it. So, we must: ** clean it ** wait on it. -** +** */ int reiserfs_prepare_for_journal(struct super_block *p_s_sb, struct buffer_head *bh, int wait) @@ -3920,7 +3920,7 @@ static void flush_old_journal_lists(struct super_block *s) } } -/* +/* ** long and ugly. If flush, will not return until all commit ** blocks and all real buffers in the trans are on disk. ** If no_async, won't return until all commit blocks are on disk. @@ -3981,7 +3981,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, wait_on_commit = 1; } - /* check_journal_end locks the journal, and unlocks if it does not return 1 + /* check_journal_end locks the journal, and unlocks if it does not return 1 ** it tells us if we should continue with the journal_end, or just return */ if (!check_journal_end(th, p_s_sb, nblocks, flags)) { @@ -4078,7 +4078,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, last_cn->next = jl_cn; } last_cn = jl_cn; - /* make sure the block we are trying to log is not a block + /* make sure the block we are trying to log is not a block of journal or reserved area */ if (is_block_in_log_or_reserved_area @@ -4225,9 +4225,9 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, } else if (!(jl->j_state & LIST_COMMIT_PENDING)) queue_delayed_work(commit_wq, &journal->j_work, HZ / 10); - /* if the next transaction has any chance of wrapping, flush - ** transactions that might get overwritten. If any journal lists are very - ** old flush them as well. + /* if the next transaction has any chance of wrapping, flush + ** transactions that might get overwritten. If any journal lists are very + ** old flush them as well. */ first_jl: list_for_each_safe(entry, safe, &journal->j_journal_list) { diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c index 21a171ceba1d..381750a155f6 100644 --- a/fs/reiserfs/lbalance.c +++ b/fs/reiserfs/lbalance.c @@ -119,8 +119,8 @@ static void leaf_copy_dir_entries(struct buffer_info *dest_bi, DEH_SIZE * copy_count + copy_records_len); } -/* Copy the first (if last_first == FIRST_TO_LAST) or last (last_first == LAST_TO_FIRST) item or - part of it or nothing (see the return 0 below) from SOURCE to the end +/* Copy the first (if last_first == FIRST_TO_LAST) or last (last_first == LAST_TO_FIRST) item or + part of it or nothing (see the return 0 below) from SOURCE to the end (if last_first) or beginning (!last_first) of the DEST */ /* returns 1 if anything was copied, else 0 */ static int leaf_copy_boundary_item(struct buffer_info *dest_bi, @@ -396,7 +396,7 @@ static void leaf_item_bottle(struct buffer_info *dest_bi, else { struct item_head n_ih; - /* copy part of the body of the item number 'item_num' of SOURCE to the end of the DEST + /* copy part of the body of the item number 'item_num' of SOURCE to the end of the DEST part defined by 'cpy_bytes'; create new item header; change old item_header (????); n_ih = new item_header; */ @@ -426,7 +426,7 @@ static void leaf_item_bottle(struct buffer_info *dest_bi, else { struct item_head n_ih; - /* copy part of the body of the item number 'item_num' of SOURCE to the begin of the DEST + /* copy part of the body of the item number 'item_num' of SOURCE to the begin of the DEST part defined by 'cpy_bytes'; create new item header; n_ih = new item_header; */ @@ -724,7 +724,7 @@ int leaf_shift_right(struct tree_balance *tb, int shift_num, int shift_bytes) static void leaf_delete_items_entirely(struct buffer_info *bi, int first, int del_num); /* If del_bytes == -1, starting from position 'first' delete del_num items in whole in buffer CUR. - If not. + If not. If last_first == 0. Starting from position 'first' delete del_num-1 items in whole. Delete part of body of the first item. Part defined by del_bytes. Don't delete first item header If last_first == 1. Starting from position 'first+1' delete del_num-1 items in whole. Delete part of body of @@ -783,7 +783,7 @@ void leaf_delete_items(struct buffer_info *cur_bi, int last_first, /* len = body len of item */ len = ih_item_len(ih); - /* delete the part of the last item of the bh + /* delete the part of the last item of the bh do not delete item header */ leaf_cut_from_buffer(cur_bi, B_NR_ITEMS(bh) - 1, @@ -865,7 +865,7 @@ void leaf_insert_into_buf(struct buffer_info *bi, int before, } } -/* paste paste_size bytes to affected_item_num-th item. +/* paste paste_size bytes to affected_item_num-th item. When item is a directory, this only prepare space for new entries */ void leaf_paste_in_buffer(struct buffer_info *bi, int affected_item_num, int pos_in_item, int paste_size, @@ -1022,7 +1022,7 @@ static int leaf_cut_entries(struct buffer_head *bh, /* when cut item is part of regular file pos_in_item - first byte that must be cut cut_size - number of bytes to be cut beginning from pos_in_item - + when cut item is part of directory pos_in_item - number of first deleted entry cut_size - count of deleted entries @@ -1275,7 +1275,7 @@ void leaf_paste_entries(struct buffer_info *bi, /* change item key if necessary (when we paste before 0-th entry */ if (!before) { set_le_ih_k_offset(ih, deh_offset(new_dehs)); -/* memcpy (&ih->ih_key.k_offset, +/* memcpy (&ih->ih_key.k_offset, &new_dehs->deh_offset, SHORT_KEY_SIZE);*/ } #ifdef CONFIG_REISERFS_CHECK diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index cb1a9e977907..9d1070e741fc 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -106,7 +106,7 @@ key of the first directory entry in it. This function first calls search_by_key, then, if item whose first entry matches is not found it looks for the entry inside directory item found by search_by_key. Fills the path to the entry, and to the -entry position in the item +entry position in the item */ @@ -371,7 +371,7 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry, return d_splice_alias(inode, dentry); } -/* +/* ** looks up the dentry of the parent directory for child. ** taken from ext2_get_parent */ @@ -401,7 +401,7 @@ struct dentry *reiserfs_get_parent(struct dentry *child) return d_obtain_alias(inode); } -/* add entry to the directory (entry can be hidden). +/* add entry to the directory (entry can be hidden). insert definition of when hidden directories are used here -Hans @@ -559,7 +559,7 @@ static int drop_new_inode(struct inode *inode) return 0; } -/* utility function that does setup for reiserfs_new_inode. +/* utility function that does setup for reiserfs_new_inode. ** DQUOT_INIT needs lots of credits so it's better to have it ** outside of a transaction, so we had to pull some bits of ** reiserfs_new_inode out into this func. @@ -820,7 +820,7 @@ static inline int reiserfs_empty_dir(struct inode *inode) { /* we can cheat because an old format dir cannot have ** EMPTY_DIR_SIZE, and a new format dir cannot have - ** EMPTY_DIR_SIZE_V1. So, if the inode is either size, + ** EMPTY_DIR_SIZE_V1. So, if the inode is either size, ** regardless of disk format version, the directory is empty. */ if (inode->i_size != EMPTY_DIR_SIZE && @@ -1162,7 +1162,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir, return retval; } -// de contains information pointing to an entry which +/* de contains information pointing to an entry which */ static int de_still_valid(const char *name, int len, struct reiserfs_dir_entry *de) { @@ -1206,10 +1206,10 @@ static void set_ino_in_dir_entry(struct reiserfs_dir_entry *de, de->de_deh[de->de_entry_num].deh_objectid = key->k_objectid; } -/* +/* * process, that is going to call fix_nodes/do_balance must hold only * one path. If it holds 2 or more, it can get into endless waiting in - * get_empty_nodes or its clones + * get_empty_nodes or its clones */ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry) @@ -1263,7 +1263,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, old_inode_mode = old_inode->i_mode; if (S_ISDIR(old_inode_mode)) { - // make sure, that directory being renamed has correct ".." + // make sure, that directory being renamed has correct ".." // and that its new parent directory has not too many links // already @@ -1274,8 +1274,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, } } - /* directory is renamed, its parent directory will be changed, - ** so find ".." entry + /* directory is renamed, its parent directory will be changed, + ** so find ".." entry */ dot_dot_de.de_gen_number_bit_string = NULL; retval = @@ -1385,9 +1385,9 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, this stuff, yes? Then, having gathered everything into RAM we should lock the buffers, yes? -Hans */ - /* probably. our rename needs to hold more - ** than one path at once. The seals would - ** have to be written to deal with multi-path + /* probably. our rename needs to hold more + ** than one path at once. The seals would + ** have to be written to deal with multi-path ** issues -chris */ /* sanity checking before doing the rename - avoid races many @@ -1465,7 +1465,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, } if (S_ISDIR(old_inode_mode)) { - // adjust ".." of renamed directory + /* adjust ".." of renamed directory */ set_ino_in_dir_entry(&dot_dot_de, INODE_PKEY(new_dir)); journal_mark_dirty(&th, new_dir->i_sb, dot_dot_de.de_bh); diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c index d2d6b5650188..3a6de810bd61 100644 --- a/fs/reiserfs/objectid.c +++ b/fs/reiserfs/objectid.c @@ -180,7 +180,7 @@ int reiserfs_convert_objectid_map_v1(struct super_block *s) if (cur_size > new_size) { /* mark everyone used that was listed as free at the end of the objectid - ** map + ** map */ objectid_map[new_size - 1] = objectid_map[cur_size - 1]; set_sb_oid_cursize(disk_sb, new_size); diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c index 8e826c07cd21..536eacaeb710 100644 --- a/fs/reiserfs/prints.c +++ b/fs/reiserfs/prints.c @@ -178,11 +178,11 @@ static char *is_there_reiserfs_struct(char *fmt, int *what) appropriative printk. With this reiserfs_warning you can use format specification for complex structures like you used to do with printfs for integers, doubles and pointers. For instance, to print - out key structure you have to write just: - reiserfs_warning ("bad key %k", key); - instead of - printk ("bad key %lu %lu %lu %lu", key->k_dir_id, key->k_objectid, - key->k_offset, key->k_uniqueness); + out key structure you have to write just: + reiserfs_warning ("bad key %k", key); + instead of + printk ("bad key %lu %lu %lu %lu", key->k_dir_id, key->k_objectid, + key->k_offset, key->k_uniqueness); */ static DEFINE_SPINLOCK(error_lock); static void prepare_error_buf(const char *fmt, va_list args) @@ -244,11 +244,11 @@ static void prepare_error_buf(const char *fmt, va_list args) } /* in addition to usual conversion specifiers this accepts reiserfs - specific conversion specifiers: - %k to print little endian key, - %K to print cpu key, + specific conversion specifiers: + %k to print little endian key, + %K to print cpu key, %h to print item_head, - %t to print directory entry + %t to print directory entry %z to print block head (arg must be struct buffer_head * %b to print buffer_head */ @@ -314,17 +314,17 @@ void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...) maintainer-errorid. Don't bother with reusing errorids, there are lots of numbers out there. - Example: - + Example: + reiserfs_panic( p_sb, "reiser-29: reiserfs_new_blocknrs: " "one of search_start or rn(%d) is equal to MAX_B_NUM," - "which means that we are optimizing location based on the bogus location of a temp buffer (%p).", + "which means that we are optimizing location based on the bogus location of a temp buffer (%p).", rn, bh ); Regular panic()s sometimes clear the screen before the message can - be read, thus the need for the while loop. + be read, thus the need for the while loop. Numbering scheme for panic used by Vladimir and Anatoly( Hans completely ignores this scheme, and considers it pointless complexity): diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index d4d7f1433ed0..d5066400638a 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c @@ -633,7 +633,7 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, * */ -/* +/* * Make Linus happy. * Local variables: * c-indentation-style: "K&R" diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c index f71c3948edef..238e9d9b31e0 100644 --- a/fs/reiserfs/resize.c +++ b/fs/reiserfs/resize.c @@ -1,8 +1,8 @@ -/* +/* * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README */ -/* +/* * Written by Alexander Zarochentcev. * * The kernel part of the (on-line) reiserfs resizer. @@ -101,7 +101,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new) memcpy(jbitmap[i].bitmaps, jb->bitmaps, copy_size); /* just in case vfree schedules on us, copy the new - ** pointer into the journal struct before freeing the + ** pointer into the journal struct before freeing the ** old one */ node_tmp = jb->bitmaps; diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index b2eaa0c6b7b7..a65bfee28bb8 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -77,7 +77,7 @@ inline void copy_item_head(struct item_head *p_v_to, /* k1 is pointer to on-disk structure which is stored in little-endian form. k2 is pointer to cpu variable. For key of items of the same object this returns 0. - Returns: -1 if key1 < key2 + Returns: -1 if key1 < key2 0 if key1 == key2 1 if key1 > key2 */ inline int comp_short_keys(const struct reiserfs_key *le_key, @@ -890,7 +890,7 @@ static inline int prepare_for_direct_item(struct treepath *path, } // new file gets truncated if (get_inode_item_key_version(inode) == KEY_FORMAT_3_6) { - // + // round_len = ROUND_UP(new_file_length); /* this was n_new_file_length < le_ih ... */ if (round_len < le_ih_k_offset(le_ih)) { @@ -1443,7 +1443,7 @@ static int maybe_indirect_to_direct(struct reiserfs_transaction_handle *th, if (atomic_read(&p_s_inode->i_count) > 1 || !tail_has_to_be_packed(p_s_inode) || !page || (REISERFS_I(p_s_inode)->i_flags & i_nopack_mask)) { - // leave tail in an unformatted node + /* leave tail in an unformatted node */ *p_c_mode = M_SKIP_BALANCING; cut_bytes = n_block_size - (n_new_file_size & (n_block_size - 1)); @@ -1826,7 +1826,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p /* While there are bytes to truncate and previous file item is presented in the tree. */ /* - ** This loop could take a really long time, and could log + ** This loop could take a really long time, and could log ** many more blocks than a transaction can hold. So, we do a polite ** journal end here, and if the transaction needs ending, we make ** sure the file is consistent before ending the current trans diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 4a1e16362ebd..d7519b951500 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -758,7 +758,7 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, char **opt_arg, unsigned long *bit_flags) { char *p; - /* foo=bar, + /* foo=bar, ^ ^ ^ | | +-- option_end | +-- arg_start @@ -1348,7 +1348,7 @@ static int read_super_block(struct super_block *s, int offset) } // // ok, reiserfs signature (old or new) found in at the given offset - // + // fs_blocksize = sb_blocksize(rs); brelse(bh); sb_set_blocksize(s, fs_blocksize); @@ -1534,8 +1534,8 @@ static int what_hash(struct super_block *s) code = find_hash_out(s); if (code != UNSET_HASH && reiserfs_hash_detect(s)) { - /* detection has found the hash, and we must check against the - ** mount options + /* detection has found the hash, and we must check against the + ** mount options */ if (reiserfs_rupasov_hash(s) && code != YURA_HASH) { reiserfs_warning(s, "reiserfs-2507", @@ -1567,7 +1567,7 @@ static int what_hash(struct super_block *s) } } - /* if we are mounted RW, and we have a new valid hash code, update + /* if we are mounted RW, and we have a new valid hash code, update ** the super */ if (code != UNSET_HASH && diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c index 083f74435f65..0635cfe0f0b7 100644 --- a/fs/reiserfs/tail_conversion.c +++ b/fs/reiserfs/tail_conversion.c @@ -46,7 +46,7 @@ int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode, /* Set the key to search for the place for new unfm pointer */ make_cpu_key(&end_key, inode, tail_offset, TYPE_INDIRECT, 4); - // FIXME: we could avoid this + /* FIXME: we could avoid this */ if (search_for_position_by_key(sb, &end_key, path) == POSITION_FOUND) { reiserfs_error(sb, "PAP-14030", "pasted or inserted byte exists in " diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 4686b90886ed..5621d87c4479 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h @@ -14,7 +14,7 @@ typedef enum { } reiserfs_super_block_flags; /* struct reiserfs_super_block accessors/mutators - * since this is a disk structure, it will always be in + * since this is a disk structure, it will always be in * little endian format. */ #define sb_block_count(sbp) (le32_to_cpu((sbp)->s_v1.s_block_count)) #define set_sb_block_count(sbp,v) ((sbp)->s_v1.s_block_count = cpu_to_le32(v)) @@ -83,16 +83,16 @@ typedef enum { /* LOGGING -- */ -/* These all interelate for performance. +/* These all interelate for performance. ** -** If the journal block count is smaller than n transactions, you lose speed. +** If the journal block count is smaller than n transactions, you lose speed. ** I don't know what n is yet, I'm guessing 8-16. ** ** typical transaction size depends on the application, how often fsync is -** called, and how many metadata blocks you dirty in a 30 second period. +** called, and how many metadata blocks you dirty in a 30 second period. ** The more small files (<16k) you use, the larger your transactions will ** be. -** +** ** If your journal fills faster than dirty buffers get flushed to disk, it must flush them before allowing the journal ** to wrap, which slows things down. If you need high speed meta data updates, the journal should be big enough ** to prevent wrapping before dirty meta blocks get to disk. @@ -242,7 +242,7 @@ struct reiserfs_journal { struct reiserfs_list_bitmap j_list_bitmap[JOURNAL_NUM_BITMAPS]; /* array of bitmaps to record the deleted blocks */ struct reiserfs_journal_cnode *j_hash_table[JOURNAL_HASH_SIZE]; /* hash table for real buffer heads in current trans */ - struct reiserfs_journal_cnode *j_list_hash_table[JOURNAL_HASH_SIZE]; /* hash table for all the real buffer heads in all + struct reiserfs_journal_cnode *j_list_hash_table[JOURNAL_HASH_SIZE]; /* hash table for all the real buffer heads in all the transactions */ struct list_head j_prealloc_list; /* list of inodes which have preallocated blocks */ int j_persistent_trans; @@ -426,7 +426,7 @@ enum reiserfs_mount_options { partition will be dealt with in a manner of 3.5.x */ -/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting +/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting ** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option ** is not required. If the normal autodection code can't determine which ** hash to use (because both hashes had the same value for a file) -- cgit v1.2.3-59-g8ed1b