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) ...@@ -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, }; 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 */ int n_counter, n_number_of_freeblk, n_amount_needed, /* number of needed empty blocks */
n_retval = CARRY_ON; 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 /* number_of_freeblk is the number of empty blocks which have been
acquired for use by the balancing algorithm minus the number of 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) ...@@ -830,7 +830,7 @@ static int get_empty_nodes(struct tree_balance *p_s_tb, int n_h)
RFALSE(!*p_n_blocknr, RFALSE(!*p_n_blocknr,
"PAP-8135: reiserfs_new_blocknrs failed when got new blocks"); "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) || RFALSE(buffer_dirty(p_s_new_bh) ||
buffer_journaled(p_s_new_bh) || buffer_journaled(p_s_new_bh) ||
buffer_journal_dirty(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) ...@@ -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) static int is_left_neighbor_in_cache(struct tree_balance *p_s_tb, int n_h)
{ {
struct buffer_head *p_s_father, *left; 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; b_blocknr_t n_left_neighbor_blocknr;
int n_left_neighbor_position; 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) ...@@ -924,7 +924,7 @@ static int is_left_neighbor_in_cache(struct tree_balance *p_s_tb, int n_h)
n_left_neighbor_blocknr = n_left_neighbor_blocknr =
B_N_CHILD_NUM(p_s_tb->FL[n_h], n_left_neighbor_position); B_N_CHILD_NUM(p_s_tb->FL[n_h], n_left_neighbor_position);
/* Look for the left neighbor in the cache. */ /* 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), RFALSE(buffer_uptodate(left) && !B_IS_IN_TREE(left),
"vs-8170: left neighbor (%b %z) is not in the tree", "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) ...@@ -1942,14 +1942,14 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
int n_child_position, int n_child_position,
n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h + 1); n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h + 1);
unsigned long n_son_number; 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; 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]) { if (p_s_tb->lnum[n_h]) {
/* We need left neighbor to balance S[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); p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset);
RFALSE(p_s_bh == p_s_tb->FL[n_h] && 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) ...@@ -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-> p_s_tb->FL[n_h]) ? p_s_tb->lkey[n_h] : B_NR_ITEMS(p_s_tb->
FL[n_h]); FL[n_h]);
n_son_number = B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position); 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) if (!p_s_bh)
return IO_ERROR; return IO_ERROR;
if (FILESYSTEM_CHANGED_TB(p_s_tb)) { if (FILESYSTEM_CHANGED_TB(p_s_tb)) {
brelse(p_s_bh); 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; return REPEAT_SEARCH;
} }
...@@ -1986,7 +1986,7 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h) ...@@ -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]. */ 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); p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset);
RFALSE(p_s_bh == p_s_tb->FR[n_h] && 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) ...@@ -1998,12 +1998,12 @@ static int get_neighbors(struct tree_balance *p_s_tb, int n_h)
n_child_position = n_child_position =
(p_s_bh == p_s_tb->FR[n_h]) ? p_s_tb->rkey[n_h] + 1 : 0; (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); 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) if (!p_s_bh)
return IO_ERROR; return IO_ERROR;
if (FILESYSTEM_CHANGED_TB(p_s_tb)) { if (FILESYSTEM_CHANGED_TB(p_s_tb)) {
brelse(p_s_bh); 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; return REPEAT_SEARCH;
} }
brelse(p_s_tb->R[n_h]); brelse(p_s_tb->R[n_h]);
...@@ -2089,51 +2089,51 @@ static int get_mem_for_virtual_node(struct tree_balance *tb) ...@@ -2089,51 +2089,51 @@ static int get_mem_for_virtual_node(struct tree_balance *tb)
} }
#ifdef CONFIG_REISERFS_CHECK #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, struct buffer_head *p_s_bh,
const char *descr, int level) const char *descr, int level)
{ {
if (p_s_bh) { if (p_s_bh) {
if (atomic_read(&(p_s_bh->b_count)) <= 0) { 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] " "reference counter for buffer %s[%d] "
"(%b)", descr, level, p_s_bh); "(%b)", descr, level, p_s_bh);
} }
if (!buffer_uptodate(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)", "to date %s[%d] (%b)",
descr, level, p_s_bh); descr, level, p_s_bh);
} }
if (!B_IS_IN_TREE(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)", "in tree %s[%d] (%b)",
descr, level, p_s_bh); descr, level, p_s_bh);
} }
if (p_s_bh->b_bdev != p_s_sb->s_bdev) { if (p_s_bh->b_bdev != sb->s_bdev) {
reiserfs_panic(p_s_sb, "jmacd-4", "buffer has wrong " reiserfs_panic(sb, "jmacd-4", "buffer has wrong "
"device %s[%d] (%b)", "device %s[%d] (%b)",
descr, level, p_s_bh); descr, level, p_s_bh);
} }
if (p_s_bh->b_size != p_s_sb->s_blocksize) { if (p_s_bh->b_size != sb->s_blocksize) {
reiserfs_panic(p_s_sb, "jmacd-5", "buffer has wrong " reiserfs_panic(sb, "jmacd-5", "buffer has wrong "
"blocksize %s[%d] (%b)", "blocksize %s[%d] (%b)",
descr, level, p_s_bh); descr, level, p_s_bh);
} }
if (p_s_bh->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { if (p_s_bh->b_blocknr > SB_BLOCK_COUNT(sb)) {
reiserfs_panic(p_s_sb, "jmacd-6", "buffer block " reiserfs_panic(sb, "jmacd-6", "buffer block "
"number too high %s[%d] (%b)", "number too high %s[%d] (%b)",
descr, level, p_s_bh); descr, level, p_s_bh);
} }
} }
} }
#else #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, struct buffer_head *p_s_bh,
const char *descr, int level) const char *descr, int level)
{; {;
......
...@@ -97,7 +97,7 @@ static int flush_commit_list(struct super_block *s, ...@@ -97,7 +97,7 @@ static int flush_commit_list(struct super_block *s,
struct reiserfs_journal_list *jl, int flushall); struct reiserfs_journal_list *jl, int flushall);
static int can_dirty(struct reiserfs_journal_cnode *cn); static int can_dirty(struct reiserfs_journal_cnode *cn);
static int journal_join(struct reiserfs_transaction_handle *th, static int journal_join(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks); struct super_block *sb, unsigned long nblocks);
static int release_journal_dev(struct super_block *super, static int release_journal_dev(struct super_block *super,
struct reiserfs_journal *journal); struct reiserfs_journal *journal);
static int dirty_one_transaction(struct super_block *s, static int dirty_one_transaction(struct super_block *s,
...@@ -113,12 +113,12 @@ enum { ...@@ -113,12 +113,12 @@ enum {
}; };
static int do_journal_begin_r(struct reiserfs_transaction_handle *th, static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, struct super_block *sb,
unsigned long nblocks, int join); unsigned long nblocks, int join);
static void init_journal_hash(struct super_block *p_s_sb) static void init_journal_hash(struct super_block *sb)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
memset(journal->j_hash_table, 0, memset(journal->j_hash_table, 0,
JOURNAL_HASH_SIZE * sizeof(struct reiserfs_journal_cnode *)); JOURNAL_HASH_SIZE * sizeof(struct reiserfs_journal_cnode *));
} }
...@@ -145,7 +145,7 @@ static void disable_barrier(struct super_block *s) ...@@ -145,7 +145,7 @@ static void disable_barrier(struct super_block *s)
} }
static struct reiserfs_bitmap_node *allocate_bitmap_node(struct super_block static struct reiserfs_bitmap_node *allocate_bitmap_node(struct super_block
*p_s_sb) *sb)
{ {
struct reiserfs_bitmap_node *bn; struct reiserfs_bitmap_node *bn;
static int id; static int id;
...@@ -154,7 +154,7 @@ static struct reiserfs_bitmap_node *allocate_bitmap_node(struct super_block ...@@ -154,7 +154,7 @@ static struct reiserfs_bitmap_node *allocate_bitmap_node(struct super_block
if (!bn) { if (!bn) {
return NULL; return NULL;
} }
bn->data = kzalloc(p_s_sb->s_blocksize, GFP_NOFS); bn->data = kzalloc(sb->s_blocksize, GFP_NOFS);
if (!bn->data) { if (!bn->data) {
kfree(bn); kfree(bn);
return NULL; return NULL;
...@@ -164,9 +164,9 @@ static struct reiserfs_bitmap_node *allocate_bitmap_node(struct super_block ...@@ -164,9 +164,9 @@ static struct reiserfs_bitmap_node *allocate_bitmap_node(struct super_block
return bn; return bn;
} }
static struct reiserfs_bitmap_node *get_bitmap_node(struct super_block *p_s_sb) static struct reiserfs_bitmap_node *get_bitmap_node(struct super_block *sb)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_bitmap_node *bn = NULL; struct reiserfs_bitmap_node *bn = NULL;
struct list_head *entry = journal->j_bitmap_nodes.next; struct list_head *entry = journal->j_bitmap_nodes.next;
...@@ -176,21 +176,21 @@ static struct reiserfs_bitmap_node *get_bitmap_node(struct super_block *p_s_sb) ...@@ -176,21 +176,21 @@ static struct reiserfs_bitmap_node *get_bitmap_node(struct super_block *p_s_sb)
if (entry != &journal->j_bitmap_nodes) { if (entry != &journal->j_bitmap_nodes) {
bn = list_entry(entry, struct reiserfs_bitmap_node, list); bn = list_entry(entry, struct reiserfs_bitmap_node, list);
list_del(entry); list_del(entry);
memset(bn->data, 0, p_s_sb->s_blocksize); memset(bn->data, 0, sb->s_blocksize);
journal->j_free_bitmap_nodes--; journal->j_free_bitmap_nodes--;
return bn; return bn;
} }
bn = allocate_bitmap_node(p_s_sb); bn = allocate_bitmap_node(sb);
if (!bn) { if (!bn) {
yield(); yield();
goto repeat; goto repeat;
} }
return bn; return bn;
} }
static inline void free_bitmap_node(struct super_block *p_s_sb, static inline void free_bitmap_node(struct super_block *sb,
struct reiserfs_bitmap_node *bn) struct reiserfs_bitmap_node *bn)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
journal->j_used_bitmap_nodes--; journal->j_used_bitmap_nodes--;
if (journal->j_free_bitmap_nodes > REISERFS_MAX_BITMAP_NODES) { if (journal->j_free_bitmap_nodes > REISERFS_MAX_BITMAP_NODES) {
kfree(bn->data); kfree(bn->data);
...@@ -201,13 +201,13 @@ static inline void free_bitmap_node(struct super_block *p_s_sb, ...@@ -201,13 +201,13 @@ static inline void free_bitmap_node(struct super_block *p_s_sb,
} }
} }
static void allocate_bitmap_nodes(struct super_block *p_s_sb) static void allocate_bitmap_nodes(struct super_block *sb)
{ {
int i; int i;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_bitmap_node *bn = NULL; struct reiserfs_bitmap_node *bn = NULL;
for (i = 0; i < REISERFS_MIN_BITMAP_NODES; i++) { for (i = 0; i < REISERFS_MIN_BITMAP_NODES; i++) {
bn = allocate_bitmap_node(p_s_sb); bn = allocate_bitmap_node(sb);
if (bn) { if (bn) {
list_add(&bn->list, &journal->j_bitmap_nodes); list_add(&bn->list, &journal->j_bitmap_nodes);
journal->j_free_bitmap_nodes++; journal->j_free_bitmap_nodes++;
...@@ -217,30 +217,30 @@ static void allocate_bitmap_nodes(struct super_block *p_s_sb) ...@@ -217,30 +217,30 @@ static void allocate_bitmap_nodes(struct super_block *p_s_sb)
} }
} }
static int set_bit_in_list_bitmap(struct super_block *p_s_sb, static int set_bit_in_list_bitmap(struct super_block *sb,
b_blocknr_t block, b_blocknr_t block,
struct reiserfs_list_bitmap *jb) struct reiserfs_list_bitmap *jb)
{ {
unsigned int bmap_nr = block / (p_s_sb->s_blocksize << 3); unsigned int bmap_nr = block / (sb->s_blocksize << 3);
unsigned int bit_nr = block % (p_s_sb->s_blocksize << 3); unsigned int bit_nr = block % (sb->s_blocksize << 3);
if (!jb->bitmaps[bmap_nr]) { if (!jb->bitmaps[bmap_nr]) {
jb->bitmaps[bmap_nr] = get_bitmap_node(p_s_sb); jb->bitmaps[bmap_nr] = get_bitmap_node(sb);
} }
set_bit(bit_nr, (unsigned long *)jb->bitmaps[bmap_nr]->data); set_bit(bit_nr, (unsigned long *)jb->bitmaps[bmap_nr]->data);
return 0; return 0;
} }
static void cleanup_bitmap_list(struct super_block *p_s_sb, static void cleanup_bitmap_list(struct super_block *sb,
struct reiserfs_list_bitmap *jb) struct reiserfs_list_bitmap *jb)
{ {
int i; int i;
if (jb->bitmaps == NULL) if (jb->bitmaps == NULL)
return; return;
for (i = 0; i < reiserfs_bmap_count(p_s_sb); i++) { for (i = 0; i < reiserfs_bmap_count(sb); i++) {
if (jb->bitmaps[i]) { if (jb->bitmaps[i]) {
free_bitmap_node(p_s_sb, jb->bitmaps[i]); free_bitmap_node(sb, jb->bitmaps[i]);
jb->bitmaps[i] = NULL; jb->bitmaps[i] = NULL;
} }
} }
...@@ -249,7 +249,7 @@ static void cleanup_bitmap_list(struct super_block *p_s_sb, ...@@ -249,7 +249,7 @@ static void cleanup_bitmap_list(struct super_block *p_s_sb,
/* /*
** only call this on FS unmount. ** only call this on FS unmount.
*/ */
static int free_list_bitmaps(struct super_block *p_s_sb, static int free_list_bitmaps(struct super_block *sb,
struct reiserfs_list_bitmap *jb_array) struct reiserfs_list_bitmap *jb_array)
{ {
int i; int i;
...@@ -257,16 +257,16 @@ static int free_list_bitmaps(struct super_block *p_s_sb, ...@@ -257,16 +257,16 @@ static int free_list_bitmaps(struct super_block *p_s_sb,
for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) { for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) {
jb = jb_array + i; jb = jb_array + i;
jb->journal_list = NULL; jb->journal_list = NULL;
cleanup_bitmap_list(p_s_sb, jb); cleanup_bitmap_list(sb, jb);
vfree(jb->bitmaps); vfree(jb->bitmaps);
jb->bitmaps = NULL; jb->bitmaps = NULL;
} }
return 0; return 0;
} }
static int free_bitmap_nodes(struct super_block *p_s_sb) static int free_bitmap_nodes(struct super_block *sb)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct list_head *next = journal->j_bitmap_nodes.next; struct list_head *next = journal->j_bitmap_nodes.next;
struct reiserfs_bitmap_node *bn; struct reiserfs_bitmap_node *bn;
...@@ -286,7 +286,7 @@ static int free_bitmap_nodes(struct super_block *p_s_sb) ...@@ -286,7 +286,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. ** jb_array is the array to be filled in.
*/ */
int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, int reiserfs_allocate_list_bitmaps(struct super_block *sb,
struct reiserfs_list_bitmap *jb_array, struct reiserfs_list_bitmap *jb_array,
unsigned int bmap_nr) unsigned int bmap_nr)
{ {
...@@ -300,7 +300,7 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, ...@@ -300,7 +300,7 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb,
jb->journal_list = NULL; jb->journal_list = NULL;
jb->bitmaps = vmalloc(mem); jb->bitmaps = vmalloc(mem);
if (!jb->bitmaps) { if (!jb->bitmaps) {
reiserfs_warning(p_s_sb, "clm-2000", "unable to " reiserfs_warning(sb, "clm-2000", "unable to "
"allocate bitmaps for journal lists"); "allocate bitmaps for journal lists");
failed = 1; failed = 1;
break; break;
...@@ -308,7 +308,7 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, ...@@ -308,7 +308,7 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb,
memset(jb->bitmaps, 0, mem); memset(jb->bitmaps, 0, mem);
} }
if (failed) { if (failed) {
free_list_bitmaps(p_s_sb, jb_array); free_list_bitmaps(sb, jb_array);
return -1; return -1;
} }
return 0; return 0;
...@@ -318,12 +318,12 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, ...@@ -318,12 +318,12 @@ 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 ** and try again
*/ */
static struct reiserfs_list_bitmap *get_list_bitmap(struct super_block *p_s_sb, static struct reiserfs_list_bitmap *get_list_bitmap(struct super_block *sb,
struct reiserfs_journal_list struct reiserfs_journal_list
*jl) *jl)
{ {
int i, j; int i, j;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_list_bitmap *jb = NULL; struct reiserfs_list_bitmap *jb = NULL;
for (j = 0; j < (JOURNAL_NUM_BITMAPS * 3); j++) { for (j = 0; j < (JOURNAL_NUM_BITMAPS * 3); j++) {
...@@ -331,7 +331,7 @@ static struct reiserfs_list_bitmap *get_list_bitmap(struct super_block *p_s_sb, ...@@ -331,7 +331,7 @@ static struct reiserfs_list_bitmap *get_list_bitmap(struct super_block *p_s_sb,
journal->j_list_bitmap_index = (i + 1) % JOURNAL_NUM_BITMAPS; journal->j_list_bitmap_index = (i + 1) % JOURNAL_NUM_BITMAPS;
jb = journal->j_list_bitmap + i; jb = journal->j_list_bitmap + i;
if (journal->j_list_bitmap[i].journal_list) { if (journal->j_list_bitmap[i].journal_list) {
flush_commit_list(p_s_sb, flush_commit_list(sb,
journal->j_list_bitmap[i]. journal->j_list_bitmap[i].
journal_list, 1); journal_list, 1);
if (!journal->j_list_bitmap[i].journal_list) { if (!journal->j_list_bitmap[i].journal_list) {
...@@ -378,12 +378,12 @@ static struct reiserfs_journal_cnode *allocate_cnodes(int num_cnodes) ...@@ -378,12 +378,12 @@ 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) static struct reiserfs_journal_cnode *get_cnode(struct super_block *sb)
{ {
struct reiserfs_journal_cnode *cn; struct reiserfs_journal_cnode *cn;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
reiserfs_check_lock_depth(p_s_sb, "get_cnode"); reiserfs_check_lock_depth(sb, "get_cnode");
if (journal->j_cnode_free <= 0) { if (journal->j_cnode_free <= 0) {
return NULL; return NULL;
...@@ -405,12 +405,12 @@ static struct reiserfs_journal_cnode *get_cnode(struct super_block *p_s_sb) ...@@ -405,12 +405,12 @@ 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, static void free_cnode(struct super_block *sb,
struct reiserfs_journal_cnode *cn) struct reiserfs_journal_cnode *cn)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
reiserfs_check_lock_depth(p_s_sb, "free_cnode"); reiserfs_check_lock_depth(sb, "free_cnode");
journal->j_cnode_used--; journal->j_cnode_used--;
journal->j_cnode_free++; journal->j_cnode_free++;
...@@ -481,11 +481,11 @@ static inline struct reiserfs_journal_cnode *get_journal_hash_dev(struct ...@@ -481,11 +481,11 @@ static inline struct reiserfs_journal_cnode *get_journal_hash_dev(struct
** reject it on the next call to reiserfs_in_journal ** reject it on the next call to reiserfs_in_journal
** **
*/ */
int reiserfs_in_journal(struct super_block *p_s_sb, int reiserfs_in_journal(struct super_block *sb,
unsigned int bmap_nr, int bit_nr, int search_all, unsigned int bmap_nr, int bit_nr, int search_all,
b_blocknr_t * next_zero_bit) b_blocknr_t * next_zero_bit)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_journal_cnode *cn; struct reiserfs_journal_cnode *cn;
struct reiserfs_list_bitmap *jb; struct reiserfs_list_bitmap *jb;
int i; int i;
...@@ -493,14 +493,14 @@ int reiserfs_in_journal(struct super_block *p_s_sb, ...@@ -493,14 +493,14 @@ int reiserfs_in_journal(struct super_block *p_s_sb,
*next_zero_bit = 0; /* always start this at zero. */ *next_zero_bit = 0; /* always start this at zero. */
PROC_INFO_INC(p_s_sb, journal.in_journal); PROC_INFO_INC(sb, journal.in_journal);
/* If we aren't doing a search_all, this is a metablock, and it will be logged before use. /* If we aren't doing a search_all, this is a metablock, and it will be logged before use.
** if we crash before the transaction that freed it commits, this transaction won't ** if we crash before the transaction that freed it commits, this transaction won't
** have committed either, and the block will never be written ** have committed either, and the block will never be written
*/ */
if (search_all) { if (search_all) {
for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) { for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) {
PROC_INFO_INC(p_s_sb, journal.in_journal_bitmap); PROC_INFO_INC(sb, journal.in_journal_bitmap);
jb = journal->j_list_bitmap + i; jb = journal->j_list_bitmap + i;
if (jb->journal_list && jb->bitmaps[bmap_nr] && if (jb->journal_list && jb->bitmaps[bmap_nr] &&
test_bit(bit_nr, test_bit(bit_nr,
...@@ -510,28 +510,28 @@ int reiserfs_in_journal(struct super_block *p_s_sb, ...@@ -510,28 +510,28 @@ int reiserfs_in_journal(struct super_block *p_s_sb,
find_next_zero_bit((unsigned long *) find_next_zero_bit((unsigned long *)
(jb->bitmaps[bmap_nr]-> (jb->bitmaps[bmap_nr]->
data), data),
p_s_sb->s_blocksize << 3, sb->s_blocksize << 3,
bit_nr + 1); bit_nr + 1);
return 1; return 1;
} }
} }
} }
bl = bmap_nr * (p_s_sb->s_blocksize << 3) + bit_nr; bl = bmap_nr * (sb->s_blocksize << 3) + bit_nr;
/* is it in any old transactions? */ /* is it in any old transactions? */
if (search_all if (search_all
&& (cn = && (cn =
get_journal_hash_dev(p_s_sb, journal->j_list_hash_table, bl))) { get_journal_hash_dev(sb, journal->j_list_hash_table, bl))) {
return 1; return 1;
} }
/* is it in the current transaction. This should never happen */ /* is it in the current transaction. This should never happen */
if ((cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, bl))) { if ((cn = get_journal_hash_dev(sb, journal->j_hash_table, bl))) {
BUG(); BUG();
return 1; return 1;
} }
PROC_INFO_INC(p_s_sb, journal.in_journal_reusable); PROC_INFO_INC(sb, journal.in_journal_reusable);
/* safe for reuse */ /* safe for reuse */
return 0; return 0;
} }
...@@ -553,16 +553,16 @@ static inline void insert_journal_hash(struct reiserfs_journal_cnode **table, ...@@ -553,16 +553,16 @@ static inline void insert_journal_hash(struct reiserfs_journal_cnode **table,
} }
/* lock the current transaction */ /* lock the current transaction */
static inline void lock_journal(struct super_block *p_s_sb) static inline void lock_journal(struct super_block *sb)
{ {
PROC_INFO_INC(p_s_sb, journal.lock_journal); PROC_INFO_INC(sb, journal.lock_journal);
mutex_lock(&SB_JOURNAL(p_s_sb)->j_mutex); mutex_lock(&SB_JOURNAL(sb)->j_mutex);
} }
/* unlock the current transaction */ /* unlock the current transaction */
static inline void unlock_journal(struct super_block *p_s_sb) static inline void unlock_journal(struct super_block *sb)
{ {
mutex_unlock(&SB_JOURNAL(p_s_sb)->j_mutex); mutex_unlock(&SB_JOURNAL(sb)->j_mutex);
} }
static inline void get_journal_list(struct reiserfs_journal_list *jl) static inline void get_journal_list(struct reiserfs_journal_list *jl)
...@@ -586,13 +586,13 @@ static inline void put_journal_list(struct super_block *s, ...@@ -586,13 +586,13 @@ static inline void put_journal_list(struct super_block *s,
** it gets called by flush_commit_list, and cleans up any data stored about blocks freed during a ** it gets called by flush_commit_list, and cleans up any data stored about blocks freed during a
** transaction. ** transaction.
*/ */
static void cleanup_freed_for_journal_list(struct super_block *p_s_sb, static void cleanup_freed_for_journal_list(struct super_block *sb,
struct reiserfs_journal_list *jl) struct reiserfs_journal_list *jl)
{ {
struct reiserfs_list_bitmap *jb = jl->j_list_bitmap; struct reiserfs_list_bitmap *jb = jl->j_list_bitmap;
if (jb) { if (jb) {
cleanup_bitmap_list(p_s_sb, jb); cleanup_bitmap_list(sb, jb);
} }
jl->j_list_bitmap->journal_list = NULL; jl->j_list_bitmap->journal_list = NULL;
jl->j_list_bitmap = NULL; jl->j_list_bitmap = NULL;
...@@ -1237,11 +1237,11 @@ static void remove_journal_hash(struct super_block *, ...@@ -1237,11 +1237,11 @@ static void remove_journal_hash(struct super_block *,
** journal list for this transaction. Aside from freeing the cnode, this also allows the ** journal list for this transaction. Aside from freeing the cnode, this also allows the
** block to be reallocated for data blocks if it had been deleted. ** block to be reallocated for data blocks if it had been deleted.
*/ */
static void remove_all_from_journal_list(struct super_block *p_s_sb, static void remove_all_from_journal_list(struct super_block *sb,
struct reiserfs_journal_list *jl, struct reiserfs_journal_list *jl,
int debug) int debug)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_journal_cnode *cn, *last; struct reiserfs_journal_cnode *cn, *last;
cn = jl->j_realblock; cn = jl->j_realblock;
...@@ -1251,18 +1251,18 @@ static void remove_all_from_journal_list(struct super_block *p_s_sb, ...@@ -1251,18 +1251,18 @@ static void remove_all_from_journal_list(struct super_block *p_s_sb,
while (cn) { while (cn) {
if (cn->blocknr != 0) { if (cn->blocknr != 0) {
if (debug) { if (debug) {
reiserfs_warning(p_s_sb, "reiserfs-2201", reiserfs_warning(sb, "reiserfs-2201",
"block %u, bh is %d, state %ld", "block %u, bh is %d, state %ld",
cn->blocknr, cn->bh ? 1 : 0, cn->blocknr, cn->bh ? 1 : 0,
cn->state); cn->state);
} }
cn->state = 0; cn->state = 0;
remove_journal_hash(p_s_sb, journal->j_list_hash_table, remove_journal_hash(sb, journal->j_list_hash_table,
jl, cn->blocknr, 1); jl, cn->blocknr, 1);
} }
last = cn; last = cn;
cn = cn->next; cn = cn->next;
free_cnode(p_s_sb, last); free_cnode(sb, last);
} }
jl->j_realblock = NULL; jl->j_realblock = NULL;
} }
...@@ -1274,12 +1274,12 @@ static void remove_all_from_journal_list(struct super_block *p_s_sb, ...@@ -1274,12 +1274,12 @@ static void remove_all_from_journal_list(struct super_block *p_s_sb,
** called by flush_journal_list, before it calls remove_all_from_journal_list ** called by flush_journal_list, before it calls remove_all_from_journal_list
** **
*/ */
static int _update_journal_header_block(struct super_block *p_s_sb, static int _update_journal_header_block(struct super_block *sb,
unsigned long offset, unsigned long offset,
unsigned int trans_id) unsigned int trans_id)
{ {
struct reiserfs_journal_header *jh; struct reiserfs_journal_header *jh;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
if (reiserfs_is_journal_aborted(journal)) if (reiserfs_is_journal_aborted(journal))
return -EIO; return -EIO;
...@@ -1289,7 +1289,7 @@ static int _update_journal_header_block(struct super_block *p_s_sb, ...@@ -1289,7 +1289,7 @@ static int _update_journal_header_block(struct super_block *p_s_sb,
wait_on_buffer((journal->j_header_bh)); wait_on_buffer((journal->j_header_bh));
if (unlikely(!buffer_uptodate(journal->j_header_bh))) { if (unlikely(!buffer_uptodate(journal->j_header_bh))) {
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
reiserfs_warning(p_s_sb, "journal-699", reiserfs_warning(sb, "journal-699",
"buffer write failed"); "buffer write failed");
#endif #endif
return -EIO; return -EIO;
...@@ -1303,24 +1303,24 @@ static int _update_journal_header_block(struct super_block *p_s_sb, ...@@ -1303,24 +1303,24 @@ static int _update_journal_header_block(struct super_block *p_s_sb,
jh->j_first_unflushed_offset = cpu_to_le32(offset); jh->j_first_unflushed_offset = cpu_to_le32(offset);
jh->j_mount_id = cpu_to_le32(journal->j_mount_id); jh->j_mount_id = cpu_to_le32(journal->j_mount_id);
if (reiserfs_barrier_flush(p_s_sb)) { if (reiserfs_barrier_flush(sb)) {
int ret; int ret;
lock_buffer(journal->j_header_bh); lock_buffer(journal->j_header_bh);
ret = submit_barrier_buffer(journal->j_header_bh); ret = submit_barrier_buffer(journal->j_header_bh);
if (ret == -EOPNOTSUPP) { if (ret == -EOPNOTSUPP) {
set_buffer_uptodate(journal->j_header_bh); set_buffer_uptodate(journal->j_header_bh);
disable_barrier(p_s_sb); disable_barrier(sb);
goto sync; goto sync;
} }
wait_on_buffer(journal->j_header_bh); wait_on_buffer(journal->j_header_bh);
check_barrier_completion(p_s_sb, journal->j_header_bh); check_barrier_completion(sb, journal->j_header_bh);
} else { } else {
sync: sync:
set_buffer_dirty(journal->j_header_bh); set_buffer_dirty(journal->j_header_bh);
sync_dirty_buffer(journal->j_header_bh); sync_dirty_buffer(journal->j_header_bh);
} }
if (!buffer_uptodate(journal->j_header_bh)) { if (!buffer_uptodate(journal->j_header_bh)) {
reiserfs_warning(p_s_sb, "journal-837", reiserfs_warning(sb, "journal-837",
"IO error during journal replay"); "IO error during journal replay");
return -EIO; return -EIO;
} }
...@@ -1328,23 +1328,23 @@ static int _update_journal_header_block(struct super_block *p_s_sb, ...@@ -1328,23 +1328,23 @@ static int _update_journal_header_block(struct super_block *p_s_sb,
return 0; return 0;
} }
static int update_journal_header_block(struct super_block *p_s_sb, static int update_journal_header_block(struct super_block *sb,
unsigned long offset, unsigned long offset,
unsigned int trans_id) unsigned int trans_id)
{ {
return _update_journal_header_block(p_s_sb, offset, trans_id); return _update_journal_header_block(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 ** can only be called from flush_journal_list
*/ */
static int flush_older_journal_lists(struct super_block *p_s_sb, static int flush_older_journal_lists(struct super_block *sb,
struct reiserfs_journal_list *jl) struct reiserfs_journal_list *jl)
{ {
struct list_head *entry; struct list_head *entry;
struct reiserfs_journal_list *other_jl; struct reiserfs_journal_list *other_jl;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
unsigned int trans_id = jl->j_trans_id; unsigned int trans_id = jl->j_trans_id;
/* we know we are the only ones flushing things, no extra race /* we know we are the only ones flushing things, no extra race
...@@ -1359,7 +1359,7 @@ static int flush_older_journal_lists(struct super_block *p_s_sb, ...@@ -1359,7 +1359,7 @@ static int flush_older_journal_lists(struct super_block *p_s_sb,
if (other_jl->j_trans_id < trans_id) { if (other_jl->j_trans_id < trans_id) {
BUG_ON(other_jl->j_refcount <= 0); BUG_ON(other_jl->j_refcount <= 0);
/* do not flush all */ /* do not flush all */
flush_journal_list(p_s_sb, other_jl, 0); flush_journal_list(sb, other_jl, 0);
/* other_jl is now deleted from the list */ /* other_jl is now deleted from the list */
goto restart; goto restart;
...@@ -1908,22 +1908,22 @@ void remove_journal_hash(struct super_block *sb, ...@@ -1908,22 +1908,22 @@ void remove_journal_hash(struct super_block *sb,
} }
} }
static void free_journal_ram(struct super_block *p_s_sb) static void free_journal_ram(struct super_block *sb)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
kfree(journal->j_current_jl); kfree(journal->j_current_jl);
journal->j_num_lists--; journal->j_num_lists--;
vfree(journal->j_cnode_free_orig); vfree(journal->j_cnode_free_orig);
free_list_bitmaps(p_s_sb, journal->j_list_bitmap); free_list_bitmaps(sb, journal->j_list_bitmap);
free_bitmap_nodes(p_s_sb); /* must be after free_list_bitmaps */ free_bitmap_nodes(sb); /* must be after free_list_bitmaps */
if (journal->j_header_bh) { if (journal->j_header_bh) {
brelse(journal->j_header_bh); brelse(journal->j_header_bh);
} }
/* j_header_bh is on the journal dev, make sure not to release the journal /* j_header_bh is on the journal dev, make sure not to release the journal
* dev until we brelse j_header_bh * dev until we brelse j_header_bh
*/ */
release_journal_dev(p_s_sb, journal); release_journal_dev(sb, journal);
vfree(journal); vfree(journal);
} }
...@@ -1932,27 +1932,27 @@ static void free_journal_ram(struct super_block *p_s_sb) ...@@ -1932,27 +1932,27 @@ static void free_journal_ram(struct super_block *p_s_sb)
** of read_super() yet. Any other caller must keep error at 0. ** of read_super() yet. Any other caller must keep error at 0.
*/ */
static int do_journal_release(struct reiserfs_transaction_handle *th, static int do_journal_release(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, int error) struct super_block *sb, int error)
{ {
struct reiserfs_transaction_handle myth; struct reiserfs_transaction_handle myth;
int flushed = 0; int flushed = 0;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
/* we only want to flush out transactions if we were called with error == 0 /* we only want to flush out transactions if we were called with error == 0
*/ */
if (!error && !(p_s_sb->s_flags & MS_RDONLY)) { if (!error && !(sb->s_flags & MS_RDONLY)) {
/* end the current trans */ /* end the current trans */
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
do_journal_end(th, p_s_sb, 10, FLUSH_ALL); do_journal_end(th, sb, 10, FLUSH_ALL);
/* make sure something gets logged to force our way into the flush code */ /* make sure something gets logged to force our way into the flush code */
if (!journal_join(&myth, p_s_sb, 1)) { if (!journal_join(&myth, sb, 1)) {
reiserfs_prepare_for_journal(p_s_sb, reiserfs_prepare_for_journal(sb,
SB_BUFFER_WITH_SB(p_s_sb), SB_BUFFER_WITH_SB(sb),
1); 1);
journal_mark_dirty(&myth, p_s_sb, journal_mark_dirty(&myth, sb,
SB_BUFFER_WITH_SB(p_s_sb)); SB_BUFFER_WITH_SB(sb));
do_journal_end(&myth, p_s_sb, 1, FLUSH_ALL); do_journal_end(&myth, sb, 1, FLUSH_ALL);
flushed = 1; flushed = 1;
} }
} }
...@@ -1960,26 +1960,26 @@ static int do_journal_release(struct reiserfs_transaction_handle *th, ...@@ -1960,26 +1960,26 @@ static int do_journal_release(struct reiserfs_transaction_handle *th,
/* this also catches errors during the do_journal_end above */ /* this also catches errors during the do_journal_end above */
if (!error && reiserfs_is_journal_aborted(journal)) { if (!error && reiserfs_is_journal_aborted(journal)) {
memset(&myth, 0, sizeof(myth)); memset(&myth, 0, sizeof(myth));
if (!journal_join_abort(&myth, p_s_sb, 1)) { if (!journal_join_abort(&myth, sb, 1)) {
reiserfs_prepare_for_journal(p_s_sb, reiserfs_prepare_for_journal(sb,
SB_BUFFER_WITH_SB(p_s_sb), SB_BUFFER_WITH_SB(sb),
1); 1);
journal_mark_dirty(&myth, p_s_sb, journal_mark_dirty(&myth, sb,
SB_BUFFER_WITH_SB(p_s_sb)); SB_BUFFER_WITH_SB(sb));
do_journal_end(&myth, p_s_sb, 1, FLUSH_ALL); do_journal_end(&myth, sb, 1, FLUSH_ALL);
} }
} }
reiserfs_mounted_fs_count--; reiserfs_mounted_fs_count--;
/* wait for all commits to finish */ /* wait for all commits to finish */
cancel_delayed_work(&SB_JOURNAL(p_s_sb)->j_work); cancel_delayed_work(&SB_JOURNAL(sb)->j_work);
flush_workqueue(commit_wq); flush_workqueue(commit_wq);
if (!reiserfs_mounted_fs_count) { if (!reiserfs_mounted_fs_count) {
destroy_workqueue(commit_wq); destroy_workqueue(commit_wq);
commit_wq = NULL; commit_wq = NULL;
} }
free_journal_ram(p_s_sb); free_journal_ram(sb);
return 0; return 0;
} }
...@@ -1988,28 +1988,28 @@ static int do_journal_release(struct reiserfs_transaction_handle *th, ...@@ -1988,28 +1988,28 @@ static int do_journal_release(struct reiserfs_transaction_handle *th,
** call on unmount. flush all journal trans, release all alloc'd ram ** call on unmount. flush all journal trans, release all alloc'd ram
*/ */
int journal_release(struct reiserfs_transaction_handle *th, int journal_release(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb) struct super_block *sb)
{ {
return do_journal_release(th, p_s_sb, 0); return do_journal_release(th, sb, 0);
} }
/* /*
** only call from an error condition inside reiserfs_read_super! ** only call from an error condition inside reiserfs_read_super!
*/ */
int journal_release_error(struct reiserfs_transaction_handle *th, int journal_release_error(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb) struct super_block *sb)
{ {
return do_journal_release(th, p_s_sb, 1); return do_journal_release(th, sb, 1);
} }
/* compares description block with commit block. returns 1 if they differ, 0 if they are the same */ /* compares description block with commit block. returns 1 if they differ, 0 if they are the same */
static int journal_compare_desc_commit(struct super_block *p_s_sb, static int journal_compare_desc_commit(struct super_block *sb,
struct reiserfs_journal_desc *desc, struct reiserfs_journal_desc *desc,
struct reiserfs_journal_commit *commit) struct reiserfs_journal_commit *commit)
{ {
if (get_commit_trans_id(commit) != get_desc_trans_id(desc) || if (get_commit_trans_id(commit) != get_desc_trans_id(desc) ||
get_commit_trans_len(commit) != get_desc_trans_len(desc) || get_commit_trans_len(commit) != get_desc_trans_len(desc) ||
get_commit_trans_len(commit) > SB_JOURNAL(p_s_sb)->j_trans_max || get_commit_trans_len(commit) > SB_JOURNAL(sb)->j_trans_max ||
get_commit_trans_len(commit) <= 0) { get_commit_trans_len(commit) <= 0) {
return 1; return 1;
} }
...@@ -2020,7 +2020,7 @@ static int journal_compare_desc_commit(struct super_block *p_s_sb, ...@@ -2020,7 +2020,7 @@ static int journal_compare_desc_commit(struct super_block *p_s_sb,
** returns -1 if it found a corrupt commit 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, static int journal_transaction_is_valid(struct super_block *sb,
struct buffer_head *d_bh, struct buffer_head *d_bh,
unsigned int *oldest_invalid_trans_id, unsigned int *oldest_invalid_trans_id,
unsigned long *newest_mount_id) unsigned long *newest_mount_id)
...@@ -2038,7 +2038,7 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, ...@@ -2038,7 +2038,7 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb,
&& !memcmp(get_journal_desc_magic(d_bh), JOURNAL_DESC_MAGIC, 8)) { && !memcmp(get_journal_desc_magic(d_bh), JOURNAL_DESC_MAGIC, 8)) {
if (oldest_invalid_trans_id && *oldest_invalid_trans_id if (oldest_invalid_trans_id && *oldest_invalid_trans_id
&& get_desc_trans_id(desc) > *oldest_invalid_trans_id) { && get_desc_trans_id(desc) > *oldest_invalid_trans_id) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-986: transaction " "journal-986: transaction "
"is valid returning because trans_id %d is greater than " "is valid returning because trans_id %d is greater than "
"oldest_invalid %lu", "oldest_invalid %lu",
...@@ -2048,7 +2048,7 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, ...@@ -2048,7 +2048,7 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb,
} }
if (newest_mount_id if (newest_mount_id
&& *newest_mount_id > get_desc_mount_id(desc)) { && *newest_mount_id > get_desc_mount_id(desc)) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1087: transaction " "journal-1087: transaction "
"is valid returning because mount_id %d is less than " "is valid returning because mount_id %d is less than "
"newest_mount_id %lu", "newest_mount_id %lu",
...@@ -2056,37 +2056,37 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, ...@@ -2056,37 +2056,37 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb,
*newest_mount_id); *newest_mount_id);
return -1; return -1;
} }
if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) { if (get_desc_trans_len(desc) > SB_JOURNAL(sb)->j_trans_max) {
reiserfs_warning(p_s_sb, "journal-2018", reiserfs_warning(sb, "journal-2018",
"Bad transaction length %d " "Bad transaction length %d "
"encountered, ignoring transaction", "encountered, ignoring transaction",
get_desc_trans_len(desc)); get_desc_trans_len(desc));
return -1; return -1;
} }
offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb); offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(sb);
/* ok, we have a journal description block, lets see if the transaction was valid */ /* ok, we have a journal description block, lets see if the transaction was valid */
c_bh = c_bh =
journal_bread(p_s_sb, journal_bread(sb,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
((offset + get_desc_trans_len(desc) + ((offset + get_desc_trans_len(desc) +
1) % SB_ONDISK_JOURNAL_SIZE(p_s_sb))); 1) % SB_ONDISK_JOURNAL_SIZE(sb)));
if (!c_bh) if (!c_bh)
return 0; return 0;
commit = (struct reiserfs_journal_commit *)c_bh->b_data; commit = (struct reiserfs_journal_commit *)c_bh->b_data;
if (journal_compare_desc_commit(p_s_sb, desc, commit)) { if (journal_compare_desc_commit(sb, desc, commit)) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal_transaction_is_valid, commit offset %ld had bad " "journal_transaction_is_valid, commit offset %ld had bad "
"time %d or length %d", "time %d or length %d",
c_bh->b_blocknr - c_bh->b_blocknr -
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), SB_ONDISK_JOURNAL_1st_BLOCK(sb),
get_commit_trans_id(commit), get_commit_trans_id(commit),
get_commit_trans_len(commit)); get_commit_trans_len(commit));
brelse(c_bh); brelse(c_bh);
if (oldest_invalid_trans_id) { if (oldest_invalid_trans_id) {
*oldest_invalid_trans_id = *oldest_invalid_trans_id =
get_desc_trans_id(desc); get_desc_trans_id(desc);
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1004: " "journal-1004: "
"transaction_is_valid setting oldest invalid trans_id " "transaction_is_valid setting oldest invalid trans_id "
"to %d", "to %d",
...@@ -2095,11 +2095,11 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, ...@@ -2095,11 +2095,11 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb,
return -1; return -1;
} }
brelse(c_bh); brelse(c_bh);
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1006: found valid " "journal-1006: found valid "
"transaction start offset %llu, len %d id %d", "transaction start offset %llu, len %d id %d",
d_bh->b_blocknr - d_bh->b_blocknr -
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), SB_ONDISK_JOURNAL_1st_BLOCK(sb),
get_desc_trans_len(desc), get_desc_trans_len(desc),
get_desc_trans_id(desc)); get_desc_trans_id(desc));
return 1; return 1;
...@@ -2121,13 +2121,13 @@ static void brelse_array(struct buffer_head **heads, int num) ...@@ -2121,13 +2121,13 @@ static void brelse_array(struct buffer_head **heads, int num)
** this either reads in a replays a transaction, or returns because the transaction ** this either reads in a replays a transaction, or returns because the transaction
** is invalid, or too old. ** is invalid, or too old.
*/ */
static int journal_read_transaction(struct super_block *p_s_sb, static int journal_read_transaction(struct super_block *sb,
unsigned long cur_dblock, unsigned long cur_dblock,
unsigned long oldest_start, unsigned long oldest_start,
unsigned int oldest_trans_id, unsigned int oldest_trans_id,
unsigned long newest_mount_id) unsigned long newest_mount_id)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_journal_desc *desc; struct reiserfs_journal_desc *desc;
struct reiserfs_journal_commit *commit; struct reiserfs_journal_commit *commit;
unsigned int trans_id = 0; unsigned int trans_id = 0;
...@@ -2139,45 +2139,45 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2139,45 +2139,45 @@ static int journal_read_transaction(struct super_block *p_s_sb,
int i; int i;
int trans_half; int trans_half;
d_bh = journal_bread(p_s_sb, cur_dblock); d_bh = journal_bread(sb, cur_dblock);
if (!d_bh) if (!d_bh)
return 1; return 1;
desc = (struct reiserfs_journal_desc *)d_bh->b_data; desc = (struct reiserfs_journal_desc *)d_bh->b_data;
trans_offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb); trans_offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(sb);
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1037: " reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1037: "
"journal_read_transaction, offset %llu, len %d mount_id %d", "journal_read_transaction, offset %llu, len %d mount_id %d",
d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(sb),
get_desc_trans_len(desc), get_desc_mount_id(desc)); get_desc_trans_len(desc), get_desc_mount_id(desc));
if (get_desc_trans_id(desc) < oldest_trans_id) { if (get_desc_trans_id(desc) < oldest_trans_id) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1039: " reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1039: "
"journal_read_trans skipping because %lu is too old", "journal_read_trans skipping because %lu is too old",
cur_dblock - cur_dblock -
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb)); SB_ONDISK_JOURNAL_1st_BLOCK(sb));
brelse(d_bh); brelse(d_bh);
return 1; return 1;
} }
if (get_desc_mount_id(desc) != newest_mount_id) { if (get_desc_mount_id(desc) != newest_mount_id) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1146: " reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1146: "
"journal_read_trans skipping because %d is != " "journal_read_trans skipping because %d is != "
"newest_mount_id %lu", get_desc_mount_id(desc), "newest_mount_id %lu", get_desc_mount_id(desc),
newest_mount_id); newest_mount_id);
brelse(d_bh); brelse(d_bh);
return 1; return 1;
} }
c_bh = journal_bread(p_s_sb, SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + c_bh = journal_bread(sb, SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
((trans_offset + get_desc_trans_len(desc) + 1) % ((trans_offset + get_desc_trans_len(desc) + 1) %
SB_ONDISK_JOURNAL_SIZE(p_s_sb))); SB_ONDISK_JOURNAL_SIZE(sb)));
if (!c_bh) { if (!c_bh) {
brelse(d_bh); brelse(d_bh);
return 1; return 1;
} }
commit = (struct reiserfs_journal_commit *)c_bh->b_data; commit = (struct reiserfs_journal_commit *)c_bh->b_data;
if (journal_compare_desc_commit(p_s_sb, desc, commit)) { if (journal_compare_desc_commit(sb, desc, commit)) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal_read_transaction, " "journal_read_transaction, "
"commit offset %llu had bad time %d or length %d", "commit offset %llu had bad time %d or length %d",
c_bh->b_blocknr - c_bh->b_blocknr -
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), SB_ONDISK_JOURNAL_1st_BLOCK(sb),
get_commit_trans_id(commit), get_commit_trans_id(commit),
get_commit_trans_len(commit)); get_commit_trans_len(commit));
brelse(c_bh); brelse(c_bh);
...@@ -2195,30 +2195,30 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2195,30 +2195,30 @@ static int journal_read_transaction(struct super_block *p_s_sb,
brelse(d_bh); brelse(d_bh);
kfree(log_blocks); kfree(log_blocks);
kfree(real_blocks); kfree(real_blocks);
reiserfs_warning(p_s_sb, "journal-1169", reiserfs_warning(sb, "journal-1169",
"kmalloc failed, unable to mount FS"); "kmalloc failed, unable to mount FS");
return -1; return -1;
} }
/* get all the buffer heads */ /* get all the buffer heads */
trans_half = journal_trans_half(p_s_sb->s_blocksize); trans_half = journal_trans_half(sb->s_blocksize);
for (i = 0; i < get_desc_trans_len(desc); i++) { for (i = 0; i < get_desc_trans_len(desc); i++) {
log_blocks[i] = log_blocks[i] =
journal_getblk(p_s_sb, journal_getblk(sb,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
(trans_offset + 1 + (trans_offset + 1 +
i) % SB_ONDISK_JOURNAL_SIZE(p_s_sb)); i) % SB_ONDISK_JOURNAL_SIZE(sb));
if (i < trans_half) { if (i < trans_half) {
real_blocks[i] = real_blocks[i] =
sb_getblk(p_s_sb, sb_getblk(sb,
le32_to_cpu(desc->j_realblock[i])); le32_to_cpu(desc->j_realblock[i]));
} else { } else {
real_blocks[i] = real_blocks[i] =
sb_getblk(p_s_sb, sb_getblk(sb,
le32_to_cpu(commit-> le32_to_cpu(commit->
j_realblock[i - trans_half])); j_realblock[i - trans_half]));
} }
if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(sb)) {
reiserfs_warning(p_s_sb, "journal-1207", reiserfs_warning(sb, "journal-1207",
"REPLAY FAILURE fsck required! " "REPLAY FAILURE fsck required! "
"Block to replay is outside of " "Block to replay is outside of "
"filesystem"); "filesystem");
...@@ -2226,8 +2226,8 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2226,8 +2226,8 @@ static int journal_read_transaction(struct super_block *p_s_sb,
} }
/* make sure we don't try to replay onto log or reserved area */ /* make sure we don't try to replay onto log or reserved area */
if (is_block_in_log_or_reserved_area if (is_block_in_log_or_reserved_area
(p_s_sb, real_blocks[i]->b_blocknr)) { (sb, real_blocks[i]->b_blocknr)) {
reiserfs_warning(p_s_sb, "journal-1204", reiserfs_warning(sb, "journal-1204",
"REPLAY FAILURE fsck required! " "REPLAY FAILURE fsck required! "
"Trying to replay onto a log block"); "Trying to replay onto a log block");
abort_replay: abort_replay:
...@@ -2245,7 +2245,7 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2245,7 +2245,7 @@ static int journal_read_transaction(struct super_block *p_s_sb,
for (i = 0; i < get_desc_trans_len(desc); i++) { for (i = 0; i < get_desc_trans_len(desc); i++) {
wait_on_buffer(log_blocks[i]); wait_on_buffer(log_blocks[i]);
if (!buffer_uptodate(log_blocks[i])) { if (!buffer_uptodate(log_blocks[i])) {
reiserfs_warning(p_s_sb, "journal-1212", reiserfs_warning(sb, "journal-1212",
"REPLAY FAILURE fsck required! " "REPLAY FAILURE fsck required! "
"buffer write failed"); "buffer write failed");
brelse_array(log_blocks + i, brelse_array(log_blocks + i,
...@@ -2270,7 +2270,7 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2270,7 +2270,7 @@ static int journal_read_transaction(struct super_block *p_s_sb,
for (i = 0; i < get_desc_trans_len(desc); i++) { for (i = 0; i < get_desc_trans_len(desc); i++) {
wait_on_buffer(real_blocks[i]); wait_on_buffer(real_blocks[i]);
if (!buffer_uptodate(real_blocks[i])) { if (!buffer_uptodate(real_blocks[i])) {
reiserfs_warning(p_s_sb, "journal-1226", reiserfs_warning(sb, "journal-1226",
"REPLAY FAILURE, fsck required! " "REPLAY FAILURE, fsck required! "
"buffer write failed"); "buffer write failed");
brelse_array(real_blocks + i, brelse_array(real_blocks + i,
...@@ -2284,15 +2284,15 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2284,15 +2284,15 @@ static int journal_read_transaction(struct super_block *p_s_sb,
brelse(real_blocks[i]); brelse(real_blocks[i]);
} }
cur_dblock = cur_dblock =
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
((trans_offset + get_desc_trans_len(desc) + ((trans_offset + get_desc_trans_len(desc) +
2) % SB_ONDISK_JOURNAL_SIZE(p_s_sb)); 2) % SB_ONDISK_JOURNAL_SIZE(sb));
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1095: setting journal " "start to offset %ld", "journal-1095: setting journal " "start to offset %ld",
cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb)); cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(sb));
/* init starting values for the first transaction, in case this is the last transaction to be replayed. */ /* init starting values for the first transaction, in case this is the last transaction to be replayed. */
journal->j_start = cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb); journal->j_start = cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(sb);
journal->j_last_flush_trans_id = trans_id; journal->j_last_flush_trans_id = trans_id;
journal->j_trans_id = trans_id + 1; journal->j_trans_id = trans_id + 1;
/* check for trans_id overflow */ /* check for trans_id overflow */
...@@ -2357,9 +2357,9 @@ static struct buffer_head *reiserfs_breada(struct block_device *dev, ...@@ -2357,9 +2357,9 @@ static struct buffer_head *reiserfs_breada(struct block_device *dev,
** **
** On exit, it sets things up so the first transaction will work correctly. ** On exit, it sets things up so the first transaction will work correctly.
*/ */
static int journal_read(struct super_block *p_s_sb) static int journal_read(struct super_block *sb)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_journal_desc *desc; struct reiserfs_journal_desc *desc;
unsigned int oldest_trans_id = 0; unsigned int oldest_trans_id = 0;
unsigned int oldest_invalid_trans_id = 0; unsigned int oldest_invalid_trans_id = 0;
...@@ -2375,8 +2375,8 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2375,8 +2375,8 @@ static int journal_read(struct super_block *p_s_sb)
int ret; int ret;
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb); cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(sb);
reiserfs_info(p_s_sb, "checking transaction log (%s)\n", reiserfs_info(sb, "checking transaction log (%s)\n",
bdevname(journal->j_dev_bd, b)); bdevname(journal->j_dev_bd, b));
start = get_seconds(); start = get_seconds();
...@@ -2384,22 +2384,22 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2384,22 +2384,22 @@ static int journal_read(struct super_block *p_s_sb)
** is the first unflushed, and if that transaction is not valid, ** is the first unflushed, and if that transaction is not valid,
** replay is done ** replay is done
*/ */
journal->j_header_bh = journal_bread(p_s_sb, journal->j_header_bh = journal_bread(sb,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) SB_ONDISK_JOURNAL_1st_BLOCK(sb)
+ SB_ONDISK_JOURNAL_SIZE(p_s_sb)); + SB_ONDISK_JOURNAL_SIZE(sb));
if (!journal->j_header_bh) { if (!journal->j_header_bh) {
return 1; return 1;
} }
jh = (struct reiserfs_journal_header *)(journal->j_header_bh->b_data); jh = (struct reiserfs_journal_header *)(journal->j_header_bh->b_data);
if (le32_to_cpu(jh->j_first_unflushed_offset) < if (le32_to_cpu(jh->j_first_unflushed_offset) <
SB_ONDISK_JOURNAL_SIZE(p_s_sb) SB_ONDISK_JOURNAL_SIZE(sb)
&& le32_to_cpu(jh->j_last_flush_trans_id) > 0) { && le32_to_cpu(jh->j_last_flush_trans_id) > 0) {
oldest_start = oldest_start =
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
le32_to_cpu(jh->j_first_unflushed_offset); le32_to_cpu(jh->j_first_unflushed_offset);
oldest_trans_id = le32_to_cpu(jh->j_last_flush_trans_id) + 1; oldest_trans_id = le32_to_cpu(jh->j_last_flush_trans_id) + 1;
newest_mount_id = le32_to_cpu(jh->j_mount_id); newest_mount_id = le32_to_cpu(jh->j_mount_id);
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1153: found in " "journal-1153: found in "
"header: first_unflushed_offset %d, last_flushed_trans_id " "header: first_unflushed_offset %d, last_flushed_trans_id "
"%lu", le32_to_cpu(jh->j_first_unflushed_offset), "%lu", le32_to_cpu(jh->j_first_unflushed_offset),
...@@ -2411,10 +2411,10 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2411,10 +2411,10 @@ static int journal_read(struct super_block *p_s_sb)
** through the whole log. ** through the whole log.
*/ */
d_bh = d_bh =
journal_bread(p_s_sb, journal_bread(sb,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
le32_to_cpu(jh->j_first_unflushed_offset)); le32_to_cpu(jh->j_first_unflushed_offset));
ret = journal_transaction_is_valid(p_s_sb, d_bh, NULL, NULL); ret = journal_transaction_is_valid(sb, d_bh, NULL, NULL);
if (!ret) { if (!ret) {
continue_replay = 0; continue_replay = 0;
} }
...@@ -2422,8 +2422,8 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2422,8 +2422,8 @@ static int journal_read(struct super_block *p_s_sb)
goto start_log_replay; goto start_log_replay;
} }
if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) { if (continue_replay && bdev_read_only(sb->s_bdev)) {
reiserfs_warning(p_s_sb, "clm-2076", reiserfs_warning(sb, "clm-2076",
"device is readonly, unable to replay log"); "device is readonly, unable to replay log");
return -1; return -1;
} }
...@@ -2433,17 +2433,17 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2433,17 +2433,17 @@ static int journal_read(struct super_block *p_s_sb)
*/ */
while (continue_replay while (continue_replay
&& cur_dblock < && cur_dblock <
(SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + (SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
SB_ONDISK_JOURNAL_SIZE(p_s_sb))) { SB_ONDISK_JOURNAL_SIZE(sb))) {
/* Note that it is required for blocksize of primary fs device and journal /* Note that it is required for blocksize of primary fs device and journal
device to be the same */ device to be the same */
d_bh = d_bh =
reiserfs_breada(journal->j_dev_bd, cur_dblock, reiserfs_breada(journal->j_dev_bd, cur_dblock,
p_s_sb->s_blocksize, sb->s_blocksize,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
SB_ONDISK_JOURNAL_SIZE(p_s_sb)); SB_ONDISK_JOURNAL_SIZE(sb));
ret = ret =
journal_transaction_is_valid(p_s_sb, d_bh, journal_transaction_is_valid(sb, d_bh,
&oldest_invalid_trans_id, &oldest_invalid_trans_id,
&newest_mount_id); &newest_mount_id);
if (ret == 1) { if (ret == 1) {
...@@ -2452,26 +2452,26 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2452,26 +2452,26 @@ static int journal_read(struct super_block *p_s_sb)
oldest_trans_id = get_desc_trans_id(desc); oldest_trans_id = get_desc_trans_id(desc);
oldest_start = d_bh->b_blocknr; oldest_start = d_bh->b_blocknr;
newest_mount_id = get_desc_mount_id(desc); newest_mount_id = get_desc_mount_id(desc);
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1179: Setting " "journal-1179: Setting "
"oldest_start to offset %llu, trans_id %lu", "oldest_start to offset %llu, trans_id %lu",
oldest_start - oldest_start -
SB_ONDISK_JOURNAL_1st_BLOCK SB_ONDISK_JOURNAL_1st_BLOCK
(p_s_sb), oldest_trans_id); (sb), oldest_trans_id);
} else if (oldest_trans_id > get_desc_trans_id(desc)) { } else if (oldest_trans_id > get_desc_trans_id(desc)) {
/* one we just read was older */ /* one we just read was older */
oldest_trans_id = get_desc_trans_id(desc); oldest_trans_id = get_desc_trans_id(desc);
oldest_start = d_bh->b_blocknr; oldest_start = d_bh->b_blocknr;
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1180: Resetting " "journal-1180: Resetting "
"oldest_start to offset %lu, trans_id %lu", "oldest_start to offset %lu, trans_id %lu",
oldest_start - oldest_start -
SB_ONDISK_JOURNAL_1st_BLOCK SB_ONDISK_JOURNAL_1st_BLOCK
(p_s_sb), oldest_trans_id); (sb), oldest_trans_id);
} }
if (newest_mount_id < get_desc_mount_id(desc)) { if (newest_mount_id < get_desc_mount_id(desc)) {
newest_mount_id = get_desc_mount_id(desc); newest_mount_id = get_desc_mount_id(desc);
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1299: Setting " "journal-1299: Setting "
"newest_mount_id to %d", "newest_mount_id to %d",
get_desc_mount_id(desc)); get_desc_mount_id(desc));
...@@ -2486,17 +2486,17 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2486,17 +2486,17 @@ static int journal_read(struct super_block *p_s_sb)
start_log_replay: start_log_replay:
cur_dblock = oldest_start; cur_dblock = oldest_start;
if (oldest_trans_id) { if (oldest_trans_id) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1206: Starting replay " "journal-1206: Starting replay "
"from offset %llu, trans_id %lu", "from offset %llu, trans_id %lu",
cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(sb),
oldest_trans_id); oldest_trans_id);
} }
replay_count = 0; replay_count = 0;
while (continue_replay && oldest_trans_id > 0) { while (continue_replay && oldest_trans_id > 0) {
ret = ret =
journal_read_transaction(p_s_sb, cur_dblock, oldest_start, journal_read_transaction(sb, cur_dblock, oldest_start,
oldest_trans_id, newest_mount_id); oldest_trans_id, newest_mount_id);
if (ret < 0) { if (ret < 0) {
return ret; return ret;
...@@ -2504,14 +2504,14 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2504,14 +2504,14 @@ static int journal_read(struct super_block *p_s_sb)
break; break;
} }
cur_dblock = cur_dblock =
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + journal->j_start; SB_ONDISK_JOURNAL_1st_BLOCK(sb) + journal->j_start;
replay_count++; replay_count++;
if (cur_dblock == oldest_start) if (cur_dblock == oldest_start)
break; break;
} }
if (oldest_trans_id == 0) { if (oldest_trans_id == 0) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"journal-1225: No valid " "transactions found"); "journal-1225: No valid " "transactions found");
} }
/* j_start does not get set correctly if we don't replay any transactions. /* j_start does not get set correctly if we don't replay any transactions.
...@@ -2531,16 +2531,16 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2531,16 +2531,16 @@ static int journal_read(struct super_block *p_s_sb)
} else { } else {
journal->j_mount_id = newest_mount_id + 1; journal->j_mount_id = newest_mount_id + 1;
} }
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1299: Setting " reiserfs_debug(sb, REISERFS_DEBUG_CODE, "journal-1299: Setting "
"newest_mount_id to %lu", journal->j_mount_id); "newest_mount_id to %lu", journal->j_mount_id);
journal->j_first_unflushed_offset = journal->j_start; journal->j_first_unflushed_offset = journal->j_start;
if (replay_count > 0) { if (replay_count > 0) {
reiserfs_info(p_s_sb, reiserfs_info(sb,
"replayed %d transactions in %lu seconds\n", "replayed %d transactions in %lu seconds\n",
replay_count, get_seconds() - start); replay_count, get_seconds() - start);
} }
if (!bdev_read_only(p_s_sb->s_bdev) && if (!bdev_read_only(sb->s_bdev) &&
_update_journal_header_block(p_s_sb, journal->j_start, _update_journal_header_block(sb, journal->j_start,
journal->j_last_flush_trans_id)) { journal->j_last_flush_trans_id)) {
/* replay failed, caller must call free_journal_ram and abort /* replay failed, caller must call free_journal_ram and abort
** the mount ** the mount
...@@ -2565,9 +2565,9 @@ static struct reiserfs_journal_list *alloc_journal_list(struct super_block *s) ...@@ -2565,9 +2565,9 @@ static struct reiserfs_journal_list *alloc_journal_list(struct super_block *s)
return jl; return jl;
} }
static void journal_list_init(struct super_block *p_s_sb) static void journal_list_init(struct super_block *sb)
{ {
SB_JOURNAL(p_s_sb)->j_current_jl = alloc_journal_list(p_s_sb); SB_JOURNAL(sb)->j_current_jl = alloc_journal_list(sb);
} }
static int release_journal_dev(struct super_block *super, static int release_journal_dev(struct super_block *super,
...@@ -2666,28 +2666,28 @@ static int journal_init_dev(struct super_block *super, ...@@ -2666,28 +2666,28 @@ static int journal_init_dev(struct super_block *super,
*/ */
#define REISERFS_STANDARD_BLKSIZE (4096) #define REISERFS_STANDARD_BLKSIZE (4096)
static int check_advise_trans_params(struct super_block *p_s_sb, static int check_advise_trans_params(struct super_block *sb,
struct reiserfs_journal *journal) struct reiserfs_journal *journal)
{ {
if (journal->j_trans_max) { if (journal->j_trans_max) {
/* Non-default journal params. /* Non-default journal params.
Do sanity check for them. */ Do sanity check for them. */
int ratio = 1; int ratio = 1;
if (p_s_sb->s_blocksize < REISERFS_STANDARD_BLKSIZE) if (sb->s_blocksize < REISERFS_STANDARD_BLKSIZE)
ratio = REISERFS_STANDARD_BLKSIZE / p_s_sb->s_blocksize; ratio = REISERFS_STANDARD_BLKSIZE / sb->s_blocksize;
if (journal->j_trans_max > JOURNAL_TRANS_MAX_DEFAULT / ratio || if (journal->j_trans_max > JOURNAL_TRANS_MAX_DEFAULT / ratio ||
journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio || journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio ||
SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max < SB_ONDISK_JOURNAL_SIZE(sb) / journal->j_trans_max <
JOURNAL_MIN_RATIO) { JOURNAL_MIN_RATIO) {
reiserfs_warning(p_s_sb, "sh-462", reiserfs_warning(sb, "sh-462",
"bad transaction max size (%u). " "bad transaction max size (%u). "
"FSCK?", journal->j_trans_max); "FSCK?", journal->j_trans_max);
return 1; return 1;
} }
if (journal->j_max_batch != (journal->j_trans_max) * if (journal->j_max_batch != (journal->j_trans_max) *
JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) { JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) {
reiserfs_warning(p_s_sb, "sh-463", reiserfs_warning(sb, "sh-463",
"bad transaction max batch (%u). " "bad transaction max batch (%u). "
"FSCK?", journal->j_max_batch); "FSCK?", journal->j_max_batch);
return 1; return 1;
...@@ -2697,9 +2697,9 @@ static int check_advise_trans_params(struct super_block *p_s_sb, ...@@ -2697,9 +2697,9 @@ static int check_advise_trans_params(struct super_block *p_s_sb,
The file system was created by old version The file system was created by old version
of mkreiserfs, so some fields contain zeros, of mkreiserfs, so some fields contain zeros,
and we need to advise proper values for them */ and we need to advise proper values for them */
if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) { if (sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) {
reiserfs_warning(p_s_sb, "sh-464", "bad blocksize (%u)", reiserfs_warning(sb, "sh-464", "bad blocksize (%u)",
p_s_sb->s_blocksize); sb->s_blocksize);
return 1; return 1;
} }
journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT; journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT;
...@@ -2712,10 +2712,10 @@ static int check_advise_trans_params(struct super_block *p_s_sb, ...@@ -2712,10 +2712,10 @@ static int check_advise_trans_params(struct super_block *p_s_sb,
/* /*
** must be called once on fs mount. calls journal_read for you ** must be called once on fs mount. calls journal_read for you
*/ */
int journal_init(struct super_block *p_s_sb, const char *j_dev_name, int journal_init(struct super_block *sb, const char *j_dev_name,
int old_format, unsigned int commit_max_age) int old_format, unsigned int commit_max_age)
{ {
int num_cnodes = SB_ONDISK_JOURNAL_SIZE(p_s_sb) * 2; int num_cnodes = SB_ONDISK_JOURNAL_SIZE(sb) * 2;
struct buffer_head *bhjh; struct buffer_head *bhjh;
struct reiserfs_super_block *rs; struct reiserfs_super_block *rs;
struct reiserfs_journal_header *jh; struct reiserfs_journal_header *jh;
...@@ -2723,9 +2723,9 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2723,9 +2723,9 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
struct reiserfs_journal_list *jl; struct reiserfs_journal_list *jl;
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal)); journal = SB_JOURNAL(sb) = vmalloc(sizeof(struct reiserfs_journal));
if (!journal) { if (!journal) {
reiserfs_warning(p_s_sb, "journal-1256", reiserfs_warning(sb, "journal-1256",
"unable to get memory for journal structure"); "unable to get memory for journal structure");
return 1; return 1;
} }
...@@ -2735,50 +2735,50 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2735,50 +2735,50 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
INIT_LIST_HEAD(&journal->j_working_list); INIT_LIST_HEAD(&journal->j_working_list);
INIT_LIST_HEAD(&journal->j_journal_list); INIT_LIST_HEAD(&journal->j_journal_list);
journal->j_persistent_trans = 0; journal->j_persistent_trans = 0;
if (reiserfs_allocate_list_bitmaps(p_s_sb, if (reiserfs_allocate_list_bitmaps(sb,
journal->j_list_bitmap, journal->j_list_bitmap,
reiserfs_bmap_count(p_s_sb))) reiserfs_bmap_count(sb)))
goto free_and_return; goto free_and_return;
allocate_bitmap_nodes(p_s_sb); allocate_bitmap_nodes(sb);
/* reserved for journal area support */ /* reserved for journal area support */
SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) = (old_format ? SB_JOURNAL_1st_RESERVED_BLOCK(sb) = (old_format ?
REISERFS_OLD_DISK_OFFSET_IN_BYTES REISERFS_OLD_DISK_OFFSET_IN_BYTES
/ p_s_sb->s_blocksize + / sb->s_blocksize +
reiserfs_bmap_count(p_s_sb) + reiserfs_bmap_count(sb) +
1 : 1 :
REISERFS_DISK_OFFSET_IN_BYTES / REISERFS_DISK_OFFSET_IN_BYTES /
p_s_sb->s_blocksize + 2); sb->s_blocksize + 2);
/* Sanity check to see is the standard journal fitting withing first bitmap /* Sanity check to see is the standard journal fitting withing first bitmap
(actual for small blocksizes) */ (actual for small blocksizes) */
if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) && if (!SB_ONDISK_JOURNAL_DEVICE(sb) &&
(SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) + (SB_JOURNAL_1st_RESERVED_BLOCK(sb) +
SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) { SB_ONDISK_JOURNAL_SIZE(sb) > sb->s_blocksize * 8)) {
reiserfs_warning(p_s_sb, "journal-1393", reiserfs_warning(sb, "journal-1393",
"journal does not fit for area addressed " "journal does not fit for area addressed "
"by first of bitmap blocks. It starts at " "by first of bitmap blocks. It starts at "
"%u and its size is %u. Block size %ld", "%u and its size is %u. Block size %ld",
SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb), SB_JOURNAL_1st_RESERVED_BLOCK(sb),
SB_ONDISK_JOURNAL_SIZE(p_s_sb), SB_ONDISK_JOURNAL_SIZE(sb),
p_s_sb->s_blocksize); sb->s_blocksize);
goto free_and_return; goto free_and_return;
} }
if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) { if (journal_init_dev(sb, journal, j_dev_name) != 0) {
reiserfs_warning(p_s_sb, "sh-462", reiserfs_warning(sb, "sh-462",
"unable to initialize jornal device"); "unable to initialize jornal device");
goto free_and_return; goto free_and_return;
} }
rs = SB_DISK_SUPER_BLOCK(p_s_sb); rs = SB_DISK_SUPER_BLOCK(sb);
/* read journal header */ /* read journal header */
bhjh = journal_bread(p_s_sb, bhjh = journal_bread(sb,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
SB_ONDISK_JOURNAL_SIZE(p_s_sb)); SB_ONDISK_JOURNAL_SIZE(sb));
if (!bhjh) { if (!bhjh) {
reiserfs_warning(p_s_sb, "sh-459", reiserfs_warning(sb, "sh-459",
"unable to read journal header"); "unable to read journal header");
goto free_and_return; goto free_and_return;
} }
...@@ -2788,7 +2788,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2788,7 +2788,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
if (is_reiserfs_jr(rs) if (is_reiserfs_jr(rs)
&& (le32_to_cpu(jh->jh_journal.jp_journal_magic) != && (le32_to_cpu(jh->jh_journal.jp_journal_magic) !=
sb_jp_journal_magic(rs))) { sb_jp_journal_magic(rs))) {
reiserfs_warning(p_s_sb, "sh-460", reiserfs_warning(sb, "sh-460",
"journal header magic %x (device %s) does " "journal header magic %x (device %s) does "
"not match to magic found in super block %x", "not match to magic found in super block %x",
jh->jh_journal.jp_journal_magic, jh->jh_journal.jp_journal_magic,
...@@ -2804,7 +2804,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2804,7 +2804,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
le32_to_cpu(jh->jh_journal.jp_journal_max_commit_age); le32_to_cpu(jh->jh_journal.jp_journal_max_commit_age);
journal->j_max_trans_age = JOURNAL_MAX_TRANS_AGE; journal->j_max_trans_age = JOURNAL_MAX_TRANS_AGE;
if (check_advise_trans_params(p_s_sb, journal) != 0) if (check_advise_trans_params(sb, journal) != 0)
goto free_and_return; goto free_and_return;
journal->j_default_max_commit_age = journal->j_max_commit_age; journal->j_default_max_commit_age = journal->j_max_commit_age;
...@@ -2813,12 +2813,12 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2813,12 +2813,12 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
journal->j_max_trans_age = commit_max_age; journal->j_max_trans_age = commit_max_age;
} }
reiserfs_info(p_s_sb, "journal params: device %s, size %u, " reiserfs_info(sb, "journal params: device %s, size %u, "
"journal first block %u, max trans len %u, max batch %u, " "journal first block %u, max trans len %u, max batch %u, "
"max commit age %u, max trans age %u\n", "max commit age %u, max trans age %u\n",
bdevname(journal->j_dev_bd, b), bdevname(journal->j_dev_bd, b),
SB_ONDISK_JOURNAL_SIZE(p_s_sb), SB_ONDISK_JOURNAL_SIZE(sb),
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), SB_ONDISK_JOURNAL_1st_BLOCK(sb),
journal->j_trans_max, journal->j_trans_max,
journal->j_max_batch, journal->j_max_batch,
journal->j_max_commit_age, journal->j_max_trans_age); journal->j_max_commit_age, journal->j_max_trans_age);
...@@ -2826,7 +2826,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2826,7 +2826,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
brelse(bhjh); brelse(bhjh);
journal->j_list_bitmap_index = 0; journal->j_list_bitmap_index = 0;
journal_list_init(p_s_sb); journal_list_init(sb);
memset(journal->j_list_hash_table, 0, memset(journal->j_list_hash_table, 0,
JOURNAL_HASH_SIZE * sizeof(struct reiserfs_journal_cnode *)); JOURNAL_HASH_SIZE * sizeof(struct reiserfs_journal_cnode *));
...@@ -2858,7 +2858,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2858,7 +2858,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
journal->j_must_wait = 0; journal->j_must_wait = 0;
if (journal->j_cnode_free == 0) { if (journal->j_cnode_free == 0) {
reiserfs_warning(p_s_sb, "journal-2004", "Journal cnode memory " reiserfs_warning(sb, "journal-2004", "Journal cnode memory "
"allocation failed (%ld bytes). Journal is " "allocation failed (%ld bytes). Journal is "
"too large for available memory. Usually " "too large for available memory. Usually "
"this is due to a journal that is too large.", "this is due to a journal that is too large.",
...@@ -2866,16 +2866,16 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2866,16 +2866,16 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
goto free_and_return; goto free_and_return;
} }
init_journal_hash(p_s_sb); init_journal_hash(sb);
jl = journal->j_current_jl; jl = journal->j_current_jl;
jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl); jl->j_list_bitmap = get_list_bitmap(sb, jl);
if (!jl->j_list_bitmap) { if (!jl->j_list_bitmap) {
reiserfs_warning(p_s_sb, "journal-2005", reiserfs_warning(sb, "journal-2005",
"get_list_bitmap failed for journal list 0"); "get_list_bitmap failed for journal list 0");
goto free_and_return; goto free_and_return;
} }
if (journal_read(p_s_sb) < 0) { if (journal_read(sb) < 0) {
reiserfs_warning(p_s_sb, "reiserfs-2006", reiserfs_warning(sb, "reiserfs-2006",
"Replay Failure, unable to mount"); "Replay Failure, unable to mount");
goto free_and_return; goto free_and_return;
} }
...@@ -2885,10 +2885,10 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2885,10 +2885,10 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
commit_wq = create_workqueue("reiserfs"); commit_wq = create_workqueue("reiserfs");
INIT_DELAYED_WORK(&journal->j_work, flush_async_commits); INIT_DELAYED_WORK(&journal->j_work, flush_async_commits);
journal->j_work_sb = p_s_sb; journal->j_work_sb = sb;
return 0; return 0;
free_and_return: free_and_return:
free_journal_ram(p_s_sb); free_journal_ram(sb);
return 1; return 1;
} }
...@@ -3004,37 +3004,37 @@ static void let_transaction_grow(struct super_block *sb, unsigned int trans_id) ...@@ -3004,37 +3004,37 @@ static void let_transaction_grow(struct super_block *sb, unsigned int trans_id)
** expect to use in nblocks. ** expect to use in nblocks.
*/ */
static int do_journal_begin_r(struct reiserfs_transaction_handle *th, static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks, struct super_block *sb, unsigned long nblocks,
int join) int join)
{ {
time_t now = get_seconds(); time_t now = get_seconds();
unsigned int old_trans_id; unsigned int old_trans_id;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_transaction_handle myth; struct reiserfs_transaction_handle myth;
int sched_count = 0; int sched_count = 0;
int retval; int retval;
reiserfs_check_lock_depth(p_s_sb, "journal_begin"); reiserfs_check_lock_depth(sb, "journal_begin");
BUG_ON(nblocks > journal->j_trans_max); BUG_ON(nblocks > journal->j_trans_max);
PROC_INFO_INC(p_s_sb, journal.journal_being); PROC_INFO_INC(sb, journal.journal_being);
/* set here for journal_join */ /* set here for journal_join */
th->t_refcount = 1; th->t_refcount = 1;
th->t_super = p_s_sb; th->t_super = sb;
relock: relock:
lock_journal(p_s_sb); lock_journal(sb);
if (join != JBEGIN_ABORT && reiserfs_is_journal_aborted(journal)) { if (join != JBEGIN_ABORT && reiserfs_is_journal_aborted(journal)) {
unlock_journal(p_s_sb); unlock_journal(sb);
retval = journal->j_errno; retval = journal->j_errno;
goto out_fail; goto out_fail;
} }
journal->j_bcount++; journal->j_bcount++;
if (test_bit(J_WRITERS_BLOCKED, &journal->j_state)) { if (test_bit(J_WRITERS_BLOCKED, &journal->j_state)) {
unlock_journal(p_s_sb); unlock_journal(sb);
reiserfs_wait_on_write_block(p_s_sb); reiserfs_wait_on_write_block(sb);
PROC_INFO_INC(p_s_sb, journal.journal_relock_writers); PROC_INFO_INC(sb, journal.journal_relock_writers);
goto relock; goto relock;
} }
now = get_seconds(); now = get_seconds();
...@@ -3055,7 +3055,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th, ...@@ -3055,7 +3055,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
|| (!join && journal->j_cnode_free < (journal->j_trans_max * 3))) { || (!join && journal->j_cnode_free < (journal->j_trans_max * 3))) {
old_trans_id = journal->j_trans_id; old_trans_id = journal->j_trans_id;
unlock_journal(p_s_sb); /* allow others to finish this transaction */ unlock_journal(sb); /* allow others to finish this transaction */
if (!join && (journal->j_len_alloc + nblocks + 2) >= if (!join && (journal->j_len_alloc + nblocks + 2) >=
journal->j_max_batch && journal->j_max_batch &&
...@@ -3063,7 +3063,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th, ...@@ -3063,7 +3063,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
(journal->j_len_alloc * 75)) { (journal->j_len_alloc * 75)) {
if (atomic_read(&journal->j_wcount) > 10) { if (atomic_read(&journal->j_wcount) > 10) {
sched_count++; sched_count++;
queue_log_writer(p_s_sb); queue_log_writer(sb);
goto relock; goto relock;
} }
} }
...@@ -3073,25 +3073,25 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th, ...@@ -3073,25 +3073,25 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
if (atomic_read(&journal->j_jlock)) { if (atomic_read(&journal->j_jlock)) {
while (journal->j_trans_id == old_trans_id && while (journal->j_trans_id == old_trans_id &&
atomic_read(&journal->j_jlock)) { atomic_read(&journal->j_jlock)) {
queue_log_writer(p_s_sb); queue_log_writer(sb);
} }
goto relock; goto relock;
} }
retval = journal_join(&myth, p_s_sb, 1); retval = journal_join(&myth, sb, 1);
if (retval) if (retval)
goto out_fail; goto out_fail;
/* someone might have ended the transaction while we joined */ /* someone might have ended the transaction while we joined */
if (old_trans_id != journal->j_trans_id) { if (old_trans_id != journal->j_trans_id) {
retval = do_journal_end(&myth, p_s_sb, 1, 0); retval = do_journal_end(&myth, sb, 1, 0);
} else { } else {
retval = do_journal_end(&myth, p_s_sb, 1, COMMIT_NOW); retval = do_journal_end(&myth, sb, 1, COMMIT_NOW);
} }
if (retval) if (retval)
goto out_fail; goto out_fail;
PROC_INFO_INC(p_s_sb, journal.journal_relock_wcount); PROC_INFO_INC(sb, journal.journal_relock_wcount);
goto relock; goto relock;
} }
/* we are the first writer, set trans_id */ /* we are the first writer, set trans_id */
...@@ -3103,7 +3103,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th, ...@@ -3103,7 +3103,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
th->t_blocks_logged = 0; th->t_blocks_logged = 0;
th->t_blocks_allocated = nblocks; th->t_blocks_allocated = nblocks;
th->t_trans_id = journal->j_trans_id; th->t_trans_id = journal->j_trans_id;
unlock_journal(p_s_sb); unlock_journal(sb);
INIT_LIST_HEAD(&th->t_list); INIT_LIST_HEAD(&th->t_list);
get_fs_excl(); get_fs_excl();
return 0; return 0;
...@@ -3113,7 +3113,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th, ...@@ -3113,7 +3113,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
/* Re-set th->t_super, so we can properly keep track of how many /* Re-set th->t_super, so we can properly keep track of how many
* persistent transactions there are. We need to do this so if this * persistent transactions there are. We need to do this so if this
* call is part of a failed restart_transaction, we can free it later */ * call is part of a failed restart_transaction, we can free it later */
th->t_super = p_s_sb; th->t_super = sb;
return retval; return retval;
} }
...@@ -3164,7 +3164,7 @@ int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *th) ...@@ -3164,7 +3164,7 @@ int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *th)
} }
static int journal_join(struct reiserfs_transaction_handle *th, static int journal_join(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks) struct super_block *sb, unsigned long nblocks)
{ {
struct reiserfs_transaction_handle *cur_th = current->journal_info; struct reiserfs_transaction_handle *cur_th = current->journal_info;
...@@ -3173,11 +3173,11 @@ static int journal_join(struct reiserfs_transaction_handle *th, ...@@ -3173,11 +3173,11 @@ static int journal_join(struct reiserfs_transaction_handle *th,
*/ */
th->t_handle_save = cur_th; th->t_handle_save = cur_th;
BUG_ON(cur_th && cur_th->t_refcount > 1); BUG_ON(cur_th && cur_th->t_refcount > 1);
return do_journal_begin_r(th, p_s_sb, nblocks, JBEGIN_JOIN); return do_journal_begin_r(th, sb, nblocks, JBEGIN_JOIN);
} }
int journal_join_abort(struct reiserfs_transaction_handle *th, int journal_join_abort(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks) struct super_block *sb, unsigned long nblocks)
{ {
struct reiserfs_transaction_handle *cur_th = current->journal_info; struct reiserfs_transaction_handle *cur_th = current->journal_info;
...@@ -3186,11 +3186,11 @@ int journal_join_abort(struct reiserfs_transaction_handle *th, ...@@ -3186,11 +3186,11 @@ int journal_join_abort(struct reiserfs_transaction_handle *th,
*/ */
th->t_handle_save = cur_th; th->t_handle_save = cur_th;
BUG_ON(cur_th && cur_th->t_refcount > 1); BUG_ON(cur_th && cur_th->t_refcount > 1);
return do_journal_begin_r(th, p_s_sb, nblocks, JBEGIN_ABORT); return do_journal_begin_r(th, sb, nblocks, JBEGIN_ABORT);
} }
int journal_begin(struct reiserfs_transaction_handle *th, int journal_begin(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks) struct super_block *sb, unsigned long nblocks)
{ {
struct reiserfs_transaction_handle *cur_th = current->journal_info; struct reiserfs_transaction_handle *cur_th = current->journal_info;
int ret; int ret;
...@@ -3198,12 +3198,12 @@ int journal_begin(struct reiserfs_transaction_handle *th, ...@@ -3198,12 +3198,12 @@ int journal_begin(struct reiserfs_transaction_handle *th,
th->t_handle_save = NULL; th->t_handle_save = NULL;
if (cur_th) { if (cur_th) {
/* we are nesting into the current transaction */ /* we are nesting into the current transaction */
if (cur_th->t_super == p_s_sb) { if (cur_th->t_super == sb) {
BUG_ON(!cur_th->t_refcount); BUG_ON(!cur_th->t_refcount);
cur_th->t_refcount++; cur_th->t_refcount++;
memcpy(th, cur_th, sizeof(*th)); memcpy(th, cur_th, sizeof(*th));
if (th->t_refcount <= 1) if (th->t_refcount <= 1)
reiserfs_warning(p_s_sb, "reiserfs-2005", reiserfs_warning(sb, "reiserfs-2005",
"BAD: refcount <= 1, but " "BAD: refcount <= 1, but "
"journal_info != 0"); "journal_info != 0");
return 0; return 0;
...@@ -3212,7 +3212,7 @@ int journal_begin(struct reiserfs_transaction_handle *th, ...@@ -3212,7 +3212,7 @@ int journal_begin(struct reiserfs_transaction_handle *th,
** save it and restore on journal_end. This should never ** save it and restore on journal_end. This should never
** really happen... ** really happen...
*/ */
reiserfs_warning(p_s_sb, "clm-2100", reiserfs_warning(sb, "clm-2100",
"nesting info a different FS"); "nesting info a different FS");
th->t_handle_save = current->journal_info; th->t_handle_save = current->journal_info;
current->journal_info = th; current->journal_info = th;
...@@ -3220,7 +3220,7 @@ int journal_begin(struct reiserfs_transaction_handle *th, ...@@ -3220,7 +3220,7 @@ int journal_begin(struct reiserfs_transaction_handle *th,
} else { } else {
current->journal_info = th; current->journal_info = th;
} }
ret = do_journal_begin_r(th, p_s_sb, nblocks, JBEGIN_REG); ret = do_journal_begin_r(th, sb, nblocks, JBEGIN_REG);
BUG_ON(current->journal_info != th); BUG_ON(current->journal_info != th);
/* I guess this boils down to being the reciprocal of clm-2100 above. /* I guess this boils down to being the reciprocal of clm-2100 above.
...@@ -3244,28 +3244,28 @@ int journal_begin(struct reiserfs_transaction_handle *th, ...@@ -3244,28 +3244,28 @@ int journal_begin(struct reiserfs_transaction_handle *th,
** if j_len, is bigger than j_len_alloc, it pushes j_len_alloc to 10 + j_len. ** 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, int journal_mark_dirty(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, struct buffer_head *bh) struct super_block *sb, struct buffer_head *bh)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_journal_cnode *cn = NULL; struct reiserfs_journal_cnode *cn = NULL;
int count_already_incd = 0; int count_already_incd = 0;
int prepared = 0; int prepared = 0;
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
PROC_INFO_INC(p_s_sb, journal.mark_dirty); PROC_INFO_INC(sb, journal.mark_dirty);
if (th->t_trans_id != journal->j_trans_id) { if (th->t_trans_id != journal->j_trans_id) {
reiserfs_panic(th->t_super, "journal-1577", reiserfs_panic(th->t_super, "journal-1577",
"handle trans id %ld != current trans id %ld", "handle trans id %ld != current trans id %ld",
th->t_trans_id, journal->j_trans_id); th->t_trans_id, journal->j_trans_id);
} }
p_s_sb->s_dirt = 1; sb->s_dirt = 1;
prepared = test_clear_buffer_journal_prepared(bh); prepared = test_clear_buffer_journal_prepared(bh);
clear_buffer_journal_restore_dirty(bh); clear_buffer_journal_restore_dirty(bh);
/* already in this transaction, we are done */ /* already in this transaction, we are done */
if (buffer_journaled(bh)) { if (buffer_journaled(bh)) {
PROC_INFO_INC(p_s_sb, journal.mark_dirty_already); PROC_INFO_INC(sb, journal.mark_dirty_already);
return 0; return 0;
} }
...@@ -3274,7 +3274,7 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ...@@ -3274,7 +3274,7 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
** could get to disk too early. NOT GOOD. ** could get to disk too early. NOT GOOD.
*/ */
if (!prepared || buffer_dirty(bh)) { if (!prepared || buffer_dirty(bh)) {
reiserfs_warning(p_s_sb, "journal-1777", reiserfs_warning(sb, "journal-1777",
"buffer %llu bad state " "buffer %llu bad state "
"%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT", "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
...@@ -3285,7 +3285,7 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ...@@ -3285,7 +3285,7 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
} }
if (atomic_read(&(journal->j_wcount)) <= 0) { if (atomic_read(&(journal->j_wcount)) <= 0) {
reiserfs_warning(p_s_sb, "journal-1409", reiserfs_warning(sb, "journal-1409",
"returning because j_wcount was %d", "returning because j_wcount was %d",
atomic_read(&(journal->j_wcount))); atomic_read(&(journal->j_wcount)));
return 1; return 1;
...@@ -3301,7 +3301,7 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ...@@ -3301,7 +3301,7 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
if (buffer_journal_dirty(bh)) { if (buffer_journal_dirty(bh)) {
count_already_incd = 1; count_already_incd = 1;
PROC_INFO_INC(p_s_sb, journal.mark_dirty_notjournal); PROC_INFO_INC(sb, journal.mark_dirty_notjournal);
clear_buffer_journal_dirty(bh); clear_buffer_journal_dirty(bh);
} }
...@@ -3313,10 +3313,9 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ...@@ -3313,10 +3313,9 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
/* now put this guy on the end */ /* now put this guy on the end */
if (!cn) { if (!cn) {
cn = get_cnode(p_s_sb); cn = get_cnode(sb);
if (!cn) { if (!cn) {
reiserfs_panic(p_s_sb, "journal-4", reiserfs_panic(sb, "journal-4", "get_cnode failed!");
"get_cnode failed!");
} }
if (th->t_blocks_logged == th->t_blocks_allocated) { if (th->t_blocks_logged == th->t_blocks_allocated) {
...@@ -3328,7 +3327,7 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ...@@ -3328,7 +3327,7 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
cn->bh = bh; cn->bh = bh;
cn->blocknr = bh->b_blocknr; cn->blocknr = bh->b_blocknr;
cn->sb = p_s_sb; cn->sb = sb;
cn->jlist = NULL; cn->jlist = NULL;
insert_journal_hash(journal->j_hash_table, cn); insert_journal_hash(journal->j_hash_table, cn);
if (!count_already_incd) { if (!count_already_incd) {
...@@ -3349,10 +3348,10 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ...@@ -3349,10 +3348,10 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
} }
int journal_end(struct reiserfs_transaction_handle *th, int journal_end(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks) struct super_block *sb, unsigned long nblocks)
{ {
if (!current->journal_info && th->t_refcount > 1) if (!current->journal_info && th->t_refcount > 1)
reiserfs_warning(p_s_sb, "REISER-NESTING", reiserfs_warning(sb, "REISER-NESTING",
"th NULL, refcount %d", th->t_refcount); "th NULL, refcount %d", th->t_refcount);
if (!th->t_trans_id) { if (!th->t_trans_id) {
...@@ -3376,7 +3375,7 @@ int journal_end(struct reiserfs_transaction_handle *th, ...@@ -3376,7 +3375,7 @@ int journal_end(struct reiserfs_transaction_handle *th,
} }
return 0; return 0;
} else { } else {
return do_journal_end(th, p_s_sb, nblocks, 0); return do_journal_end(th, sb, nblocks, 0);
} }
} }
...@@ -3387,15 +3386,15 @@ int journal_end(struct reiserfs_transaction_handle *th, ...@@ -3387,15 +3386,15 @@ int journal_end(struct reiserfs_transaction_handle *th,
** **
** returns 1 if it cleaned and relsed the buffer. 0 otherwise ** returns 1 if it cleaned and relsed the buffer. 0 otherwise
*/ */
static int remove_from_transaction(struct super_block *p_s_sb, static int remove_from_transaction(struct super_block *sb,
b_blocknr_t blocknr, int already_cleaned) b_blocknr_t blocknr, int already_cleaned)
{ {
struct buffer_head *bh; struct buffer_head *bh;
struct reiserfs_journal_cnode *cn; struct reiserfs_journal_cnode *cn;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
int ret = 0; int ret = 0;
cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, blocknr); cn = get_journal_hash_dev(sb, journal->j_hash_table, blocknr);
if (!cn || !cn->bh) { if (!cn || !cn->bh) {
return ret; return ret;
} }
...@@ -3413,7 +3412,7 @@ static int remove_from_transaction(struct super_block *p_s_sb, ...@@ -3413,7 +3412,7 @@ static int remove_from_transaction(struct super_block *p_s_sb,
journal->j_last = cn->prev; journal->j_last = cn->prev;
} }
if (bh) if (bh)
remove_journal_hash(p_s_sb, journal->j_hash_table, NULL, remove_journal_hash(sb, journal->j_hash_table, NULL,
bh->b_blocknr, 0); bh->b_blocknr, 0);
clear_buffer_journaled(bh); /* don't log this one */ clear_buffer_journaled(bh); /* don't log this one */
...@@ -3423,14 +3422,14 @@ static int remove_from_transaction(struct super_block *p_s_sb, ...@@ -3423,14 +3422,14 @@ static int remove_from_transaction(struct super_block *p_s_sb,
clear_buffer_journal_test(bh); clear_buffer_journal_test(bh);
put_bh(bh); put_bh(bh);
if (atomic_read(&(bh->b_count)) < 0) { if (atomic_read(&(bh->b_count)) < 0) {
reiserfs_warning(p_s_sb, "journal-1752", reiserfs_warning(sb, "journal-1752",
"b_count < 0"); "b_count < 0");
} }
ret = 1; ret = 1;
} }
journal->j_len--; journal->j_len--;
journal->j_len_alloc--; journal->j_len_alloc--;
free_cnode(p_s_sb, cn); free_cnode(sb, cn);
return ret; return ret;
} }
...@@ -3481,19 +3480,19 @@ static int can_dirty(struct reiserfs_journal_cnode *cn) ...@@ -3481,19 +3480,19 @@ static int can_dirty(struct reiserfs_journal_cnode *cn)
** 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, int journal_end_sync(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks) struct super_block *sb, unsigned long nblocks)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
/* you can sync while nested, very, very bad */ /* you can sync while nested, very, very bad */
BUG_ON(th->t_refcount > 1); BUG_ON(th->t_refcount > 1);
if (journal->j_len == 0) { if (journal->j_len == 0) {
reiserfs_prepare_for_journal(p_s_sb, SB_BUFFER_WITH_SB(p_s_sb), reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb),
1); 1);
journal_mark_dirty(th, p_s_sb, SB_BUFFER_WITH_SB(p_s_sb)); journal_mark_dirty(th, sb, SB_BUFFER_WITH_SB(sb));
} }
return do_journal_end(th, p_s_sb, nblocks, COMMIT_NOW | WAIT); return do_journal_end(th, sb, nblocks, COMMIT_NOW | WAIT);
} }
/* /*
...@@ -3503,7 +3502,7 @@ static void flush_async_commits(struct work_struct *work) ...@@ -3503,7 +3502,7 @@ static void flush_async_commits(struct work_struct *work)
{ {
struct reiserfs_journal *journal = struct reiserfs_journal *journal =
container_of(work, struct reiserfs_journal, j_work.work); container_of(work, struct reiserfs_journal, j_work.work);
struct super_block *p_s_sb = journal->j_work_sb; struct super_block *sb = journal->j_work_sb;
struct reiserfs_journal_list *jl; struct reiserfs_journal_list *jl;
struct list_head *entry; struct list_head *entry;
...@@ -3512,7 +3511,7 @@ static void flush_async_commits(struct work_struct *work) ...@@ -3512,7 +3511,7 @@ static void flush_async_commits(struct work_struct *work)
/* last entry is the youngest, commit it and you get everything */ /* last entry is the youngest, commit it and you get everything */
entry = journal->j_journal_list.prev; entry = journal->j_journal_list.prev;
jl = JOURNAL_LIST_ENTRY(entry); jl = JOURNAL_LIST_ENTRY(entry);
flush_commit_list(p_s_sb, jl, 1); flush_commit_list(sb, jl, 1);
} }
unlock_kernel(); unlock_kernel();
} }
...@@ -3521,11 +3520,11 @@ static void flush_async_commits(struct work_struct *work) ...@@ -3521,11 +3520,11 @@ static void flush_async_commits(struct work_struct *work)
** flushes any old transactions to disk ** flushes any old transactions to disk
** ends the current transaction if it is too old ** ends the current transaction if it is too old
*/ */
int reiserfs_flush_old_commits(struct super_block *p_s_sb) int reiserfs_flush_old_commits(struct super_block *sb)
{ {
time_t now; time_t now;
struct reiserfs_transaction_handle th; struct reiserfs_transaction_handle th;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
now = get_seconds(); now = get_seconds();
/* safety check so we don't flush while we are replaying the log during /* safety check so we don't flush while we are replaying the log during
...@@ -3542,20 +3541,20 @@ int reiserfs_flush_old_commits(struct super_block *p_s_sb) ...@@ -3542,20 +3541,20 @@ int reiserfs_flush_old_commits(struct super_block *p_s_sb)
journal->j_trans_start_time > 0 && journal->j_trans_start_time > 0 &&
journal->j_len > 0 && journal->j_len > 0 &&
(now - journal->j_trans_start_time) > journal->j_max_trans_age) { (now - journal->j_trans_start_time) > journal->j_max_trans_age) {
if (!journal_join(&th, p_s_sb, 1)) { if (!journal_join(&th, sb, 1)) {
reiserfs_prepare_for_journal(p_s_sb, reiserfs_prepare_for_journal(sb,
SB_BUFFER_WITH_SB(p_s_sb), SB_BUFFER_WITH_SB(sb),
1); 1);
journal_mark_dirty(&th, p_s_sb, journal_mark_dirty(&th, sb,
SB_BUFFER_WITH_SB(p_s_sb)); SB_BUFFER_WITH_SB(sb));
/* we're only being called from kreiserfsd, it makes no sense to do /* we're only being called from kreiserfsd, it makes no sense to do
** an async commit so that kreiserfsd can do it later ** an async commit so that kreiserfsd can do it later
*/ */
do_journal_end(&th, p_s_sb, 1, COMMIT_NOW | WAIT); do_journal_end(&th, sb, 1, COMMIT_NOW | WAIT);
} }
} }
return p_s_sb->s_dirt; return sb->s_dirt;
} }
/* /*
...@@ -3570,7 +3569,7 @@ int reiserfs_flush_old_commits(struct super_block *p_s_sb) ...@@ -3570,7 +3569,7 @@ int reiserfs_flush_old_commits(struct super_block *p_s_sb)
** Note, we can't allow the journal_end to proceed while there are still writers in the log. ** 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, static int check_journal_end(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks, struct super_block *sb, unsigned long nblocks,
int flags) int flags)
{ {
...@@ -3579,7 +3578,7 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, ...@@ -3579,7 +3578,7 @@ static int check_journal_end(struct reiserfs_transaction_handle *th,
int commit_now = flags & COMMIT_NOW; int commit_now = flags & COMMIT_NOW;
int wait_on_commit = flags & WAIT; int wait_on_commit = flags & WAIT;
struct reiserfs_journal_list *jl; struct reiserfs_journal_list *jl;
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
...@@ -3618,31 +3617,31 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, ...@@ -3618,31 +3617,31 @@ static int check_journal_end(struct reiserfs_transaction_handle *th,
if (flush) { if (flush) {
journal->j_next_full_flush = 1; journal->j_next_full_flush = 1;
} }
unlock_journal(p_s_sb); unlock_journal(sb);
/* sleep while the current transaction is still j_jlocked */ /* sleep while the current transaction is still j_jlocked */
while (journal->j_trans_id == trans_id) { while (journal->j_trans_id == trans_id) {
if (atomic_read(&journal->j_jlock)) { if (atomic_read(&journal->j_jlock)) {
queue_log_writer(p_s_sb); queue_log_writer(sb);
} else { } else {
lock_journal(p_s_sb); lock_journal(sb);
if (journal->j_trans_id == trans_id) { if (journal->j_trans_id == trans_id) {
atomic_set(&(journal->j_jlock), atomic_set(&(journal->j_jlock),
1); 1);
} }
unlock_journal(p_s_sb); unlock_journal(sb);
} }
} }
BUG_ON(journal->j_trans_id == trans_id); BUG_ON(journal->j_trans_id == trans_id);
if (commit_now if (commit_now
&& journal_list_still_alive(p_s_sb, trans_id) && journal_list_still_alive(sb, trans_id)
&& wait_on_commit) { && wait_on_commit) {
flush_commit_list(p_s_sb, jl, 1); flush_commit_list(sb, jl, 1);
} }
return 0; return 0;
} }
unlock_journal(p_s_sb); unlock_journal(sb);
return 0; return 0;
} }
...@@ -3659,12 +3658,12 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, ...@@ -3659,12 +3658,12 @@ static int check_journal_end(struct reiserfs_transaction_handle *th,
&& journal->j_len_alloc < journal->j_max_batch && journal->j_len_alloc < journal->j_max_batch
&& journal->j_cnode_free > (journal->j_trans_max * 3)) { && journal->j_cnode_free > (journal->j_trans_max * 3)) {
journal->j_bcount++; journal->j_bcount++;
unlock_journal(p_s_sb); unlock_journal(sb);
return 0; return 0;
} }
if (journal->j_start > SB_ONDISK_JOURNAL_SIZE(p_s_sb)) { if (journal->j_start > SB_ONDISK_JOURNAL_SIZE(sb)) {
reiserfs_panic(p_s_sb, "journal-003", reiserfs_panic(sb, "journal-003",
"j_start (%ld) is too high", "j_start (%ld) is too high",
journal->j_start); journal->j_start);
} }
...@@ -3686,16 +3685,16 @@ static int check_journal_end(struct reiserfs_transaction_handle *th, ...@@ -3686,16 +3685,16 @@ static int check_journal_end(struct reiserfs_transaction_handle *th,
** Then remove it from the current transaction, decrementing any counters and filing it on the clean list. ** Then remove it from the current transaction, decrementing any counters and filing it on the clean list.
*/ */
int journal_mark_freed(struct reiserfs_transaction_handle *th, int journal_mark_freed(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, b_blocknr_t blocknr) struct super_block *sb, b_blocknr_t blocknr)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_journal_cnode *cn = NULL; struct reiserfs_journal_cnode *cn = NULL;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
struct reiserfs_list_bitmap *jb = NULL; struct reiserfs_list_bitmap *jb = NULL;
int cleaned = 0; int cleaned = 0;
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, blocknr); cn = get_journal_hash_dev(sb, journal->j_hash_table, blocknr);
if (cn && cn->bh) { if (cn && cn->bh) {
bh = cn->bh; bh = cn->bh;
get_bh(bh); get_bh(bh);
...@@ -3705,15 +3704,15 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, ...@@ -3705,15 +3704,15 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th,
clear_buffer_journal_new(bh); clear_buffer_journal_new(bh);
clear_prepared_bits(bh); clear_prepared_bits(bh);
reiserfs_clean_and_file_buffer(bh); reiserfs_clean_and_file_buffer(bh);
cleaned = remove_from_transaction(p_s_sb, blocknr, cleaned); cleaned = remove_from_transaction(sb, blocknr, cleaned);
} else { } else {
/* set the bit for this block in the journal bitmap for this transaction */ /* set the bit for this block in the journal bitmap for this transaction */
jb = journal->j_current_jl->j_list_bitmap; jb = journal->j_current_jl->j_list_bitmap;
if (!jb) { if (!jb) {
reiserfs_panic(p_s_sb, "journal-1702", reiserfs_panic(sb, "journal-1702",
"journal_list_bitmap is NULL"); "journal_list_bitmap is NULL");
} }
set_bit_in_list_bitmap(p_s_sb, blocknr, jb); set_bit_in_list_bitmap(sb, blocknr, jb);
/* Note, the entire while loop is not allowed to schedule. */ /* Note, the entire while loop is not allowed to schedule. */
...@@ -3721,13 +3720,13 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, ...@@ -3721,13 +3720,13 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th,
clear_prepared_bits(bh); clear_prepared_bits(bh);
reiserfs_clean_and_file_buffer(bh); reiserfs_clean_and_file_buffer(bh);
} }
cleaned = remove_from_transaction(p_s_sb, blocknr, cleaned); cleaned = remove_from_transaction(sb, blocknr, cleaned);
/* find all older transactions with this block, make sure they don't try to write it out */ /* find all older transactions with this block, make sure they don't try to write it out */
cn = get_journal_hash_dev(p_s_sb, journal->j_list_hash_table, cn = get_journal_hash_dev(sb, journal->j_list_hash_table,
blocknr); blocknr);
while (cn) { while (cn) {
if (p_s_sb == cn->sb && blocknr == cn->blocknr) { if (sb == cn->sb && blocknr == cn->blocknr) {
set_bit(BLOCK_FREED, &cn->state); set_bit(BLOCK_FREED, &cn->state);
if (cn->bh) { if (cn->bh) {
if (!cleaned) { if (!cleaned) {
...@@ -3743,7 +3742,7 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, ...@@ -3743,7 +3742,7 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th,
put_bh(cn->bh); put_bh(cn->bh);
if (atomic_read if (atomic_read
(&(cn->bh->b_count)) < 0) { (&(cn->bh->b_count)) < 0) {
reiserfs_warning(p_s_sb, reiserfs_warning(sb,
"journal-2138", "journal-2138",
"cn->bh->b_count < 0"); "cn->bh->b_count < 0");
} }
...@@ -3850,18 +3849,18 @@ int reiserfs_commit_for_inode(struct inode *inode) ...@@ -3850,18 +3849,18 @@ int reiserfs_commit_for_inode(struct inode *inode)
return __commit_trans_jl(inode, id, jl); return __commit_trans_jl(inode, id, jl);
} }
void reiserfs_restore_prepared_buffer(struct super_block *p_s_sb, void reiserfs_restore_prepared_buffer(struct super_block *sb,
struct buffer_head *bh) struct buffer_head *bh)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
PROC_INFO_INC(p_s_sb, journal.restore_prepared); PROC_INFO_INC(sb, journal.restore_prepared);
if (!bh) { if (!bh) {
return; return;
} }
if (test_clear_buffer_journal_restore_dirty(bh) && if (test_clear_buffer_journal_restore_dirty(bh) &&
buffer_journal_dirty(bh)) { buffer_journal_dirty(bh)) {
struct reiserfs_journal_cnode *cn; struct reiserfs_journal_cnode *cn;
cn = get_journal_hash_dev(p_s_sb, cn = get_journal_hash_dev(sb,
journal->j_list_hash_table, journal->j_list_hash_table,
bh->b_blocknr); bh->b_blocknr);
if (cn && can_dirty(cn)) { if (cn && can_dirty(cn)) {
...@@ -3880,10 +3879,10 @@ extern struct tree_balance *cur_tb; ...@@ -3880,10 +3879,10 @@ extern struct tree_balance *cur_tb;
** wait on it. ** wait on it.
** **
*/ */
int reiserfs_prepare_for_journal(struct super_block *p_s_sb, int reiserfs_prepare_for_journal(struct super_block *sb,
struct buffer_head *bh, int wait) struct buffer_head *bh, int wait)
{ {
PROC_INFO_INC(p_s_sb, journal.prepare); PROC_INFO_INC(sb, journal.prepare);
if (!trylock_buffer(bh)) { if (!trylock_buffer(bh)) {
if (!wait) if (!wait)
...@@ -3931,10 +3930,10 @@ static void flush_old_journal_lists(struct super_block *s) ...@@ -3931,10 +3930,10 @@ static void flush_old_journal_lists(struct super_block *s)
** journal lists, etc just won't happen. ** journal lists, etc just won't happen.
*/ */
static int do_journal_end(struct reiserfs_transaction_handle *th, static int do_journal_end(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks, struct super_block *sb, unsigned long nblocks,
int flags) int flags)
{ {
struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); struct reiserfs_journal *journal = SB_JOURNAL(sb);
struct reiserfs_journal_cnode *cn, *next, *jl_cn; struct reiserfs_journal_cnode *cn, *next, *jl_cn;
struct reiserfs_journal_cnode *last_cn = NULL; struct reiserfs_journal_cnode *last_cn = NULL;
struct reiserfs_journal_desc *desc; struct reiserfs_journal_desc *desc;
...@@ -3964,14 +3963,14 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -3964,14 +3963,14 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
put_fs_excl(); put_fs_excl();
current->journal_info = th->t_handle_save; current->journal_info = th->t_handle_save;
reiserfs_check_lock_depth(p_s_sb, "journal end"); reiserfs_check_lock_depth(sb, "journal end");
if (journal->j_len == 0) { if (journal->j_len == 0) {
reiserfs_prepare_for_journal(p_s_sb, SB_BUFFER_WITH_SB(p_s_sb), reiserfs_prepare_for_journal(sb, SB_BUFFER_WITH_SB(sb),
1); 1);
journal_mark_dirty(th, p_s_sb, SB_BUFFER_WITH_SB(p_s_sb)); journal_mark_dirty(th, sb, SB_BUFFER_WITH_SB(sb));
} }
lock_journal(p_s_sb); lock_journal(sb);
if (journal->j_next_full_flush) { if (journal->j_next_full_flush) {
flags |= FLUSH_ALL; flags |= FLUSH_ALL;
flush = 1; flush = 1;
...@@ -3984,10 +3983,10 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -3984,10 +3983,10 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
/* 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 ** it tells us if we should continue with the journal_end, or just return
*/ */
if (!check_journal_end(th, p_s_sb, nblocks, flags)) { if (!check_journal_end(th, sb, nblocks, flags)) {
p_s_sb->s_dirt = 1; sb->s_dirt = 1;
wake_queued_writers(p_s_sb); wake_queued_writers(sb);
reiserfs_async_progress_wait(p_s_sb); reiserfs_async_progress_wait(sb);
goto out; goto out;
} }
...@@ -4016,8 +4015,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4016,8 +4015,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
/* setup description block */ /* setup description block */
d_bh = d_bh =
journal_getblk(p_s_sb, journal_getblk(sb,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
journal->j_start); journal->j_start);
set_buffer_uptodate(d_bh); set_buffer_uptodate(d_bh);
desc = (struct reiserfs_journal_desc *)(d_bh)->b_data; desc = (struct reiserfs_journal_desc *)(d_bh)->b_data;
...@@ -4026,9 +4025,9 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4026,9 +4025,9 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
set_desc_trans_id(desc, journal->j_trans_id); set_desc_trans_id(desc, journal->j_trans_id);
/* setup commit block. Don't write (keep it clean too) this one until after everyone else is written */ /* setup commit block. Don't write (keep it clean too) this one until after everyone else is written */
c_bh = journal_getblk(p_s_sb, SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + c_bh = journal_getblk(sb, SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
((journal->j_start + journal->j_len + ((journal->j_start + journal->j_len +
1) % SB_ONDISK_JOURNAL_SIZE(p_s_sb))); 1) % SB_ONDISK_JOURNAL_SIZE(sb)));
commit = (struct reiserfs_journal_commit *)c_bh->b_data; commit = (struct reiserfs_journal_commit *)c_bh->b_data;
memset(c_bh->b_data, 0, c_bh->b_size); memset(c_bh->b_data, 0, c_bh->b_size);
set_commit_trans_id(commit, journal->j_trans_id); set_commit_trans_id(commit, journal->j_trans_id);
...@@ -4061,12 +4060,12 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4061,12 +4060,12 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
** for each real block, add it to the journal list hash, ** for each real block, add it to the journal list hash,
** copy into real block index array in the commit or desc block ** copy into real block index array in the commit or desc block
*/ */
trans_half = journal_trans_half(p_s_sb->s_blocksize); trans_half = journal_trans_half(sb->s_blocksize);
for (i = 0, cn = journal->j_first; cn; cn = cn->next, i++) { for (i = 0, cn = journal->j_first; cn; cn = cn->next, i++) {
if (buffer_journaled(cn->bh)) { if (buffer_journaled(cn->bh)) {
jl_cn = get_cnode(p_s_sb); jl_cn = get_cnode(sb);
if (!jl_cn) { if (!jl_cn) {
reiserfs_panic(p_s_sb, "journal-1676", reiserfs_panic(sb, "journal-1676",
"get_cnode returned NULL"); "get_cnode returned NULL");
} }
if (i == 0) { if (i == 0) {
...@@ -4082,15 +4081,15 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4082,15 +4081,15 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
of journal or reserved area */ of journal or reserved area */
if (is_block_in_log_or_reserved_area if (is_block_in_log_or_reserved_area
(p_s_sb, cn->bh->b_blocknr)) { (sb, cn->bh->b_blocknr)) {
reiserfs_panic(p_s_sb, "journal-2332", reiserfs_panic(sb, "journal-2332",
"Trying to log block %lu, " "Trying to log block %lu, "
"which is a log block", "which is a log block",
cn->bh->b_blocknr); cn->bh->b_blocknr);
} }
jl_cn->blocknr = cn->bh->b_blocknr; jl_cn->blocknr = cn->bh->b_blocknr;
jl_cn->state = 0; jl_cn->state = 0;
jl_cn->sb = p_s_sb; jl_cn->sb = sb;
jl_cn->bh = cn->bh; jl_cn->bh = cn->bh;
jl_cn->jlist = jl; jl_cn->jlist = jl;
insert_journal_hash(journal->j_list_hash_table, jl_cn); insert_journal_hash(journal->j_list_hash_table, jl_cn);
...@@ -4131,11 +4130,11 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4131,11 +4130,11 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
char *addr; char *addr;
struct page *page; struct page *page;
tmp_bh = tmp_bh =
journal_getblk(p_s_sb, journal_getblk(sb,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
((cur_write_start + ((cur_write_start +
jindex) % jindex) %
SB_ONDISK_JOURNAL_SIZE(p_s_sb))); SB_ONDISK_JOURNAL_SIZE(sb)));
set_buffer_uptodate(tmp_bh); set_buffer_uptodate(tmp_bh);
page = cn->bh->b_page; page = cn->bh->b_page;
addr = kmap(page); addr = kmap(page);
...@@ -4149,13 +4148,13 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4149,13 +4148,13 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
clear_buffer_journaled(cn->bh); clear_buffer_journaled(cn->bh);
} else { } else {
/* JDirty cleared sometime during transaction. don't log this one */ /* JDirty cleared sometime during transaction. don't log this one */
reiserfs_warning(p_s_sb, "journal-2048", reiserfs_warning(sb, "journal-2048",
"BAD, buffer in journal hash, " "BAD, buffer in journal hash, "
"but not JDirty!"); "but not JDirty!");
brelse(cn->bh); brelse(cn->bh);
} }
next = cn->next; next = cn->next;
free_cnode(p_s_sb, cn); free_cnode(sb, cn);
cn = next; cn = next;
cond_resched(); cond_resched();
} }
...@@ -4165,7 +4164,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4165,7 +4164,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
** so we dirty/relse c_bh in flush_commit_list, with commit_left <= 1. ** so we dirty/relse c_bh in flush_commit_list, with commit_left <= 1.
*/ */
journal->j_current_jl = alloc_journal_list(p_s_sb); journal->j_current_jl = alloc_journal_list(sb);
/* now it is safe to insert this transaction on the main list */ /* now it is safe to insert this transaction on the main list */
list_add_tail(&jl->j_list, &journal->j_journal_list); list_add_tail(&jl->j_list, &journal->j_journal_list);
...@@ -4176,7 +4175,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4176,7 +4175,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
old_start = journal->j_start; old_start = journal->j_start;
journal->j_start = journal->j_start =
(journal->j_start + journal->j_len + (journal->j_start + journal->j_len +
2) % SB_ONDISK_JOURNAL_SIZE(p_s_sb); 2) % SB_ONDISK_JOURNAL_SIZE(sb);
atomic_set(&(journal->j_wcount), 0); atomic_set(&(journal->j_wcount), 0);
journal->j_bcount = 0; journal->j_bcount = 0;
journal->j_last = NULL; journal->j_last = NULL;
...@@ -4191,7 +4190,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4191,7 +4190,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
journal->j_len_alloc = 0; journal->j_len_alloc = 0;
journal->j_next_full_flush = 0; journal->j_next_full_flush = 0;
journal->j_next_async_flush = 0; journal->j_next_async_flush = 0;
init_journal_hash(p_s_sb); init_journal_hash(sb);
// make sure reiserfs_add_jh sees the new current_jl before we // make sure reiserfs_add_jh sees the new current_jl before we
// write out the tails // write out the tails
...@@ -4220,8 +4219,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4220,8 +4219,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
** queue don't wait for this proc to flush journal lists and such. ** queue don't wait for this proc to flush journal lists and such.
*/ */
if (flush) { if (flush) {
flush_commit_list(p_s_sb, jl, 1); flush_commit_list(sb, jl, 1);
flush_journal_list(p_s_sb, jl, 1); flush_journal_list(sb, jl, 1);
} else if (!(jl->j_state & LIST_COMMIT_PENDING)) } else if (!(jl->j_state & LIST_COMMIT_PENDING))
queue_delayed_work(commit_wq, &journal->j_work, HZ / 10); queue_delayed_work(commit_wq, &journal->j_work, HZ / 10);
...@@ -4235,11 +4234,11 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4235,11 +4234,11 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
if (journal->j_start <= temp_jl->j_start) { if (journal->j_start <= temp_jl->j_start) {
if ((journal->j_start + journal->j_trans_max + 1) >= if ((journal->j_start + journal->j_trans_max + 1) >=
temp_jl->j_start) { temp_jl->j_start) {
flush_used_journal_lists(p_s_sb, temp_jl); flush_used_journal_lists(sb, temp_jl);
goto first_jl; goto first_jl;
} else if ((journal->j_start + } else if ((journal->j_start +
journal->j_trans_max + 1) < journal->j_trans_max + 1) <
SB_ONDISK_JOURNAL_SIZE(p_s_sb)) { SB_ONDISK_JOURNAL_SIZE(sb)) {
/* if we don't cross into the next transaction and we don't /* if we don't cross into the next transaction and we don't
* wrap, there is no way we can overlap any later transactions * wrap, there is no way we can overlap any later transactions
* break now * break now
...@@ -4248,11 +4247,11 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4248,11 +4247,11 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
} }
} else if ((journal->j_start + } else if ((journal->j_start +
journal->j_trans_max + 1) > journal->j_trans_max + 1) >
SB_ONDISK_JOURNAL_SIZE(p_s_sb)) { SB_ONDISK_JOURNAL_SIZE(sb)) {
if (((journal->j_start + journal->j_trans_max + 1) % if (((journal->j_start + journal->j_trans_max + 1) %
SB_ONDISK_JOURNAL_SIZE(p_s_sb)) >= SB_ONDISK_JOURNAL_SIZE(sb)) >=
temp_jl->j_start) { temp_jl->j_start) {
flush_used_journal_lists(p_s_sb, temp_jl); flush_used_journal_lists(sb, temp_jl);
goto first_jl; goto first_jl;
} else { } else {
/* we don't overlap anything from out start to the end of the /* we don't overlap anything from out start to the end of the
...@@ -4263,34 +4262,34 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, ...@@ -4263,34 +4262,34 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
} }
} }
} }
flush_old_journal_lists(p_s_sb); flush_old_journal_lists(sb);
journal->j_current_jl->j_list_bitmap = journal->j_current_jl->j_list_bitmap =
get_list_bitmap(p_s_sb, journal->j_current_jl); get_list_bitmap(sb, journal->j_current_jl);
if (!(journal->j_current_jl->j_list_bitmap)) { if (!(journal->j_current_jl->j_list_bitmap)) {
reiserfs_panic(p_s_sb, "journal-1996", reiserfs_panic(sb, "journal-1996",
"could not get a list bitmap"); "could not get a list bitmap");
} }
atomic_set(&(journal->j_jlock), 0); atomic_set(&(journal->j_jlock), 0);
unlock_journal(p_s_sb); unlock_journal(sb);
/* wake up any body waiting to join. */ /* wake up any body waiting to join. */
clear_bit(J_WRITERS_QUEUED, &journal->j_state); clear_bit(J_WRITERS_QUEUED, &journal->j_state);
wake_up(&(journal->j_join_wait)); wake_up(&(journal->j_join_wait));
if (!flush && wait_on_commit && if (!flush && wait_on_commit &&
journal_list_still_alive(p_s_sb, commit_trans_id)) { journal_list_still_alive(sb, commit_trans_id)) {
flush_commit_list(p_s_sb, jl, 1); flush_commit_list(sb, jl, 1);
} }
out: out:
reiserfs_check_lock_depth(p_s_sb, "journal end2"); reiserfs_check_lock_depth(sb, "journal end2");
memset(th, 0, sizeof(*th)); memset(th, 0, sizeof(*th));
/* Re-set th->t_super, so we can properly keep track of how many /* Re-set th->t_super, so we can properly keep track of how many
* persistent transactions there are. We need to do this so if this * persistent transactions there are. We need to do this so if this
* call is part of a failed restart_transaction, we can free it later */ * call is part of a failed restart_transaction, we can free it later */
th->t_super = p_s_sb; th->t_super = sb;
return journal->j_errno; return journal->j_errno;
} }
......
...@@ -245,7 +245,7 @@ static const struct reiserfs_key MAX_KEY = { ...@@ -245,7 +245,7 @@ static const struct reiserfs_key MAX_KEY = {
static inline const struct reiserfs_key *get_lkey(const struct treepath static inline const struct reiserfs_key *get_lkey(const struct treepath
*p_s_chk_path, *p_s_chk_path,
const struct super_block const struct super_block
*p_s_sb) *sb)
{ {
int n_position, n_path_offset = p_s_chk_path->path_length; int n_position, n_path_offset = p_s_chk_path->path_length;
struct buffer_head *p_s_parent; struct buffer_head *p_s_parent;
...@@ -282,14 +282,14 @@ static inline const struct reiserfs_key *get_lkey(const struct treepath ...@@ -282,14 +282,14 @@ static inline const struct reiserfs_key *get_lkey(const struct treepath
} }
/* Return MIN_KEY if we are in the root of the buffer tree. */ /* Return MIN_KEY if we are in the root of the buffer tree. */
if (PATH_OFFSET_PBUFFER(p_s_chk_path, FIRST_PATH_ELEMENT_OFFSET)-> if (PATH_OFFSET_PBUFFER(p_s_chk_path, FIRST_PATH_ELEMENT_OFFSET)->
b_blocknr == SB_ROOT_BLOCK(p_s_sb)) b_blocknr == SB_ROOT_BLOCK(sb))
return &MIN_KEY; return &MIN_KEY;
return &MAX_KEY; return &MAX_KEY;
} }
/* Get delimiting key of the buffer at the path and its right neighbor. */ /* Get delimiting key of the buffer at the path and its right neighbor. */
inline const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path, inline 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 n_position, n_path_offset = p_s_chk_path->path_length; int n_position, n_path_offset = p_s_chk_path->path_length;
struct buffer_head *p_s_parent; struct buffer_head *p_s_parent;
...@@ -325,7 +325,7 @@ inline const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path, ...@@ -325,7 +325,7 @@ inline const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
} }
/* Return MAX_KEY if we are in the root of the buffer tree. */ /* Return MAX_KEY if we are in the root of the buffer tree. */
if (PATH_OFFSET_PBUFFER(p_s_chk_path, FIRST_PATH_ELEMENT_OFFSET)-> if (PATH_OFFSET_PBUFFER(p_s_chk_path, FIRST_PATH_ELEMENT_OFFSET)->
b_blocknr == SB_ROOT_BLOCK(p_s_sb)) b_blocknr == SB_ROOT_BLOCK(sb))
return &MAX_KEY; return &MAX_KEY;
return &MIN_KEY; return &MIN_KEY;
} }
...@@ -337,7 +337,7 @@ inline const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path, ...@@ -337,7 +337,7 @@ inline const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
this case get_lkey and get_rkey return a special key which is MIN_KEY or MAX_KEY. */ this case get_lkey and get_rkey return a special key which is MIN_KEY or MAX_KEY. */
static inline int key_in_buffer(struct treepath *p_s_chk_path, /* Path which should be checked. */ static inline int key_in_buffer(struct treepath *p_s_chk_path, /* Path which should be checked. */
const struct cpu_key *p_s_key, /* Key which should be checked. */ const struct cpu_key *p_s_key, /* Key which should be checked. */
struct super_block *p_s_sb /* Super block pointer. */ struct super_block *sb /* Super block pointer. */
) )
{ {
...@@ -348,11 +348,11 @@ static inline int key_in_buffer(struct treepath *p_s_chk_path, /* Path which sho ...@@ -348,11 +348,11 @@ static inline int key_in_buffer(struct treepath *p_s_chk_path, /* Path which sho
RFALSE(!PATH_PLAST_BUFFER(p_s_chk_path)->b_bdev, RFALSE(!PATH_PLAST_BUFFER(p_s_chk_path)->b_bdev,
"PAP-5060: device must not be NODEV"); "PAP-5060: device must not be NODEV");
if (comp_keys(get_lkey(p_s_chk_path, p_s_sb), p_s_key) == 1) if (comp_keys(get_lkey(p_s_chk_path, sb), p_s_key) == 1)
/* left delimiting key is bigger, that the key we look for */ /* left delimiting key is bigger, that the key we look for */
return 0; return 0;
// if ( comp_keys(p_s_key, get_rkey(p_s_chk_path, p_s_sb)) != -1 ) // if ( comp_keys(p_s_key, get_rkey(p_s_chk_path, sb)) != -1 )
if (comp_keys(get_rkey(p_s_chk_path, p_s_sb), p_s_key) != 1) if (comp_keys(get_rkey(p_s_chk_path, sb), p_s_key) != 1)
/* p_s_key must be less than right delimitiing key */ /* p_s_key must be less than right delimitiing key */
return 0; return 0;
return 1; return 1;
...@@ -546,7 +546,7 @@ static void search_by_key_reada(struct super_block *s, ...@@ -546,7 +546,7 @@ static void search_by_key_reada(struct super_block *s,
/************************************************************************** /**************************************************************************
* Algorithm SearchByKey * * Algorithm SearchByKey *
* look for item in the Disk S+Tree by its key * * look for item in the Disk S+Tree by its key *
* Input: p_s_sb - super block * * Input: sb - super block *
* p_s_key - pointer to the key to search * * p_s_key - pointer to the key to search *
* Output: ITEM_FOUND, ITEM_NOT_FOUND or IO_ERROR * * Output: ITEM_FOUND, ITEM_NOT_FOUND or IO_ERROR *
* p_s_search_path - path from the root to the needed leaf * * p_s_search_path - path from the root to the needed leaf *
...@@ -566,7 +566,7 @@ static void search_by_key_reada(struct super_block *s, ...@@ -566,7 +566,7 @@ static void search_by_key_reada(struct super_block *s,
correctness of the top of the path but need not be checked for the correctness of the top of the path but need not be checked for the
correctness of the bottom of the path */ correctness of the bottom of the path */
/* The function is NOT SCHEDULE-SAFE! */ /* The function is NOT SCHEDULE-SAFE! */
int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* Key to search. */ int search_by_key(struct super_block *sb, const struct cpu_key *p_s_key, /* Key to search. */
struct treepath *p_s_search_path,/* This structure was struct treepath *p_s_search_path,/* This structure was
allocated and initialized allocated and initialized
by the calling by the calling
...@@ -592,7 +592,7 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -592,7 +592,7 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
int n_repeat_counter = 0; int n_repeat_counter = 0;
#endif #endif
PROC_INFO_INC(p_s_sb, search_by_key); PROC_INFO_INC(sb, search_by_key);
/* As we add each node to a path we increase its count. This means that /* As we add each node to a path we increase its count. This means that
we must be careful to release all nodes in a path before we either we must be careful to release all nodes in a path before we either
...@@ -605,13 +605,13 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -605,13 +605,13 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
/* With each iteration of this loop we search through the items in the /* With each iteration of this loop we search through the items in the
current node, and calculate the next current node(next path element) current node, and calculate the next current node(next path element)
for the next iteration of this loop.. */ for the next iteration of this loop.. */
n_block_number = SB_ROOT_BLOCK(p_s_sb); n_block_number = SB_ROOT_BLOCK(sb);
expected_level = -1; expected_level = -1;
while (1) { while (1) {
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
if (!(++n_repeat_counter % 50000)) if (!(++n_repeat_counter % 50000))
reiserfs_warning(p_s_sb, "PAP-5100", reiserfs_warning(sb, "PAP-5100",
"%s: there were %d iterations of " "%s: there were %d iterations of "
"while loop looking for key %K", "while loop looking for key %K",
current->comm, n_repeat_counter, current->comm, n_repeat_counter,
...@@ -622,14 +622,14 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -622,14 +622,14 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
p_s_last_element = p_s_last_element =
PATH_OFFSET_PELEMENT(p_s_search_path, PATH_OFFSET_PELEMENT(p_s_search_path,
++p_s_search_path->path_length); ++p_s_search_path->path_length);
fs_gen = get_generation(p_s_sb); fs_gen = get_generation(sb);
/* Read the next tree node, and set the last element in the path to /* Read the next tree node, and set the last element in the path to
have a pointer to it. */ have a pointer to it. */
if ((p_s_bh = p_s_last_element->pe_buffer = if ((p_s_bh = p_s_last_element->pe_buffer =
sb_getblk(p_s_sb, n_block_number))) { sb_getblk(sb, n_block_number))) {
if (!buffer_uptodate(p_s_bh) && reada_count > 1) { if (!buffer_uptodate(p_s_bh) && reada_count > 1) {
search_by_key_reada(p_s_sb, reada_bh, search_by_key_reada(sb, reada_bh,
reada_blocks, reada_count); reada_blocks, reada_count);
} }
ll_rw_block(READ, 1, &p_s_bh); ll_rw_block(READ, 1, &p_s_bh);
...@@ -644,25 +644,25 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -644,25 +644,25 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
} }
reada_count = 0; reada_count = 0;
if (expected_level == -1) if (expected_level == -1)
expected_level = SB_TREE_HEIGHT(p_s_sb); expected_level = SB_TREE_HEIGHT(sb);
expected_level--; expected_level--;
/* It is possible that schedule occurred. We must check whether the key /* It is possible that schedule occurred. We must check whether the key
to search is still in the tree rooted from the current buffer. If to search is still in the tree rooted from the current buffer. If
not then repeat search from the root. */ not then repeat search from the root. */
if (fs_changed(fs_gen, p_s_sb) && if (fs_changed(fs_gen, sb) &&
(!B_IS_IN_TREE(p_s_bh) || (!B_IS_IN_TREE(p_s_bh) ||
B_LEVEL(p_s_bh) != expected_level || B_LEVEL(p_s_bh) != expected_level ||
!key_in_buffer(p_s_search_path, p_s_key, p_s_sb))) { !key_in_buffer(p_s_search_path, p_s_key, sb))) {
PROC_INFO_INC(p_s_sb, search_by_key_fs_changed); PROC_INFO_INC(sb, search_by_key_fs_changed);
PROC_INFO_INC(p_s_sb, search_by_key_restarted); PROC_INFO_INC(sb, search_by_key_restarted);
PROC_INFO_INC(p_s_sb, PROC_INFO_INC(sb,
sbk_restarted[expected_level - 1]); sbk_restarted[expected_level - 1]);
pathrelse(p_s_search_path); pathrelse(p_s_search_path);
/* Get the root block number so that we can repeat the search /* Get the root block number so that we can repeat the search
starting from the root. */ starting from the root. */
n_block_number = SB_ROOT_BLOCK(p_s_sb); n_block_number = SB_ROOT_BLOCK(sb);
expected_level = -1; expected_level = -1;
right_neighbor_of_leaf_node = 0; right_neighbor_of_leaf_node = 0;
...@@ -674,12 +674,12 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -674,12 +674,12 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
equal to the MAX_KEY. Latter case is only possible in equal to the MAX_KEY. Latter case is only possible in
"finish_unfinished()" processing during mount. */ "finish_unfinished()" processing during mount. */
RFALSE(comp_keys(&MAX_KEY, p_s_key) && RFALSE(comp_keys(&MAX_KEY, p_s_key) &&
!key_in_buffer(p_s_search_path, p_s_key, p_s_sb), !key_in_buffer(p_s_search_path, p_s_key, sb),
"PAP-5130: key is not in the buffer"); "PAP-5130: key is not in the buffer");
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
if (cur_tb) { if (cur_tb) {
print_cur_tb("5140"); print_cur_tb("5140");
reiserfs_panic(p_s_sb, "PAP-5140", reiserfs_panic(sb, "PAP-5140",
"schedule occurred in do_balance!"); "schedule occurred in do_balance!");
} }
#endif #endif
...@@ -687,7 +687,7 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -687,7 +687,7 @@ 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 // make sure, that the node contents look like a node of
// certain level // certain level
if (!is_tree_node(p_s_bh, expected_level)) { if (!is_tree_node(p_s_bh, expected_level)) {
reiserfs_error(p_s_sb, "vs-5150", reiserfs_error(sb, "vs-5150",
"invalid format found in block %ld. " "invalid format found in block %ld. "
"Fsck?", p_s_bh->b_blocknr); "Fsck?", p_s_bh->b_blocknr);
pathrelse(p_s_search_path); pathrelse(p_s_search_path);
...@@ -697,7 +697,7 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -697,7 +697,7 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
/* ok, we have acquired next formatted node in the tree */ /* ok, we have acquired next formatted node in the tree */
n_node_level = B_LEVEL(p_s_bh); n_node_level = B_LEVEL(p_s_bh);
PROC_INFO_BH_STAT(p_s_sb, p_s_bh, n_node_level - 1); PROC_INFO_BH_STAT(sb, p_s_bh, n_node_level - 1);
RFALSE(n_node_level < n_stop_level, RFALSE(n_node_level < n_stop_level,
"vs-5152: tree level (%d) is less than stop level (%d)", "vs-5152: tree level (%d) is less than stop level (%d)",
...@@ -776,7 +776,7 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -776,7 +776,7 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
units of directory entries. */ units of directory entries. */
/* The function is NOT SCHEDULE-SAFE! */ /* The function is NOT SCHEDULE-SAFE! */
int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the super block. */ int search_for_position_by_key(struct super_block *sb, /* Pointer to the super block. */
const struct cpu_key *p_cpu_key, /* Key to search (cpu variable) */ const struct cpu_key *p_cpu_key, /* Key to search (cpu variable) */
struct treepath *p_s_search_path /* Filled up by this function. */ struct treepath *p_s_search_path /* Filled up by this function. */
) )
...@@ -789,13 +789,13 @@ int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the sup ...@@ -789,13 +789,13 @@ int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the sup
/* If searching for directory entry. */ /* If searching for directory entry. */
if (is_direntry_cpu_key(p_cpu_key)) if (is_direntry_cpu_key(p_cpu_key))
return search_by_entry_key(p_s_sb, p_cpu_key, p_s_search_path, return search_by_entry_key(sb, p_cpu_key, p_s_search_path,
&de); &de);
/* If not searching for directory entry. */ /* If not searching for directory entry. */
/* If item is found. */ /* If item is found. */
retval = search_item(p_s_sb, p_cpu_key, p_s_search_path); retval = search_item(sb, p_cpu_key, p_s_search_path);
if (retval == IO_ERROR) if (retval == IO_ERROR)
return retval; return retval;
if (retval == ITEM_FOUND) { if (retval == ITEM_FOUND) {
...@@ -817,7 +817,7 @@ int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the sup ...@@ -817,7 +817,7 @@ int search_for_position_by_key(struct super_block *p_s_sb, /* Pointer to the sup
p_le_ih = p_le_ih =
B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_search_path), B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_search_path),
--PATH_LAST_POSITION(p_s_search_path)); --PATH_LAST_POSITION(p_s_search_path));
n_blk_size = p_s_sb->s_blocksize; n_blk_size = sb->s_blocksize;
if (comp_short_keys(&(p_le_ih->ih_key), p_cpu_key)) { if (comp_short_keys(&(p_le_ih->ih_key), p_cpu_key)) {
return FILE_NOT_FOUND; return FILE_NOT_FOUND;
...@@ -957,7 +957,7 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st ...@@ -957,7 +957,7 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st
int *p_n_cut_size, unsigned long long n_new_file_length /* MAX_KEY_OFFSET in case of delete. */ int *p_n_cut_size, unsigned long long n_new_file_length /* MAX_KEY_OFFSET in case of delete. */
) )
{ {
struct super_block *p_s_sb = inode->i_sb; struct super_block *sb = inode->i_sb;
struct item_head *p_le_ih = PATH_PITEM_HEAD(p_s_path); struct item_head *p_le_ih = PATH_PITEM_HEAD(p_s_path);
struct buffer_head *p_s_bh = PATH_PLAST_BUFFER(p_s_path); struct buffer_head *p_s_bh = PATH_PLAST_BUFFER(p_s_path);
...@@ -986,7 +986,7 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st ...@@ -986,7 +986,7 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st
/* Case of an indirect item. */ /* Case of an indirect item. */
{ {
int blk_size = p_s_sb->s_blocksize; int blk_size = sb->s_blocksize;
struct item_head s_ih; struct item_head s_ih;
int need_re_search; int need_re_search;
int delete = 0; int delete = 0;
...@@ -1023,9 +1023,9 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st ...@@ -1023,9 +1023,9 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st
block = get_block_num(unfm, 0); block = get_block_num(unfm, 0);
if (block != 0) { if (block != 0) {
reiserfs_prepare_for_journal(p_s_sb, p_s_bh, 1); reiserfs_prepare_for_journal(sb, p_s_bh, 1);
put_block_num(unfm, 0, 0); put_block_num(unfm, 0, 0);
journal_mark_dirty (th, p_s_sb, p_s_bh); journal_mark_dirty (th, sb, p_s_bh);
reiserfs_free_block(th, inode, block, 1); reiserfs_free_block(th, inode, block, 1);
} }
...@@ -1049,9 +1049,9 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st ...@@ -1049,9 +1049,9 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st
/* a trick. If the buffer has been logged, this will do nothing. If /* a trick. If the buffer has been logged, this will do nothing. If
** we've broken the loop without logging it, it will restore the ** we've broken the loop without logging it, it will restore the
** buffer */ ** buffer */
reiserfs_restore_prepared_buffer(p_s_sb, p_s_bh); reiserfs_restore_prepared_buffer(sb, p_s_bh);
} while (need_re_search && } while (need_re_search &&
search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path) == POSITION_FOUND); search_for_position_by_key(sb, p_s_item_key, p_s_path) == POSITION_FOUND);
pos_in_item(p_s_path) = pos * UNFM_P_SIZE; pos_in_item(p_s_path) = pos * UNFM_P_SIZE;
if (*p_n_cut_size == 0) { if (*p_n_cut_size == 0) {
...@@ -1090,7 +1090,7 @@ static int calc_deleted_bytes_number(struct tree_balance *p_s_tb, char c_mode) ...@@ -1090,7 +1090,7 @@ static int calc_deleted_bytes_number(struct tree_balance *p_s_tb, char c_mode)
static void init_tb_struct(struct reiserfs_transaction_handle *th, static void init_tb_struct(struct reiserfs_transaction_handle *th,
struct tree_balance *p_s_tb, struct tree_balance *p_s_tb,
struct super_block *p_s_sb, struct super_block *sb,
struct treepath *p_s_path, int n_size) struct treepath *p_s_path, int n_size)
{ {
...@@ -1098,7 +1098,7 @@ static void init_tb_struct(struct reiserfs_transaction_handle *th, ...@@ -1098,7 +1098,7 @@ static void init_tb_struct(struct reiserfs_transaction_handle *th,
memset(p_s_tb, '\0', sizeof(struct tree_balance)); memset(p_s_tb, '\0', sizeof(struct tree_balance));
p_s_tb->transaction_handle = th; p_s_tb->transaction_handle = th;
p_s_tb->tb_sb = p_s_sb; p_s_tb->tb_sb = sb;
p_s_tb->tb_path = p_s_path; p_s_tb->tb_path = p_s_path;
PATH_OFFSET_PBUFFER(p_s_path, ILLEGAL_PATH_ELEMENT_OFFSET) = NULL; PATH_OFFSET_PBUFFER(p_s_path, ILLEGAL_PATH_ELEMENT_OFFSET) = NULL;
PATH_OFFSET_POSITION(p_s_path, ILLEGAL_PATH_ELEMENT_OFFSET) = 0; PATH_OFFSET_POSITION(p_s_path, ILLEGAL_PATH_ELEMENT_OFFSET) = 0;
...@@ -1147,7 +1147,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath ...@@ -1147,7 +1147,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath
struct inode *p_s_inode, /* inode is here just to update i_blocks and quotas */ struct inode *p_s_inode, /* inode is here just to update i_blocks and quotas */
struct buffer_head *p_s_un_bh) struct buffer_head *p_s_un_bh)
{ /* NULL or unformatted node pointer. */ { /* NULL or unformatted node pointer. */
struct super_block *p_s_sb = p_s_inode->i_sb; struct super_block *sb = p_s_inode->i_sb;
struct tree_balance s_del_balance; struct tree_balance s_del_balance;
struct item_head s_ih; struct item_head s_ih;
struct item_head *q_ih; struct item_head *q_ih;
...@@ -1161,7 +1161,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath ...@@ -1161,7 +1161,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
init_tb_struct(th, &s_del_balance, p_s_sb, p_s_path, init_tb_struct(th, &s_del_balance, sb, p_s_path,
0 /*size is unknown */ ); 0 /*size is unknown */ );
while (1) { while (1) {
...@@ -1185,15 +1185,15 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath ...@@ -1185,15 +1185,15 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath
if (n_ret_value != REPEAT_SEARCH) if (n_ret_value != REPEAT_SEARCH)
break; break;
PROC_INFO_INC(p_s_sb, delete_item_restarted); PROC_INFO_INC(sb, delete_item_restarted);
// file system changed, repeat search // file system changed, repeat search
n_ret_value = n_ret_value =
search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path); search_for_position_by_key(sb, p_s_item_key, p_s_path);
if (n_ret_value == IO_ERROR) if (n_ret_value == IO_ERROR)
break; break;
if (n_ret_value == FILE_NOT_FOUND) { if (n_ret_value == FILE_NOT_FOUND) {
reiserfs_warning(p_s_sb, "vs-5340", reiserfs_warning(sb, "vs-5340",
"no items of the file %K found", "no items of the file %K found",
p_s_item_key); p_s_item_key);
break; break;
...@@ -1216,8 +1216,8 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath ...@@ -1216,8 +1216,8 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath
** the unfm node once ** the unfm node once
*/ */
if (!S_ISLNK(p_s_inode->i_mode) && is_direct_le_ih(q_ih)) { if (!S_ISLNK(p_s_inode->i_mode) && is_direct_le_ih(q_ih)) {
if ((le_ih_k_offset(q_ih) & (p_s_sb->s_blocksize - 1)) == 1) { if ((le_ih_k_offset(q_ih) & (sb->s_blocksize - 1)) == 1) {
quota_cut_bytes = p_s_sb->s_blocksize + UNFM_P_SIZE; quota_cut_bytes = sb->s_blocksize + UNFM_P_SIZE;
} else { } else {
quota_cut_bytes = 0; quota_cut_bytes = 0;
} }
...@@ -1258,7 +1258,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath ...@@ -1258,7 +1258,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath
do_balance(&s_del_balance, NULL, NULL, M_DELETE); do_balance(&s_del_balance, NULL, NULL, M_DELETE);
#ifdef REISERQUOTA_DEBUG #ifdef REISERQUOTA_DEBUG
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, reiserfs_debug(sb, REISERFS_DEBUG_CODE,
"reiserquota delete_item(): freeing %u, id=%u type=%c", "reiserquota delete_item(): freeing %u, id=%u type=%c",
quota_cut_bytes, p_s_inode->i_uid, head2type(&s_ih)); quota_cut_bytes, p_s_inode->i_uid, head2type(&s_ih));
#endif #endif
...@@ -1430,8 +1430,8 @@ static int maybe_indirect_to_direct(struct reiserfs_transaction_handle *th, ...@@ -1430,8 +1430,8 @@ static int maybe_indirect_to_direct(struct reiserfs_transaction_handle *th,
const struct cpu_key *p_s_item_key, const struct cpu_key *p_s_item_key,
loff_t n_new_file_size, char *p_c_mode) loff_t n_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;
int n_block_size = p_s_sb->s_blocksize; int n_block_size = sb->s_blocksize;
int cut_bytes; int cut_bytes;
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
BUG_ON(n_new_file_size != p_s_inode->i_size); BUG_ON(n_new_file_size != p_s_inode->i_size);
...@@ -1509,7 +1509,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1509,7 +1509,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
struct inode *p_s_inode, struct inode *p_s_inode,
struct page *page, loff_t n_new_file_size) struct page *page, loff_t n_new_file_size)
{ {
struct super_block *p_s_sb = p_s_inode->i_sb; struct super_block *sb = p_s_inode->i_sb;
/* Every function which is going to call do_balance must first /* Every function which is going to call do_balance must first
create a tree_balance structure. Then it must fill up this create a tree_balance structure. Then it must fill up this
structure by using the init_tb_struct and fix_nodes functions. structure by using the init_tb_struct and fix_nodes functions.
...@@ -1560,7 +1560,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1560,7 +1560,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
/* removing of last unformatted node will change value we /* removing of last unformatted node will change value we
have to return to truncate. Save it */ have to return to truncate. Save it */
retval2 = n_ret_value; retval2 = n_ret_value;
/*retval2 = p_s_sb->s_blocksize - (n_new_file_size & (p_s_sb->s_blocksize - 1)); */ /*retval2 = sb->s_blocksize - (n_new_file_size & (sb->s_blocksize - 1)); */
/* So, we have performed the first part of the conversion: /* So, we have performed the first part of the conversion:
inserting the new direct item. Now we are removing the inserting the new direct item. Now we are removing the
...@@ -1569,16 +1569,16 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1569,16 +1569,16 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
set_cpu_key_k_type(p_s_item_key, TYPE_INDIRECT); set_cpu_key_k_type(p_s_item_key, TYPE_INDIRECT);
p_s_item_key->key_length = 4; p_s_item_key->key_length = 4;
n_new_file_size -= n_new_file_size -=
(n_new_file_size & (p_s_sb->s_blocksize - 1)); (n_new_file_size & (sb->s_blocksize - 1));
tail_pos = n_new_file_size; tail_pos = n_new_file_size;
set_cpu_key_k_offset(p_s_item_key, n_new_file_size + 1); set_cpu_key_k_offset(p_s_item_key, n_new_file_size + 1);
if (search_for_position_by_key if (search_for_position_by_key
(p_s_sb, p_s_item_key, (sb, p_s_item_key,
p_s_path) == POSITION_NOT_FOUND) { p_s_path) == POSITION_NOT_FOUND) {
print_block(PATH_PLAST_BUFFER(p_s_path), 3, print_block(PATH_PLAST_BUFFER(p_s_path), 3,
PATH_LAST_POSITION(p_s_path) - 1, PATH_LAST_POSITION(p_s_path) - 1,
PATH_LAST_POSITION(p_s_path) + 1); PATH_LAST_POSITION(p_s_path) + 1);
reiserfs_panic(p_s_sb, "PAP-5580", "item to " reiserfs_panic(sb, "PAP-5580", "item to "
"convert does not exist (%K)", "convert does not exist (%K)",
p_s_item_key); p_s_item_key);
} }
...@@ -1595,14 +1595,14 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1595,14 +1595,14 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
if (n_ret_value != REPEAT_SEARCH) if (n_ret_value != REPEAT_SEARCH)
break; break;
PROC_INFO_INC(p_s_sb, cut_from_item_restarted); PROC_INFO_INC(sb, cut_from_item_restarted);
n_ret_value = n_ret_value =
search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path); search_for_position_by_key(sb, p_s_item_key, p_s_path);
if (n_ret_value == POSITION_FOUND) if (n_ret_value == POSITION_FOUND)
continue; continue;
reiserfs_warning(p_s_sb, "PAP-5610", "item %K not found", reiserfs_warning(sb, "PAP-5610", "item %K not found",
p_s_item_key); p_s_item_key);
unfix_nodes(&s_cut_balance); unfix_nodes(&s_cut_balance);
return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT; return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT;
...@@ -1616,7 +1616,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1616,7 +1616,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
indirect_to_direct_roll_back(th, p_s_inode, p_s_path); indirect_to_direct_roll_back(th, p_s_inode, p_s_path);
} }
if (n_ret_value == NO_DISK_SPACE) if (n_ret_value == NO_DISK_SPACE)
reiserfs_warning(p_s_sb, "reiserfs-5092", reiserfs_warning(sb, "reiserfs-5092",
"NO_DISK_SPACE"); "NO_DISK_SPACE");
unfix_nodes(&s_cut_balance); unfix_nodes(&s_cut_balance);
return -EIO; return -EIO;
...@@ -1642,11 +1642,11 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1642,11 +1642,11 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
p_le_ih = PATH_PITEM_HEAD(s_cut_balance.tb_path); p_le_ih = PATH_PITEM_HEAD(s_cut_balance.tb_path);
if (!S_ISLNK(p_s_inode->i_mode) && is_direct_le_ih(p_le_ih)) { if (!S_ISLNK(p_s_inode->i_mode) && is_direct_le_ih(p_le_ih)) {
if (c_mode == M_DELETE && if (c_mode == M_DELETE &&
(le_ih_k_offset(p_le_ih) & (p_s_sb->s_blocksize - 1)) == (le_ih_k_offset(p_le_ih) & (sb->s_blocksize - 1)) ==
1) { 1) {
// FIXME: this is to keep 3.5 happy // FIXME: this is to keep 3.5 happy
REISERFS_I(p_s_inode)->i_first_direct_byte = U32_MAX; REISERFS_I(p_s_inode)->i_first_direct_byte = U32_MAX;
quota_cut_bytes = p_s_sb->s_blocksize + UNFM_P_SIZE; quota_cut_bytes = sb->s_blocksize + UNFM_P_SIZE;
} else { } else {
quota_cut_bytes = 0; quota_cut_bytes = 0;
} }
...@@ -1659,18 +1659,18 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1659,18 +1659,18 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
sure, that we exactly remove last unformatted node pointer sure, that we exactly remove last unformatted node pointer
of the item */ of the item */
if (!is_indirect_le_ih(le_ih)) if (!is_indirect_le_ih(le_ih))
reiserfs_panic(p_s_sb, "vs-5652", reiserfs_panic(sb, "vs-5652",
"item must be indirect %h", le_ih); "item must be indirect %h", le_ih);
if (c_mode == M_DELETE && ih_item_len(le_ih) != UNFM_P_SIZE) if (c_mode == M_DELETE && ih_item_len(le_ih) != UNFM_P_SIZE)
reiserfs_panic(p_s_sb, "vs-5653", "completing " reiserfs_panic(sb, "vs-5653", "completing "
"indirect2direct conversion indirect " "indirect2direct conversion indirect "
"item %h being deleted must be of " "item %h being deleted must be of "
"4 byte long", le_ih); "4 byte long", le_ih);
if (c_mode == M_CUT if (c_mode == M_CUT
&& s_cut_balance.insert_size[0] != -UNFM_P_SIZE) { && s_cut_balance.insert_size[0] != -UNFM_P_SIZE) {
reiserfs_panic(p_s_sb, "vs-5654", "can not complete " reiserfs_panic(sb, "vs-5654", "can not complete "
"indirect2direct conversion of %h " "indirect2direct conversion of %h "
"(CUT, insert_size==%d)", "(CUT, insert_size==%d)",
le_ih, s_cut_balance.insert_size[0]); le_ih, s_cut_balance.insert_size[0]);
......
...@@ -175,9 +175,9 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in ...@@ -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. */ loff_t n_new_file_size, /* New file size. */
char *p_c_mode) 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; 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; char *tail;
int tail_len, round_tail_len; int tail_len, round_tail_len;
loff_t pos, pos1; /* position of first byte of the tail */ 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 ...@@ -185,7 +185,7 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
REISERFS_SB(p_s_sb)->s_indirect2direct++; REISERFS_SB(sb)->s_indirect2direct++;
*p_c_mode = M_SKIP_BALANCING; *p_c_mode = M_SKIP_BALANCING;
...@@ -200,7 +200,7 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in ...@@ -200,7 +200,7 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in
pos = pos =
le_ih_k_offset(&s_ih) - 1 + (ih_item_len(&s_ih) / UNFM_P_SIZE - 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; pos1 = pos;
// we are protected by i_mutex. The tail can not disapper, not // 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 ...@@ -211,18 +211,18 @@ int indirect2direct(struct reiserfs_transaction_handle *th, struct inode *p_s_in
if (path_changed(&s_ih, p_s_path)) { if (path_changed(&s_ih, p_s_path)) {
/* re-search indirect item */ /* 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) == POSITION_NOT_FOUND)
reiserfs_panic(p_s_sb, "PAP-5520", reiserfs_panic(sb, "PAP-5520",
"item to be converted %K does not exist", "item to be converted %K does not exist",
p_s_item_key); p_s_item_key);
copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path)); copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path));
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
pos = le_ih_k_offset(&s_ih) - 1 + pos = le_ih_k_offset(&s_ih) - 1 +
(ih_item_len(&s_ih) / UNFM_P_SIZE - (ih_item_len(&s_ih) / UNFM_P_SIZE -
1) * p_s_sb->s_blocksize; 1) * sb->s_blocksize;
if (pos != pos1) 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"); "changed while we were reading it");
#endif #endif
} }
......
...@@ -1769,12 +1769,12 @@ int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *, ...@@ -1769,12 +1769,12 @@ int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *,
int journal_mark_freed(struct reiserfs_transaction_handle *, int journal_mark_freed(struct reiserfs_transaction_handle *,
struct super_block *, b_blocknr_t blocknr); struct super_block *, b_blocknr_t blocknr);
int journal_transaction_should_end(struct reiserfs_transaction_handle *, int); 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 reiserfs_in_journal(struct super_block *sb, unsigned int bmap_nr,
int bit_nr, int searchall, b_blocknr_t *next); int bit_nr, int searchall, b_blocknr_t *next);
int journal_begin(struct reiserfs_transaction_handle *, 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 *, 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_journal(struct super_block *sb, int errno);
void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...); void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...);
int reiserfs_allocate_list_bitmaps(struct super_block *s, int reiserfs_allocate_list_bitmaps(struct super_block *s,
...@@ -1830,11 +1830,11 @@ static inline void copy_key(struct reiserfs_key *to, ...@@ -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); 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 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 *, int search_by_key(struct super_block *, const struct cpu_key *,
struct treepath *, int); struct treepath *, int);
#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) #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, const struct cpu_key *p_s_cpu_key,
struct treepath *p_s_search_path); struct treepath *p_s_search_path);
extern void decrement_bcount(struct buffer_head *p_s_bh); 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, ...@@ -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_MAX( sb, field, value ) VOID_V
#define PROC_INFO_INC( sb, field ) VOID_V #define PROC_INFO_INC( sb, field ) VOID_V
#define PROC_INFO_ADD( sb, field, val ) 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 #endif
/* dir.c */ /* 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