hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/fs/reiserfs/do_balan.c
....@@ -239,10 +239,8 @@
239239 static int balance_leaf_when_delete(struct tree_balance *tb, int flag)
240240 {
241241 struct buffer_head *tbS0 = PATH_PLAST_BUFFER(tb->tb_path);
242
- int item_pos = PATH_LAST_POSITION(tb->tb_path);
243242 struct buffer_info bi;
244243 int n;
245
- struct item_head *ih;
246244
247245 RFALSE(tb->FR[0] && B_LEVEL(tb->FR[0]) != DISK_LEAF_NODE_LEVEL + 1,
248246 "vs- 12000: level: wrong FR %z", tb->FR[0]);
....@@ -251,7 +249,6 @@
251249 RFALSE(!tb->blknum[0] && !PATH_H_PPARENT(tb->tb_path, 0),
252250 "PAP-12010: tree can not be empty");
253251
254
- ih = item_head(tbS0, item_pos);
255252 buffer_info_init_tbS0(tb, &bi);
256253
257254 /* Delete or truncate the item */
....@@ -298,7 +295,6 @@
298295 if (tb->item_pos == tb->lnum[0] - 1 && tb->lbytes != -1) {
299296 /* part of new item falls into L[0] */
300297 int new_item_len, shift;
301
- int version;
302298
303299 ret = leaf_shift_left(tb, tb->lnum[0] - 1, -1);
304300
....@@ -316,8 +312,6 @@
316312 buffer_info_init_left(tb, &bi);
317313 leaf_insert_into_buf(&bi, n + tb->item_pos - ret, ih, body,
318314 min_t(int, tb->zeroes_num, ih_item_len(ih)));
319
-
320
- version = ih_version(ih);
321315
322316 /*
323317 * Calculate key component, item length and body to
....@@ -632,7 +626,6 @@
632626 struct buffer_head *tbS0 = PATH_PLAST_BUFFER(tb->tb_path);
633627 int n = B_NR_ITEMS(tbS0);
634628 struct buffer_info bi;
635
- int ret;
636629
637630 /* new item or part of it doesn't fall into R[0] */
638631 if (n - tb->rnum[0] >= tb->item_pos) {
....@@ -646,12 +639,10 @@
646639 if (tb->item_pos == n - tb->rnum[0] + 1 && tb->rbytes != -1) {
647640 loff_t old_key_comp, old_len, r_zeroes_number;
648641 const char *r_body;
649
- int version, shift;
642
+ int shift;
650643 loff_t offset;
651644
652645 leaf_shift_right(tb, tb->rnum[0] - 1, -1);
653
-
654
- version = ih_version(ih);
655646
656647 /* Remember key component and item length */
657648 old_key_comp = le_ih_k_offset(ih);
....@@ -698,7 +689,7 @@
698689 /* whole new item falls into R[0] */
699690
700691 /* Shift rnum[0]-1 items to R[0] */
701
- ret = leaf_shift_right(tb, tb->rnum[0] - 1, tb->rbytes);
692
+ leaf_shift_right(tb, tb->rnum[0] - 1, tb->rbytes);
702693
703694 /* Insert new item into R[0] */
704695 buffer_info_init_right(tb, &bi);
....@@ -851,7 +842,7 @@
851842 struct item_head *pasted;
852843 struct buffer_info bi;
853844
854
- buffer_info_init_right(tb, &bi);
845
+ buffer_info_init_right(tb, &bi);
855846 leaf_shift_right(tb, tb->rnum[0], tb->rbytes);
856847
857848 /* append item in R[0] */
....@@ -950,14 +941,12 @@
950941 if (tb->item_pos == n - tb->snum[i] + 1 && tb->sbytes[i] != -1) {
951942 int old_key_comp, old_len, r_zeroes_number;
952943 const char *r_body;
953
- int version;
954944
955945 /* Move snum[i]-1 items from S[0] to S_new[i] */
956946 leaf_move_items(LEAF_FROM_S_TO_SNEW, tb, tb->snum[i] - 1, -1,
957947 tb->S_new[i]);
958948
959949 /* Remember key component and item length */
960
- version = ih_version(ih);
961950 old_key_comp = le_ih_k_offset(ih);
962951 old_len = ih_item_len(ih);
963952