reiserfs: use buffer_info for leaf_paste_entries
This patch makes leaf_paste_entries more consistent with respect to the other leaf operations. Using buffer_info instead of buffer_head directly allows us to get a superblock pointer for use in error handling. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
600ed41675
commit
eba0030559
|
@ -449,8 +449,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
|
||||||
/* when we have merge directory item, pos_in_item has been changed too */
|
/* when we have merge directory item, pos_in_item has been changed too */
|
||||||
|
|
||||||
/* paste new directory entry. 1 is entry number */
|
/* paste new directory entry. 1 is entry number */
|
||||||
leaf_paste_entries(bi.
|
leaf_paste_entries(&bi,
|
||||||
bi_bh,
|
|
||||||
n +
|
n +
|
||||||
item_pos
|
item_pos
|
||||||
-
|
-
|
||||||
|
@ -699,7 +698,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
|
||||||
n + item_pos -
|
n + item_pos -
|
||||||
ret_val);
|
ret_val);
|
||||||
if (is_direntry_le_ih(pasted))
|
if (is_direntry_le_ih(pasted))
|
||||||
leaf_paste_entries(bi.bi_bh,
|
leaf_paste_entries(&bi,
|
||||||
n +
|
n +
|
||||||
item_pos -
|
item_pos -
|
||||||
ret_val,
|
ret_val,
|
||||||
|
@ -894,8 +893,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
|
||||||
tb->insert_size[0],
|
tb->insert_size[0],
|
||||||
body, zeros_num);
|
body, zeros_num);
|
||||||
/* paste entry */
|
/* paste entry */
|
||||||
leaf_paste_entries(bi.
|
leaf_paste_entries(&bi,
|
||||||
bi_bh,
|
|
||||||
0,
|
0,
|
||||||
paste_entry_position,
|
paste_entry_position,
|
||||||
1,
|
1,
|
||||||
|
@ -1096,7 +1094,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
|
||||||
tb->rnum[0]);
|
tb->rnum[0]);
|
||||||
if (is_direntry_le_ih(pasted)
|
if (is_direntry_le_ih(pasted)
|
||||||
&& pos_in_item >= 0) {
|
&& pos_in_item >= 0) {
|
||||||
leaf_paste_entries(bi.bi_bh,
|
leaf_paste_entries(&bi,
|
||||||
item_pos -
|
item_pos -
|
||||||
n +
|
n +
|
||||||
tb->rnum[0],
|
tb->rnum[0],
|
||||||
|
@ -1339,8 +1337,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
|
||||||
tb->insert_size[0],
|
tb->insert_size[0],
|
||||||
body, zeros_num);
|
body, zeros_num);
|
||||||
/* paste new directory entry */
|
/* paste new directory entry */
|
||||||
leaf_paste_entries(bi.
|
leaf_paste_entries(&bi,
|
||||||
bi_bh,
|
|
||||||
0,
|
0,
|
||||||
pos_in_item
|
pos_in_item
|
||||||
-
|
-
|
||||||
|
@ -1505,7 +1502,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
|
||||||
item_pos - n +
|
item_pos - n +
|
||||||
snum[i]);
|
snum[i]);
|
||||||
if (is_direntry_le_ih(pasted)) {
|
if (is_direntry_le_ih(pasted)) {
|
||||||
leaf_paste_entries(bi.bi_bh,
|
leaf_paste_entries(&bi,
|
||||||
item_pos -
|
item_pos -
|
||||||
n + snum[i],
|
n + snum[i],
|
||||||
pos_in_item,
|
pos_in_item,
|
||||||
|
@ -1606,7 +1603,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
|
||||||
zeros_num);
|
zeros_num);
|
||||||
|
|
||||||
/* paste entry */
|
/* paste entry */
|
||||||
leaf_paste_entries(bi.bi_bh,
|
leaf_paste_entries(&bi,
|
||||||
item_pos,
|
item_pos,
|
||||||
pos_in_item,
|
pos_in_item,
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -111,7 +111,7 @@ static void leaf_copy_dir_entries(struct buffer_info *dest_bi,
|
||||||
item_num_in_dest =
|
item_num_in_dest =
|
||||||
(last_first == FIRST_TO_LAST) ? (B_NR_ITEMS(dest) - 1) : 0;
|
(last_first == FIRST_TO_LAST) ? (B_NR_ITEMS(dest) - 1) : 0;
|
||||||
|
|
||||||
leaf_paste_entries(dest_bi->bi_bh, item_num_in_dest,
|
leaf_paste_entries(dest_bi, item_num_in_dest,
|
||||||
(last_first ==
|
(last_first ==
|
||||||
FIRST_TO_LAST) ? I_ENTRY_COUNT(B_N_PITEM_HEAD(dest,
|
FIRST_TO_LAST) ? I_ENTRY_COUNT(B_N_PITEM_HEAD(dest,
|
||||||
item_num_in_dest))
|
item_num_in_dest))
|
||||||
|
@ -1191,7 +1191,7 @@ static void leaf_delete_items_entirely(struct buffer_info *bi,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* paste new_entry_count entries (new_dehs, records) into position before to item_num-th item */
|
/* paste new_entry_count entries (new_dehs, records) into position before to item_num-th item */
|
||||||
void leaf_paste_entries(struct buffer_head *bh,
|
void leaf_paste_entries(struct buffer_info *bi,
|
||||||
int item_num,
|
int item_num,
|
||||||
int before,
|
int before,
|
||||||
int new_entry_count,
|
int new_entry_count,
|
||||||
|
@ -1203,6 +1203,7 @@ void leaf_paste_entries(struct buffer_head *bh,
|
||||||
struct reiserfs_de_head *deh;
|
struct reiserfs_de_head *deh;
|
||||||
char *insert_point;
|
char *insert_point;
|
||||||
int i, old_entry_num;
|
int i, old_entry_num;
|
||||||
|
struct buffer_head *bh = bi->bi_bh;
|
||||||
|
|
||||||
if (new_entry_count == 0)
|
if (new_entry_count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2026,7 +2026,7 @@ void leaf_paste_in_buffer(struct buffer_info *bi, int pasted_item_num,
|
||||||
int zeros_number);
|
int zeros_number);
|
||||||
void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num,
|
void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num,
|
||||||
int pos_in_item, int cut_size);
|
int pos_in_item, int cut_size);
|
||||||
void leaf_paste_entries(struct buffer_head *bh, int item_num, int before,
|
void leaf_paste_entries(struct buffer_info *bi, int item_num, int before,
|
||||||
int new_entry_count, struct reiserfs_de_head *new_dehs,
|
int new_entry_count, struct reiserfs_de_head *new_dehs,
|
||||||
const char *records, int paste_size);
|
const char *records, int paste_size);
|
||||||
/* ibalance.c */
|
/* ibalance.c */
|
||||||
|
|
Loading…
Reference in a new issue