cleanup: remove unused argument to reiserfs_invalidate_buffer

reiserfs_invalidate_buffer contains an argument to specify whether a block
should be freed after being invalidated. It is always passed as 1, so
let's just get rid of it.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
Jeff Mahoney committed 2013-08-26 17:21:08 -04:00
1 parent 863ef57982
commit d442d18969
3 files changed
+22 -38

No files matched your search

+1 -1
View File
@@ -1470,7 +1470,7 @@ int balance_internal (struct tree_balance * , int, int, struct item_head * ,
/* do_balance.c */
void do_balance (struct tree_balance * tb,
struct item_head * ih, const char * body, int flag, int zeros_num);
void reiserfs_invalidate_buffer (struct tree_balance * tb, struct buffer_head * bh, int);
void reiserfs_invalidate_buffer (struct tree_balance * tb, struct buffer_head * bh);
int get_left_neighbor_position (struct tree_balance * tb, int h);
int get_right_neighbor_position (struct tree_balance * tb, int h);
void replace_key (reiserfs_filsys_t *, struct buffer_head *, int, struct buffer_head *, int);
+16 -32
View File
@@ -137,14 +137,8 @@ static int balance_leaf_when_delete( /*struct reiserfs_transaction_handle *th, *
B_NR_ITEMS(tb->R[0]),
-1, 0);
reiserfs_invalidate_buffer(tb, tbS0,
1
/*do_free_block */
);
reiserfs_invalidate_buffer(tb, tb->R[0],
1
/*do_free_block */
);
reiserfs_invalidate_buffer(tb, tbS0);
reiserfs_invalidate_buffer(tb, tb->R[0]);
return 0;
}
@@ -157,12 +151,8 @@ static int balance_leaf_when_delete( /*struct reiserfs_transaction_handle *th, *
replace_key(tb->tb_fs, tb->CFR[0], tb->rkey[0],
tb->R[0], 0);
reiserfs_invalidate_buffer(tb, tbS0,
1 /*do_free_block */
);
reiserfs_invalidate_buffer(tb, tb->L[0],
1 /*do_free_block */
);
reiserfs_invalidate_buffer(tb, tbS0);
reiserfs_invalidate_buffer(tb, tb->L[0]);
return -1;
}
@@ -170,8 +160,7 @@ static int balance_leaf_when_delete( /*struct reiserfs_transaction_handle *th, *
/* all contents of L[0] and S[0] will be in L[0] */
leaf_shift_left(tb, n, -1);
reiserfs_invalidate_buffer(tb, tbS0,
1 /*do_free_block */ );
reiserfs_invalidate_buffer(tb, tbS0);
return 0;
}
@@ -180,7 +169,7 @@ static int balance_leaf_when_delete( /*struct reiserfs_transaction_handle *th, *
leaf_shift_left(tb, tb->lnum[0], tb->lbytes);
leaf_shift_right(tb, tb->rnum[0], tb->rbytes);
reiserfs_invalidate_buffer(tb, tbS0, 1 /*do_free_block */ );
reiserfs_invalidate_buffer(tb, tbS0);
return 0;
}
@@ -188,7 +177,7 @@ static int balance_leaf_when_delete( /*struct reiserfs_transaction_handle *th, *
if (tb->rnum[0] == -1) {
/* all contents of R[0] and S[0] will be in R[0] */
leaf_shift_right(tb, n, -1);
reiserfs_invalidate_buffer(tb, tbS0, 1 /*do_free_block */ );
reiserfs_invalidate_buffer(tb, tbS0);
return 0;
}
return 0;
@@ -966,7 +955,7 @@ static int balance_leaf( /*struct reiserfs_transaction_handle *th, */
mark_buffer_dirty(tb->CFL[0]);
}
reiserfs_invalidate_buffer(tb, tbS0, 1);
reiserfs_invalidate_buffer(tb, tbS0);
return 0;
}
@@ -1448,24 +1437,19 @@ void replace_key(reiserfs_filsys_t *fs,
}
}
void reiserfs_invalidate_buffer(struct tree_balance *tb, struct buffer_head *bh,
int do_free_block)
void reiserfs_invalidate_buffer(struct tree_balance *tb, struct buffer_head *bh)
{
struct buffer_head *to_be_forgotten;
set_blkh_level(B_BLK_HEAD(bh), FREE_LEVEL);
misc_clear_bit(BH_Dirty, &bh->b_state);
if (do_free_block) {
struct buffer_head *to_be_forgotten;
to_be_forgotten =
find_buffer(bh->b_dev, bh->b_blocknr, bh->b_size);
if (to_be_forgotten) {
to_be_forgotten->b_count++;
bforget(to_be_forgotten);
}
reiserfs_free_block(tb->tb_fs, bh->b_blocknr);
to_be_forgotten = find_buffer(bh->b_dev, bh->b_blocknr, bh->b_size);
if (to_be_forgotten) {
to_be_forgotten->b_count++;
bforget(to_be_forgotten);
}
reiserfs_free_block(tb->tb_fs, bh->b_blocknr);
}
int get_left_neighbor_position(struct tree_balance *tb, int h)
+5 -5
View File
@@ -503,7 +503,7 @@ static void balance_internal_when_delete(struct tree_balance *tb,
tb->tb_fs->fs_dirt = 1;
/* mark buffer S[h] not uptodate and put it in free list */
reiserfs_invalidate_buffer(tb, tbSh, 1);
reiserfs_invalidate_buffer(tb, tbSh);
return;
}
return;
@@ -511,14 +511,14 @@ static void balance_internal_when_delete(struct tree_balance *tb,
if (tb->L[h] && tb->lnum[h] == -B_NR_ITEMS(tb->L[h]) - 1) { /* join S[h] with L[h] */
internal_shift_left(INTERNAL_SHIFT_FROM_S_TO_L, tb, h, n + 1); /*tb->L[h], tb->CFL[h], tb->lkey[h], tb->S[h], n+1); */
reiserfs_invalidate_buffer(tb, tbSh, 1); /* preserve not needed, internal, 1 mean free block */
reiserfs_invalidate_buffer(tb, tbSh); /* preserve not needed, internal, 1 mean free block */
return;
}
if (tb->R[h] && tb->rnum[h] == -B_NR_ITEMS(tb->R[h]) - 1) { /* join S[h] with R[h] */
internal_shift_right(INTERNAL_SHIFT_FROM_S_TO_R, tb, h, n + 1);
reiserfs_invalidate_buffer(tb, tbSh, 1);
reiserfs_invalidate_buffer(tb, tbSh);
return;
}
@@ -537,7 +537,7 @@ static void balance_internal_when_delete(struct tree_balance *tb,
internal_shift_left(INTERNAL_SHIFT_FROM_S_TO_L, tb, h, tb->lnum[h]); /*tb->L[h], tb->CFL[h], tb->lkey[h], tb->S[h], tb->lnum[h]); */
internal_shift_right(INTERNAL_SHIFT_FROM_S_TO_R, tb, h,
tb->rnum[h]);
reiserfs_invalidate_buffer(tb, tbSh, 1);
reiserfs_invalidate_buffer(tb, tbSh);
return;
}
@@ -724,7 +724,7 @@ int balance_internal(struct tree_balance *tb, /* tree_balance structure
/** Fill new node that appears instead of S[h] **/
if (!tb->blknum[h]) { /* node S[h] is empty now */
/* Mark buffer as invalid and put it to head of free list. */
reiserfs_invalidate_buffer(tb, tbSh, 1); /* do not preserve, internal node */
reiserfs_invalidate_buffer(tb, tbSh); /* do not preserve, internal node */
return order;
}