aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/do_balan.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-03-30 14:02:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 15:16:36 -0400
commit45b03d5e8e674eb6555b767e1c8eb40b671ff892 (patch)
treed74acd1be7f5102143df960e8cd692aadcc437df /fs/reiserfs/do_balan.c
parent1d889d9958490888b3fad1d486145d9a03559cbc (diff)
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 <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/do_balan.c')
-rw-r--r--fs/reiserfs/do_balan.c40
1 files changed, 20 insertions, 20 deletions
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)
1752 int i; 1752 int i;
1753 1753
1754 if (buffer_dirty(bh)) 1754 if (buffer_dirty(bh))
1755 reiserfs_warning(tb->tb_sb, 1755 reiserfs_warning(tb->tb_sb, "reiserfs-12320",
1756 "store_thrown deals with dirty buffer"); 1756 "called with dirty buffer");
1757 for (i = 0; i < ARRAY_SIZE(tb->thrown); i++) 1757 for (i = 0; i < ARRAY_SIZE(tb->thrown); i++)
1758 if (!tb->thrown[i]) { 1758 if (!tb->thrown[i]) {
1759 tb->thrown[i] = bh; 1759 tb->thrown[i] = bh;
1760 get_bh(bh); /* free_thrown puts this */ 1760 get_bh(bh); /* free_thrown puts this */
1761 return; 1761 return;
1762 } 1762 }
1763 reiserfs_warning(tb->tb_sb, "store_thrown: too many thrown buffers"); 1763 reiserfs_warning(tb->tb_sb, "reiserfs-12321",
1764 "too many thrown buffers");
1764} 1765}
1765 1766
1766static void free_thrown(struct tree_balance *tb) 1767static void free_thrown(struct tree_balance *tb)
@@ -1771,8 +1772,8 @@ static void free_thrown(struct tree_balance *tb)
1771 if (tb->thrown[i]) { 1772 if (tb->thrown[i]) {
1772 blocknr = tb->thrown[i]->b_blocknr; 1773 blocknr = tb->thrown[i]->b_blocknr;
1773 if (buffer_dirty(tb->thrown[i])) 1774 if (buffer_dirty(tb->thrown[i]))
1774 reiserfs_warning(tb->tb_sb, 1775 reiserfs_warning(tb->tb_sb, "reiserfs-12322",
1775 "free_thrown deals with dirty buffer %d", 1776 "called with dirty buffer %d",
1776 blocknr); 1777 blocknr);
1777 brelse(tb->thrown[i]); /* incremented in store_thrown */ 1778 brelse(tb->thrown[i]); /* incremented in store_thrown */
1778 reiserfs_free_block(tb->transaction_handle, NULL, 1779 reiserfs_free_block(tb->transaction_handle, NULL,
@@ -1877,13 +1878,12 @@ static void check_internal_node(struct super_block *s, struct buffer_head *bh,
1877 } 1878 }
1878} 1879}
1879 1880
1880static int locked_or_not_in_tree(struct buffer_head *bh, char *which) 1881static int locked_or_not_in_tree(struct tree_balance *tb,
1882 struct buffer_head *bh, char *which)
1881{ 1883{
1882 if ((!buffer_journal_prepared(bh) && buffer_locked(bh)) || 1884 if ((!buffer_journal_prepared(bh) && buffer_locked(bh)) ||
1883 !B_IS_IN_TREE(bh)) { 1885 !B_IS_IN_TREE(bh)) {
1884 reiserfs_warning(NULL, 1886 reiserfs_warning(tb->tb_sb, "vs-12339", "%s (%b)", which, bh);
1885 "vs-12339: locked_or_not_in_tree: %s (%b)",
1886 which, bh);
1887 return 1; 1887 return 1;
1888 } 1888 }
1889 return 0; 1889 return 0;
@@ -1902,18 +1902,19 @@ static int check_before_balancing(struct tree_balance *tb)
1902 /* double check that buffers that we will modify are unlocked. (fix_nodes should already have 1902 /* double check that buffers that we will modify are unlocked. (fix_nodes should already have
1903 prepped all of these for us). */ 1903 prepped all of these for us). */
1904 if (tb->lnum[0]) { 1904 if (tb->lnum[0]) {
1905 retval |= locked_or_not_in_tree(tb->L[0], "L[0]"); 1905 retval |= locked_or_not_in_tree(tb, tb->L[0], "L[0]");
1906 retval |= locked_or_not_in_tree(tb->FL[0], "FL[0]"); 1906 retval |= locked_or_not_in_tree(tb, tb->FL[0], "FL[0]");
1907 retval |= locked_or_not_in_tree(tb->CFL[0], "CFL[0]"); 1907 retval |= locked_or_not_in_tree(tb, tb->CFL[0], "CFL[0]");
1908 check_leaf(tb->L[0]); 1908 check_leaf(tb->L[0]);
1909 } 1909 }
1910 if (tb->rnum[0]) { 1910 if (tb->rnum[0]) {
1911 retval |= locked_or_not_in_tree(tb->R[0], "R[0]"); 1911 retval |= locked_or_not_in_tree(tb, tb->R[0], "R[0]");
1912 retval |= locked_or_not_in_tree(tb->FR[0], "FR[0]"); 1912 retval |= locked_or_not_in_tree(tb, tb->FR[0], "FR[0]");
1913 retval |= locked_or_not_in_tree(tb->CFR[0], "CFR[0]"); 1913 retval |= locked_or_not_in_tree(tb, tb->CFR[0], "CFR[0]");
1914 check_leaf(tb->R[0]); 1914 check_leaf(tb->R[0]);
1915 } 1915 }
1916 retval |= locked_or_not_in_tree(PATH_PLAST_BUFFER(tb->tb_path), "S[0]"); 1916 retval |= locked_or_not_in_tree(tb, PATH_PLAST_BUFFER(tb->tb_path),
1917 "S[0]");
1917 check_leaf(PATH_PLAST_BUFFER(tb->tb_path)); 1918 check_leaf(PATH_PLAST_BUFFER(tb->tb_path));
1918 1919
1919 return retval; 1920 return retval;
@@ -1952,7 +1953,7 @@ static void check_after_balance_leaf(struct tree_balance *tb)
1952 PATH_H_POSITION(tb->tb_path, 1953 PATH_H_POSITION(tb->tb_path,
1953 1)))); 1954 1))));
1954 print_cur_tb("12223"); 1955 print_cur_tb("12223");
1955 reiserfs_warning(tb->tb_sb, 1956 reiserfs_warning(tb->tb_sb, "reiserfs-12363",
1956 "B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; " 1957 "B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; "
1957 "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d", 1958 "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d",
1958 left, 1959 left,
@@ -2104,9 +2105,8 @@ void do_balance(struct tree_balance *tb, /* tree_balance structure */
2104 } 2105 }
2105 /* if we have no real work to do */ 2106 /* if we have no real work to do */
2106 if (!tb->insert_size[0]) { 2107 if (!tb->insert_size[0]) {
2107 reiserfs_warning(tb->tb_sb, 2108 reiserfs_warning(tb->tb_sb, "PAP-12350",
2108 "PAP-12350: do_balance: insert_size == 0, mode == %c", 2109 "insert_size == 0, mode == %c", flag);
2109 flag);
2110 unfix_nodes(tb); 2110 unfix_nodes(tb);
2111 return; 2111 return;
2112 } 2112 }