Commit b1a4861d authored by Vladimir Saveliev's avatar Vladimir Saveliev Committed by Linus Torvalds

do not require for exclusive access to buffer

parent a321a55f
......@@ -6,7 +6,7 @@ obj-$(CONFIG_REISERFS_FS) += reiserfs.o
reiserfs-objs := bitmap.o do_balan.o namei.o inode.o file.o dir.o fix_node.o \
super.o prints.o objectid.o lbalance.o ibalance.o stree.o \
hashes.o buffer2.o tail_conversion.o journal.o resize.o \
hashes.o tail_conversion.o journal.o resize.o \
item_ops.o ioctl.o procfs.o
# gcc -O2 (the kernel default) is overaggressive on ppc32 when many inline
......
......@@ -1078,13 +1078,9 @@ static int balance_leaf (struct tree_balance * tb,
memcpy (insert_key + i,B_N_PKEY(S_new[i],0),KEY_SIZE);
insert_ptr[i] = S_new[i];
RFALSE( (atomic_read (&(S_new[i]->b_count)) != 1) &&
(atomic_read(&(S_new[i]->b_count)) != 2 ||
!(buffer_journaled(S_new[i]) ||
buffer_journal_dirty(S_new[i]))),
RFALSE (!buffer_journaled (S_new [i]) || buffer_journal_dirty (S_new [i]) ||
buffer_dirty (S_new [i]),
"PAP-12247: S_new[%d] : (%b)\n", i, S_new[i]);
}
/* if the affected item was not wholly shifted then we perform all necessary operations on that part or whole of the
......
......@@ -807,32 +807,15 @@ static int get_empty_nodes(
"PAP-8135: reiserfs_new_blocknrs failed when got new blocks");
p_s_new_bh = sb_getblk(p_s_sb, *p_n_blocknr);
if (atomic_read (&(p_s_new_bh->b_count)) > 1) {
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/*
reiserfs_warning ("waiting for buffer %b, iput inode pid = %d, this pid %d, mode %c, %h\n",
p_s_new_bh, put_inode_pid, current->pid, p_s_tb->tb_vn->vn_mode, p_s_tb->tb_vn->vn_ins_ih);
print_tb (0, 0, 0, p_s_tb, "tb");
*/
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
if (atomic_read(&(p_s_new_bh->b_count)) > 2 ||
!(buffer_journaled(p_s_new_bh) || buffer_journal_dirty(p_s_new_bh))) {
n_retval = REPEAT_SEARCH ;
free_buffers_in_tb (p_s_tb);
wait_buffer_until_released (p_s_new_bh);
}
}
RFALSE( (atomic_read (&(p_s_new_bh->b_count)) != 1 ||
buffer_dirty (p_s_new_bh)) &&
(atomic_read(&(p_s_new_bh->b_count)) > 2 ||
!(buffer_journaled(p_s_new_bh) ||
buffer_journal_dirty(p_s_new_bh))),
"PAP-8140: not free or dirty buffer %b for the new block",
RFALSE (buffer_dirty (p_s_new_bh) ||
buffer_journaled (p_s_new_bh) ||
buffer_journal_dirty (p_s_new_bh),
"PAP-8140: journlaled or dirty buffer %b for the new block",
p_s_new_bh);
/* Put empty buffers into the array. */
if (p_s_tb->FEB[p_s_tb->cur_blknum])
BUG();
RFALSE (p_s_tb->FEB[p_s_tb->cur_blknum],
"PAP-8141: busy slot for new buffer");
mark_buffer_journal_new(p_s_new_bh) ;
p_s_tb->FEB[p_s_tb->cur_blknum++] = p_s_new_bh;
......@@ -1926,7 +1909,7 @@ static int get_neighbors(
n_child_position = ( p_s_bh == p_s_tb->FL[n_h] ) ? p_s_tb->lkey[n_h] : B_NR_ITEMS (p_s_tb->FL[n_h]);
n_son_number = B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position);
p_s_bh = reiserfs_bread(p_s_sb, n_son_number);
p_s_bh = sb_bread(p_s_sb, n_son_number);
if (!p_s_bh)
return IO_ERROR;
if ( FILESYSTEM_CHANGED_TB (p_s_tb) ) {
......@@ -1959,7 +1942,7 @@ static int get_neighbors(
n_child_position = ( p_s_bh == p_s_tb->FR[n_h] ) ? p_s_tb->rkey[n_h] + 1 : 0;
n_son_number = B_N_CHILD_NUM(p_s_tb->FR[n_h], n_child_position);
p_s_bh = reiserfs_bread(p_s_sb, n_son_number);
p_s_bh = sb_bread(p_s_sb, n_son_number);
if (!p_s_bh)
return IO_ERROR;
if ( FILESYSTEM_CHANGED_TB (p_s_tb) ) {
......
......@@ -1028,9 +1028,8 @@ int balance_internal (struct tree_balance * tb, /* tree_balance structure */
/* new_insert_ptr = node_pointer to S_new */
new_insert_ptr = S_new;
RFALSE(( buffer_locked(S_new) || atomic_read (&(S_new->b_count)) != 1) &&
(buffer_locked(S_new) || atomic_read(&(S_new->b_count)) > 2 ||
!(buffer_journaled(S_new) || buffer_journal_dirty(S_new))),
RFALSE (!buffer_journaled(S_new) || buffer_journal_dirty(S_new) ||
buffer_dirty (S_new),
"cm-00001: bad S_new (%b)", S_new);
// S_new is released in unfix_nodes
......
......@@ -700,7 +700,7 @@ int search_by_key (struct super_block * p_s_sb,
/* Read the next tree node, and set the last element in the path to
have a pointer to it. */
if ( ! (p_s_bh = p_s_last_element->pe_buffer =
reiserfs_bread(p_s_sb, n_block_number)) ) {
sb_bread(p_s_sb, n_block_number)) ) {
p_s_search_path->path_length --;
pathrelse(p_s_search_path);
return IO_ERROR;
......
......@@ -775,7 +775,7 @@ static int read_old_bitmaps (struct super_block * s)
memset (SB_AP_BITMAP (s), 0, sizeof (struct buffer_head *) * sb_bmap_nr(rs));
for (i = 0; i < sb_bmap_nr(rs); i ++) {
SB_AP_BITMAP (s)[i] = reiserfs_bread (s, bmp1 + i);
SB_AP_BITMAP (s)[i] = sb_bread (s, bmp1 + i);
if (!SB_AP_BITMAP (s)[i])
return 1;
}
......@@ -827,7 +827,7 @@ static int read_super_block (struct super_block * s, int offset)
sb_set_blocksize (s, sb_blocksize(rs));
brelse (bh);
bh = reiserfs_bread (s, offset / s->s_blocksize);
bh = sb_bread (s, offset / s->s_blocksize);
if (!bh) {
printk("sh-2007: read_super_block: "
"bread failed (dev %s, block %lu, size %lu)\n",
......
......@@ -1937,14 +1937,6 @@ void reiserfs_unmap_buffer(struct buffer_head *) ;
extern struct inode_operations reiserfs_file_inode_operations;
extern struct file_operations reiserfs_file_operations;
extern struct address_space_operations reiserfs_address_space_operations ;
int get_new_buffer (struct reiserfs_transaction_handle *th, struct buffer_head *,
struct buffer_head **, struct path *);
/* buffer2.c */
struct buffer_head * reiserfs_getblk (struct super_block *super, int n_block);
void wait_buffer_until_released (const struct buffer_head * bh);
struct buffer_head * reiserfs_bread (struct super_block *super, int n_block);
/* fix_nodes.c */
#ifdef CONFIG_REISERFS_CHECK
......
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