aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/fix_node.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-03-30 14:02:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 15:16:39 -0400
commitad31a4fc0386e8590c51ca4b8f1ae1d8b8b2ac5e (patch)
tree636010f3ba98e15245f04ade1a74a730e40abf57 /fs/reiserfs/fix_node.c
parenta9dd364358fbdc68faee5d20c2d648c320dc3cf0 (diff)
reiserfs: rename p_s_bh to bh
This patch is a simple s/p_s_bh/bh/g to the reiserfs code. This is the second in a series of patches to rip out some of the awful variable naming in reiserfs. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/fix_node.c')
-rw-r--r--fs/reiserfs/fix_node.c94
1 files changed, 44 insertions, 50 deletions
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c
index 799c0ce24291..ad42c45af44f 100644
--- a/fs/reiserfs/fix_node.c
+++ b/fs/reiserfs/fix_node.c
@@ -1887,7 +1887,7 @@ static int check_balance(int mode,
1887/* Check whether parent at the path is the really parent of the current node.*/ 1887/* Check whether parent at the path is the really parent of the current node.*/
1888static int get_direct_parent(struct tree_balance *p_s_tb, int n_h) 1888static int get_direct_parent(struct tree_balance *p_s_tb, int n_h)
1889{ 1889{
1890 struct buffer_head *p_s_bh; 1890 struct buffer_head *bh;
1891 struct treepath *p_s_path = p_s_tb->tb_path; 1891 struct treepath *p_s_path = p_s_tb->tb_path;
1892 int n_position, 1892 int n_position,
1893 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h); 1893 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h);
@@ -1909,21 +1909,21 @@ static int get_direct_parent(struct tree_balance *p_s_tb, int n_h)
1909 } 1909 }
1910 1910
1911 if (!B_IS_IN_TREE 1911 if (!B_IS_IN_TREE
1912 (p_s_bh = PATH_OFFSET_PBUFFER(p_s_path, n_path_offset - 1))) 1912 (bh = PATH_OFFSET_PBUFFER(p_s_path, n_path_offset - 1)))
1913 return REPEAT_SEARCH; /* Parent in the path is not in the tree. */ 1913 return REPEAT_SEARCH; /* Parent in the path is not in the tree. */
1914 1914
1915 if ((n_position = 1915 if ((n_position =
1916 PATH_OFFSET_POSITION(p_s_path, 1916 PATH_OFFSET_POSITION(p_s_path,
1917 n_path_offset - 1)) > B_NR_ITEMS(p_s_bh)) 1917 n_path_offset - 1)) > B_NR_ITEMS(bh))
1918 return REPEAT_SEARCH; 1918 return REPEAT_SEARCH;
1919 1919
1920 if (B_N_CHILD_NUM(p_s_bh, n_position) != 1920 if (B_N_CHILD_NUM(bh, n_position) !=
1921 PATH_OFFSET_PBUFFER(p_s_path, n_path_offset)->b_blocknr) 1921 PATH_OFFSET_PBUFFER(p_s_path, n_path_offset)->b_blocknr)
1922 /* Parent in the path is not parent of the current node in the tree. */ 1922 /* Parent in the path is not parent of the current node in the tree. */
1923 return REPEAT_SEARCH; 1923 return REPEAT_SEARCH;
1924 1924
1925 if (buffer_locked(p_s_bh)) { 1925 if (buffer_locked(bh)) {
1926 __wait_on_buffer(p_s_bh); 1926 __wait_on_buffer(bh);
1927 if (FILESYSTEM_CHANGED_TB(p_s_tb)) 1927 if (FILESYSTEM_CHANGED_TB(p_s_tb))
1928 return REPEAT_SEARCH; 1928 return REPEAT_SEARCH;
1929 } 1929 }
@@ -1943,29 +1943,29 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
1943 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h + 1); 1943 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h + 1);
1944 unsigned long n_son_number; 1944 unsigned long n_son_number;
1945 struct super_block *sb = p_s_tb->tb_sb; 1945 struct super_block *sb = p_s_tb->tb_sb;
1946 struct buffer_head *p_s_bh; 1946 struct buffer_head *bh;
1947 1947
1948 PROC_INFO_INC(sb, get_neighbors[n_h]); 1948 PROC_INFO_INC(sb, get_neighbors[n_h]);
1949 1949
1950 if (p_s_tb->lnum[n_h]) { 1950 if (p_s_tb->lnum[n_h]) {
1951 /* We need left neighbor to balance S[n_h]. */ 1951 /* We need left neighbor to balance S[n_h]. */
1952 PROC_INFO_INC(sb, need_l_neighbor[n_h]); 1952 PROC_INFO_INC(sb, need_l_neighbor[n_h]);
1953 p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset); 1953 bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset);
1954 1954
1955 RFALSE(p_s_bh == p_s_tb->FL[n_h] && 1955 RFALSE(bh == p_s_tb->FL[n_h] &&
1956 !PATH_OFFSET_POSITION(p_s_tb->tb_path, n_path_offset), 1956 !PATH_OFFSET_POSITION(p_s_tb->tb_path, n_path_offset),
1957 "PAP-8270: invalid position in the parent"); 1957 "PAP-8270: invalid position in the parent");
1958 1958
1959 n_child_position = 1959 n_child_position =
1960 (p_s_bh == 1960 (bh ==
1961 p_s_tb->FL[n_h]) ? p_s_tb->lkey[n_h] : B_NR_ITEMS(p_s_tb-> 1961 p_s_tb->FL[n_h]) ? p_s_tb->lkey[n_h] : B_NR_ITEMS(p_s_tb->
1962 FL[n_h]); 1962 FL[n_h]);
1963 n_son_number = B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position); 1963 n_son_number = B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position);
1964 p_s_bh = sb_bread(sb, n_son_number); 1964 bh = sb_bread(sb, n_son_number);
1965 if (!p_s_bh) 1965 if (!bh)
1966 return IO_ERROR; 1966 return IO_ERROR;
1967 if (FILESYSTEM_CHANGED_TB(p_s_tb)) { 1967 if (FILESYSTEM_CHANGED_TB(p_s_tb)) {
1968 brelse(p_s_bh); 1968 brelse(bh);
1969 PROC_INFO_INC(sb, get_neighbors_restart[n_h]); 1969 PROC_INFO_INC(sb, get_neighbors_restart[n_h]);
1970 return REPEAT_SEARCH; 1970 return REPEAT_SEARCH;
1971 } 1971 }
@@ -1973,48 +1973,48 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
1973 RFALSE(!B_IS_IN_TREE(p_s_tb->FL[n_h]) || 1973 RFALSE(!B_IS_IN_TREE(p_s_tb->FL[n_h]) ||
1974 n_child_position > B_NR_ITEMS(p_s_tb->FL[n_h]) || 1974 n_child_position > B_NR_ITEMS(p_s_tb->FL[n_h]) ||
1975 B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position) != 1975 B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position) !=
1976 p_s_bh->b_blocknr, "PAP-8275: invalid parent"); 1976 bh->b_blocknr, "PAP-8275: invalid parent");
1977 RFALSE(!B_IS_IN_TREE(p_s_bh), "PAP-8280: invalid child"); 1977 RFALSE(!B_IS_IN_TREE(bh), "PAP-8280: invalid child");
1978 RFALSE(!n_h && 1978 RFALSE(!n_h &&
1979 B_FREE_SPACE(p_s_bh) != 1979 B_FREE_SPACE(bh) !=
1980 MAX_CHILD_SIZE(p_s_bh) - 1980 MAX_CHILD_SIZE(bh) -
1981 dc_size(B_N_CHILD(p_s_tb->FL[0], n_child_position)), 1981 dc_size(B_N_CHILD(p_s_tb->FL[0], n_child_position)),
1982 "PAP-8290: invalid child size of left neighbor"); 1982 "PAP-8290: invalid child size of left neighbor");
1983 1983
1984 brelse(p_s_tb->L[n_h]); 1984 brelse(p_s_tb->L[n_h]);
1985 p_s_tb->L[n_h] = p_s_bh; 1985 p_s_tb->L[n_h] = bh;
1986 } 1986 }
1987 1987
1988 if (p_s_tb->rnum[n_h]) { /* We need right neighbor to balance S[n_path_offset]. */ 1988 if (p_s_tb->rnum[n_h]) { /* We need right neighbor to balance S[n_path_offset]. */
1989 PROC_INFO_INC(sb, need_r_neighbor[n_h]); 1989 PROC_INFO_INC(sb, need_r_neighbor[n_h]);
1990 p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset); 1990 bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset);
1991 1991
1992 RFALSE(p_s_bh == p_s_tb->FR[n_h] && 1992 RFALSE(bh == p_s_tb->FR[n_h] &&
1993 PATH_OFFSET_POSITION(p_s_tb->tb_path, 1993 PATH_OFFSET_POSITION(p_s_tb->tb_path,
1994 n_path_offset) >= 1994 n_path_offset) >=
1995 B_NR_ITEMS(p_s_bh), 1995 B_NR_ITEMS(bh),
1996 "PAP-8295: invalid position in the parent"); 1996 "PAP-8295: invalid position in the parent");
1997 1997
1998 n_child_position = 1998 n_child_position =
1999 (p_s_bh == p_s_tb->FR[n_h]) ? p_s_tb->rkey[n_h] + 1 : 0; 1999 (bh == p_s_tb->FR[n_h]) ? p_s_tb->rkey[n_h] + 1 : 0;
2000 n_son_number = B_N_CHILD_NUM(p_s_tb->FR[n_h], n_child_position); 2000 n_son_number = B_N_CHILD_NUM(p_s_tb->FR[n_h], n_child_position);
2001 p_s_bh = sb_bread(sb, n_son_number); 2001 bh = sb_bread(sb, n_son_number);
2002 if (!p_s_bh) 2002 if (!bh)
2003 return IO_ERROR; 2003 return IO_ERROR;
2004 if (FILESYSTEM_CHANGED_TB(p_s_tb)) { 2004 if (FILESYSTEM_CHANGED_TB(p_s_tb)) {
2005 brelse(p_s_bh); 2005 brelse(bh);
2006 PROC_INFO_INC(sb, get_neighbors_restart[n_h]); 2006 PROC_INFO_INC(sb, get_neighbors_restart[n_h]);
2007 return REPEAT_SEARCH; 2007 return REPEAT_SEARCH;
2008 } 2008 }
2009 brelse(p_s_tb->R[n_h]); 2009 brelse(p_s_tb->R[n_h]);
2010 p_s_tb->R[n_h] = p_s_bh; 2010 p_s_tb->R[n_h] = bh;
2011 2011
2012 RFALSE(!n_h 2012 RFALSE(!n_h
2013 && B_FREE_SPACE(p_s_bh) != 2013 && B_FREE_SPACE(bh) !=
2014 MAX_CHILD_SIZE(p_s_bh) - 2014 MAX_CHILD_SIZE(bh) -
2015 dc_size(B_N_CHILD(p_s_tb->FR[0], n_child_position)), 2015 dc_size(B_N_CHILD(p_s_tb->FR[0], n_child_position)),
2016 "PAP-8300: invalid child size of right neighbor (%d != %d - %d)", 2016 "PAP-8300: invalid child size of right neighbor (%d != %d - %d)",
2017 B_FREE_SPACE(p_s_bh), MAX_CHILD_SIZE(p_s_bh), 2017 B_FREE_SPACE(bh), MAX_CHILD_SIZE(bh),
2018 dc_size(B_N_CHILD(p_s_tb->FR[0], n_child_position))); 2018 dc_size(B_N_CHILD(p_s_tb->FR[0], n_child_position)));
2019 2019
2020 } 2020 }
@@ -2090,51 +2090,45 @@ static int get_mem_for_virtual_node(struct tree_balance *tb)
2090 2090
2091#ifdef CONFIG_REISERFS_CHECK 2091#ifdef CONFIG_REISERFS_CHECK
2092static void tb_buffer_sanity_check(struct super_block *sb, 2092static void tb_buffer_sanity_check(struct super_block *sb,
2093 struct buffer_head *p_s_bh, 2093 struct buffer_head *bh,
2094 const char *descr, int level) 2094 const char *descr, int level)
2095{ 2095{
2096 if (p_s_bh) { 2096 if (bh) {
2097 if (atomic_read(&(p_s_bh->b_count)) <= 0) { 2097 if (atomic_read(&(bh->b_count)) <= 0)
2098 2098
2099 reiserfs_panic(sb, "jmacd-1", "negative or zero " 2099 reiserfs_panic(sb, "jmacd-1", "negative or zero "
2100 "reference counter for buffer %s[%d] " 2100 "reference counter for buffer %s[%d] "
2101 "(%b)", descr, level, p_s_bh); 2101 "(%b)", descr, level, bh);
2102 }
2103 2102
2104 if (!buffer_uptodate(p_s_bh)) { 2103 if (!buffer_uptodate(bh))
2105 reiserfs_panic(sb, "jmacd-2", "buffer is not up " 2104 reiserfs_panic(sb, "jmacd-2", "buffer is not up "
2106 "to date %s[%d] (%b)", 2105 "to date %s[%d] (%b)",
2107 descr, level, p_s_bh); 2106 descr, level, bh);
2108 }
2109 2107
2110 if (!B_IS_IN_TREE(p_s_bh)) { 2108 if (!B_IS_IN_TREE(bh))
2111 reiserfs_panic(sb, "jmacd-3", "buffer is not " 2109 reiserfs_panic(sb, "jmacd-3", "buffer is not "
2112 "in tree %s[%d] (%b)", 2110 "in tree %s[%d] (%b)",
2113 descr, level, p_s_bh); 2111 descr, level, bh);
2114 }
2115 2112
2116 if (p_s_bh->b_bdev != sb->s_bdev) { 2113 if (bh->b_bdev != sb->s_bdev)
2117 reiserfs_panic(sb, "jmacd-4", "buffer has wrong " 2114 reiserfs_panic(sb, "jmacd-4", "buffer has wrong "
2118 "device %s[%d] (%b)", 2115 "device %s[%d] (%b)",
2119 descr, level, p_s_bh); 2116 descr, level, bh);
2120 }
2121 2117
2122 if (p_s_bh->b_size != sb->s_blocksize) { 2118 if (bh->b_size != sb->s_blocksize)
2123 reiserfs_panic(sb, "jmacd-5", "buffer has wrong " 2119 reiserfs_panic(sb, "jmacd-5", "buffer has wrong "
2124 "blocksize %s[%d] (%b)", 2120 "blocksize %s[%d] (%b)",
2125 descr, level, p_s_bh); 2121 descr, level, bh);
2126 }
2127 2122
2128 if (p_s_bh->b_blocknr > SB_BLOCK_COUNT(sb)) { 2123 if (bh->b_blocknr > SB_BLOCK_COUNT(sb))
2129 reiserfs_panic(sb, "jmacd-6", "buffer block " 2124 reiserfs_panic(sb, "jmacd-6", "buffer block "
2130 "number too high %s[%d] (%b)", 2125 "number too high %s[%d] (%b)",
2131 descr, level, p_s_bh); 2126 descr, level, bh);
2132 }
2133 } 2127 }
2134} 2128}
2135#else 2129#else
2136static void tb_buffer_sanity_check(struct super_block *sb, 2130static void tb_buffer_sanity_check(struct super_block *sb,
2137 struct buffer_head *p_s_bh, 2131 struct buffer_head *bh,
2138 const char *descr, int level) 2132 const char *descr, int level)
2139{; 2133{;
2140} 2134}