Commit a9dd3643 authored by Jeff Mahoney's avatar Jeff Mahoney Committed by Linus Torvalds

reiserfs: rename p_s_sb to sb

This patch is a simple s/p_s_sb/sb/g to the reiserfs code.  This is the
first in a series of patches to rip out some of the awful variable
naming in reiserfs.
Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0222e657
......@@ -785,7 +785,7 @@ static int get_empty_nodes(struct tree_balance *p_s_tb, int n_h)
b_blocknr_t *p_n_blocknr, a_n_blocknrs[MAX_AMOUNT_NEEDED] = { 0, };
int n_counter, n_number_of_freeblk, n_amount_needed, /* number of needed empty blocks */
n_retval = CARRY_ON;
struct super_block *p_s_sb = p_s_tb->tb_sb;
struct super_block *sb = p_s_tb->tb_sb;
/* number_of_freeblk is the number of empty blocks which have been
acquired for use by the balancing algorithm minus the number of
......@@ -830,7 +830,7 @@ static int get_empty_nodes(struct tree_balance *p_s_tb, int n_h)
RFALSE(!*p_n_blocknr,
"PAP-8135: reiserfs_new_blocknrs failed when got new blocks");
p_s_new_bh = sb_getblk(p_s_sb, *p_n_blocknr);
p_s_new_bh = sb_getblk(sb, *p_n_blocknr);
RFALSE(buffer_dirty(p_s_new_bh) ||
buffer_journaled(p_s_new_bh) ||
buffer_journal_dirty(p_s_new_bh),
......@@ -899,7 +899,7 @@ static int get_rfree(struct tree_balance *tb, int h)
static int is_left_neighbor_in_cache(struct tree_balance *p_s_tb, int n_h)
{
struct buffer_head *p_s_father, *left;
struct super_block *p_s_sb = p_s_tb->tb_sb;
struct super_block *sb = p_s_tb->tb_sb;
b_blocknr_t n_left_neighbor_blocknr;
int n_left_neighbor_position;
......@@ -924,7 +924,7 @@ static int is_left_neighbor_in_cache(struct tree_balance *p_s_tb, int n_h)
n_left_neighbor_blocknr =
B_N_CHILD_NUM(p_s_tb->FL[n_h], n_left_neighbor_position);
/* Look for the left neighbor in the cache. */
if ((left = sb_find_get_block(p_s_sb, n_left_neighbor_blocknr))) {
if ((left = sb_find_get_block(sb, n_left_neighbor_blocknr))) {
RFALSE(buffer_uptodate(left) && !B_IS_IN_TREE(left),
"vs-8170: left neighbor (%b %z) is not in the tree",
......@@ -1942,14 +1942,14 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
int n_child_position,
n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h + 1);
unsigned long n_son_number;
struct super_block *p_s_sb = p_s_tb->tb_sb;
struct super_block *sb = p_s_tb->tb_sb;
struct buffer_head *p_s_bh;
PROC_INFO_INC(p_s_sb, get_neighbors[n_h]);
PROC_INFO_INC(sb, get_neighbors[n_h]);
if (p_s_tb->lnum[n_h]) {
/* We need left neighbor to balance S[n_h]. */
PROC_INFO_INC(p_s_sb, need_l_neighbor[n_h]);
PROC_INFO_INC(sb, need_l_neighbor[n_h]);
p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset);
RFALSE(p_s_bh == p_s_tb->FL[n_h] &&
......@@ -1961,12 +1961,12 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
p_s_tb->FL[n_h]) ? p_s_tb->lkey[n_h] : B_NR_ITEMS(p_s_tb->
FL[n_h]);
n_son_number = B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position);
p_s_bh = sb_bread(p_s_sb, n_son_number);
p_s_bh = sb_bread(sb, n_son_number);
if (!p_s_bh)
return IO_ERROR;
if (FILESYSTEM_CHANGED_TB(p_s_tb)) {
brelse(p_s_bh);
PROC_INFO_INC(p_s_sb, get_neighbors_restart[n_h]);
PROC_INFO_INC(sb, get_neighbors_restart[n_h]);
return REPEAT_SEARCH;
}
......@@ -1986,7 +1986,7 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
}
if (p_s_tb->rnum[n_h]) { /* We need right neighbor to balance S[n_path_offset]. */
PROC_INFO_INC(p_s_sb, need_r_neighbor[n_h]);
PROC_INFO_INC(sb, need_r_neighbor[n_h]);
p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset);
RFALSE(p_s_bh == p_s_tb->FR[n_h] &&
......@@ -1998,12 +1998,12 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
n_child_position =
(p_s_bh == p_s_tb->FR[n_h]) ? p_s_tb->rkey[n_h] + 1 : 0;
n_son_number = B_N_CHILD_NUM(p_s_tb->FR[n_h], n_child_position);
p_s_bh = sb_bread(p_s_sb, n_son_number);
p_s_bh = sb_bread(sb, n_son_number);
if (!p_s_bh)
return IO_ERROR;
if (FILESYSTEM_CHANGED_TB(p_s_tb)) {
brelse(p_s_bh);
PROC_INFO_INC(p_s_sb, get_neighbors_restart[n_h]);
PROC_INFO_INC(sb, get_neighbors_restart[n_h]);
return REPEAT_SEARCH;
}
brelse(p_s_tb->R[n_h]);
......@@ -2089,51 +2089,51 @@ static int get_mem_for_virtual_node(struct tree_balance *tb)
}
#ifdef CONFIG_REISERFS_CHECK
static void tb_buffer_sanity_check(struct super_block *p_s_sb,
static void tb_buffer_sanity_check(struct super_block *sb,
struct buffer_head *p_s_bh,
const char *descr, int level)
{
if (p_s_bh) {
if (atomic_read(&(p_s_bh->b_count)) <= 0) {
reiserfs_panic(p_s_sb, "jmacd-1", "negative or zero "
reiserfs_panic(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", "buffer is not up "
reiserfs_panic(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", "buffer is not "
reiserfs_panic(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", "buffer has wrong "
if (p_s_bh->b_bdev != sb->s_bdev) {
reiserfs_panic(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", "buffer has wrong "
if (p_s_bh->b_size != sb->s_blocksize) {
reiserfs_panic(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", "buffer block "
if (p_s_bh->b_blocknr > SB_BLOCK_COUNT(sb)) {
reiserfs_panic(sb, "jmacd-6", "buffer block "
"number too high %s[%d] (%b)",
descr, level, p_s_bh);
}
}
}
#else
static void tb_buffer_sanity_check(struct super_block *p_s_sb,
static void tb_buffer_sanity_check(struct super_block *sb,
struct buffer_head *p_s_bh,
const char *descr, int level)
{;
......
This diff is collapsed.
This diff is collapsed.
......@@ -175,9 +175,9 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in
loff_t n_new_file_size, /* New file size. */
char *p_c_mode)
{
struct super_block *p_s_sb = p_s_inode->i_sb;
struct super_block *sb = p_s_inode->i_sb;
struct item_head s_ih;
unsigned long n_block_size = p_s_sb->s_blocksize;
unsigned long n_block_size = sb->s_blocksize;
char *tail;
int tail_len, round_tail_len;
loff_t pos, pos1; /* position of first byte of the tail */
......@@ -185,7 +185,7 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in
BUG_ON(!th->t_trans_id);
REISERFS_SB(p_s_sb)->s_indirect2direct++;
REISERFS_SB(sb)->s_indirect2direct++;
*p_c_mode = M_SKIP_BALANCING;
......@@ -200,7 +200,7 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in
pos =
le_ih_k_offset(&s_ih) - 1 + (ih_item_len(&s_ih) / UNFM_P_SIZE -
1) * p_s_sb->s_blocksize;
1) * sb->s_blocksize;
pos1 = pos;
// we are protected by i_mutex. The tail can not disapper, not
......@@ -211,18 +211,18 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in
if (path_changed(&s_ih, p_s_path)) {
/* re-search indirect item */
if (search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path)
if (search_for_position_by_key(sb, p_s_item_key, p_s_path)
== POSITION_NOT_FOUND)
reiserfs_panic(p_s_sb, "PAP-5520",
reiserfs_panic(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));
#ifdef CONFIG_REISERFS_CHECK
pos = le_ih_k_offset(&s_ih) - 1 +
(ih_item_len(&s_ih) / UNFM_P_SIZE -
1) * p_s_sb->s_blocksize;
1) * sb->s_blocksize;
if (pos != pos1)
reiserfs_panic(p_s_sb, "vs-5530", "tail position "
reiserfs_panic(sb, "vs-5530", "tail position "
"changed while we were reading it");
#endif
}
......
......@@ -1769,12 +1769,12 @@ int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *,
int journal_mark_freed(struct reiserfs_transaction_handle *,
struct super_block *, b_blocknr_t blocknr);
int journal_transaction_should_end(struct reiserfs_transaction_handle *, int);
int reiserfs_in_journal(struct super_block *p_s_sb, unsigned int bmap_nr,
int bit_nr, int searchall, b_blocknr_t *next);
int reiserfs_in_journal(struct super_block *sb, unsigned int bmap_nr,
int bit_nr, int searchall, b_blocknr_t *next);
int journal_begin(struct reiserfs_transaction_handle *,
struct super_block *p_s_sb, unsigned long);
struct super_block *sb, unsigned long);
int journal_join_abort(struct reiserfs_transaction_handle *,
struct super_block *p_s_sb, unsigned long);
struct super_block *sb, unsigned long);
void reiserfs_abort_journal(struct super_block *sb, int errno);
void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...);
int reiserfs_allocate_list_bitmaps(struct super_block *s,
......@@ -1830,11 +1830,11 @@ static inline void copy_key(struct reiserfs_key *to,
int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path);
const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
const struct super_block *p_s_sb);
const struct super_block *sb);
int search_by_key(struct super_block *, const struct cpu_key *,
struct treepath *, int);
#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL)
int search_for_position_by_key(struct super_block *p_s_sb,
int search_for_position_by_key(struct super_block *sb,
const struct cpu_key *p_s_cpu_key,
struct treepath *p_s_search_path);
extern void decrement_bcount(struct buffer_head *p_s_bh);
......@@ -1978,7 +1978,7 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset,
#define PROC_INFO_MAX( sb, field, value ) VOID_V
#define PROC_INFO_INC( sb, field ) VOID_V
#define PROC_INFO_ADD( sb, field, val ) VOID_V
#define PROC_INFO_BH_STAT( p_s_sb, p_s_bh, n_node_level ) VOID_V
#define PROC_INFO_BH_STAT(sb, p_s_bh, n_node_level) VOID_V
#endif
/* dir.c */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment