aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-03-30 14:02:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 15:16:35 -0400
commiteba00305591714f1d85ccad1afbf58259c2197b4 (patch)
tree260912758e76c1add9e917d22a00544812562a75 /fs/reiserfs
parent600ed41675d8c384519d8f0b3c76afed39ef2f4b (diff)
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>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/do_balan.c17
-rw-r--r--fs/reiserfs/lbalance.c5
2 files changed, 10 insertions, 12 deletions
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index 2f87f5b14630..99f80538c4bf 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -449,8 +449,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
449 /* when we have merge directory item, pos_in_item has been changed too */ 449 /* when we have merge directory item, pos_in_item has been changed too */
450 450
451 /* paste new directory entry. 1 is entry number */ 451 /* paste new directory entry. 1 is entry number */
452 leaf_paste_entries(bi. 452 leaf_paste_entries(&bi,
453 bi_bh,
454 n + 453 n +
455 item_pos 454 item_pos
456 - 455 -
@@ -699,7 +698,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
699 n + item_pos - 698 n + item_pos -
700 ret_val); 699 ret_val);
701 if (is_direntry_le_ih(pasted)) 700 if (is_direntry_le_ih(pasted))
702 leaf_paste_entries(bi.bi_bh, 701 leaf_paste_entries(&bi,
703 n + 702 n +
704 item_pos - 703 item_pos -
705 ret_val, 704 ret_val,
@@ -894,8 +893,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
894 tb->insert_size[0], 893 tb->insert_size[0],
895 body, zeros_num); 894 body, zeros_num);
896 /* paste entry */ 895 /* paste entry */
897 leaf_paste_entries(bi. 896 leaf_paste_entries(&bi,
898 bi_bh,
899 0, 897 0,
900 paste_entry_position, 898 paste_entry_position,
901 1, 899 1,
@@ -1096,7 +1094,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
1096 tb->rnum[0]); 1094 tb->rnum[0]);
1097 if (is_direntry_le_ih(pasted) 1095 if (is_direntry_le_ih(pasted)
1098 && pos_in_item >= 0) { 1096 && pos_in_item >= 0) {
1099 leaf_paste_entries(bi.bi_bh, 1097 leaf_paste_entries(&bi,
1100 item_pos - 1098 item_pos -
1101 n + 1099 n +
1102 tb->rnum[0], 1100 tb->rnum[0],
@@ -1339,8 +1337,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
1339 tb->insert_size[0], 1337 tb->insert_size[0],
1340 body, zeros_num); 1338 body, zeros_num);
1341 /* paste new directory entry */ 1339 /* paste new directory entry */
1342 leaf_paste_entries(bi. 1340 leaf_paste_entries(&bi,
1343 bi_bh,
1344 0, 1341 0,
1345 pos_in_item 1342 pos_in_item
1346 - 1343 -
@@ -1505,7 +1502,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
1505 item_pos - n + 1502 item_pos - n +
1506 snum[i]); 1503 snum[i]);
1507 if (is_direntry_le_ih(pasted)) { 1504 if (is_direntry_le_ih(pasted)) {
1508 leaf_paste_entries(bi.bi_bh, 1505 leaf_paste_entries(&bi,
1509 item_pos - 1506 item_pos -
1510 n + snum[i], 1507 n + snum[i],
1511 pos_in_item, 1508 pos_in_item,
@@ -1606,7 +1603,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
1606 zeros_num); 1603 zeros_num);
1607 1604
1608 /* paste entry */ 1605 /* paste entry */
1609 leaf_paste_entries(bi.bi_bh, 1606 leaf_paste_entries(&bi,
1610 item_pos, 1607 item_pos,
1611 pos_in_item, 1608 pos_in_item,
1612 1, 1609 1,
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index 6de060a6aa7f..41bdd8c75887 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -111,7 +111,7 @@ static void leaf_copy_dir_entries(struct buffer_info *dest_bi,
111 item_num_in_dest = 111 item_num_in_dest =
112 (last_first == FIRST_TO_LAST) ? (B_NR_ITEMS(dest) - 1) : 0; 112 (last_first == FIRST_TO_LAST) ? (B_NR_ITEMS(dest) - 1) : 0;
113 113
114 leaf_paste_entries(dest_bi->bi_bh, item_num_in_dest, 114 leaf_paste_entries(dest_bi, item_num_in_dest,
115 (last_first == 115 (last_first ==
116 FIRST_TO_LAST) ? I_ENTRY_COUNT(B_N_PITEM_HEAD(dest, 116 FIRST_TO_LAST) ? I_ENTRY_COUNT(B_N_PITEM_HEAD(dest,
117 item_num_in_dest)) 117 item_num_in_dest))
@@ -1191,7 +1191,7 @@ static void leaf_delete_items_entirely(struct buffer_info *bi,
1191} 1191}
1192 1192
1193/* paste new_entry_count entries (new_dehs, records) into position before to item_num-th item */ 1193/* paste new_entry_count entries (new_dehs, records) into position before to item_num-th item */
1194void leaf_paste_entries(struct buffer_head *bh, 1194void leaf_paste_entries(struct buffer_info *bi,
1195 int item_num, 1195 int item_num,
1196 int before, 1196 int before,
1197 int new_entry_count, 1197 int new_entry_count,
@@ -1203,6 +1203,7 @@ void leaf_paste_entries(struct buffer_head *bh,
1203 struct reiserfs_de_head *deh; 1203 struct reiserfs_de_head *deh;
1204 char *insert_point; 1204 char *insert_point;
1205 int i, old_entry_num; 1205 int i, old_entry_num;
1206 struct buffer_head *bh = bi->bi_bh;
1206 1207
1207 if (new_entry_count == 0) 1208 if (new_entry_count == 0)
1208 return; 1209 return;