diff -rup linux-2.4.7-ac1/fs/reiserfs/bitmap.c linux-2.4.7-ac1.patched/fs/reiserfs/bitmap.c --- linux-2.4.7-ac1/fs/reiserfs/bitmap.c Fri Jul 27 22:26:37 2001 +++ linux-2.4.7-ac1.patched/fs/reiserfs/bitmap.c Fri Jul 27 23:25:31 2001 @@ -304,8 +304,7 @@ static int do_reiserfs_new_blocknrs (str /* We continue the while loop if another process snatches our found * free block from us after we find it but before we successfully - * mark it as in use, or if we need to use sync to free up some - * blocks on the preserve list. */ + * mark it as in use */ while (amount_needed--) { /* skip over any blocknrs already gotten last time. */ @@ -412,19 +411,19 @@ free_and_return: return CARRY_ON; } -// this is called only by get_empty_nodes with for_preserve_list==0 +// this is called only by get_empty_nodes int reiserfs_new_blocknrs (struct reiserfs_transaction_handle *th, unsigned long * free_blocknrs, unsigned long search_start, int amount_needed) { - return do_reiserfs_new_blocknrs(th, free_blocknrs, search_start, amount_needed, 0/*for_preserve_list-priority*/, 0/*for_formatted*/, 0/*for_prealloc */) ; + return do_reiserfs_new_blocknrs(th, free_blocknrs, search_start, amount_needed, 0/*priority*/, 0/*for_formatted*/, 0/*for_prealloc */) ; } -// called by get_new_buffer and by reiserfs_get_block with amount_needed == 1 and for_preserve_list == 0 +// called by get_new_buffer and by reiserfs_get_block with amount_needed == 1 int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle *th, unsigned long * free_blocknrs, unsigned long search_start) { return do_reiserfs_new_blocknrs(th, free_blocknrs, search_start, 1/*amount_needed*/, - 0/*for_preserve_list-priority*/, + 0/*priority*/, 1/*for formatted*/, 0/*for prealloc */) ; } diff -rup linux-2.4.7-ac1/fs/reiserfs/do_balan.c linux-2.4.7-ac1.patched/fs/reiserfs/do_balan.c --- linux-2.4.7-ac1/fs/reiserfs/do_balan.c Fri Jul 27 22:47:05 2001 +++ linux-2.4.7-ac1.patched/fs/reiserfs/do_balan.c Fri Jul 27 23:27:12 2001 @@ -215,10 +215,6 @@ static int balance_leaf_when_delete (str leaf_move_items (LEAF_FROM_S_TO_L, tb, n, -1, 0); leaf_move_items (LEAF_FROM_R_TO_L, tb, B_NR_ITEMS(tb->R[0]), -1, 0); -#if 0/*preserve list*/ - preserve_invalidate(tb, tbS0, tb->L[0]); - preserve_invalidate(tb, tb->R[0], tb->L[0]); -#endif reiserfs_invalidate_buffer (tb, tbS0); reiserfs_invalidate_buffer (tb, tb->R[0]); @@ -231,11 +227,6 @@ static int balance_leaf_when_delete (str /* right_delimiting_key is correct in R[0] */ replace_key(tb, tb->CFR[0],tb->rkey[0],tb->R[0],0); -#if 0 - /* mark tb->R[0] as suspected recipient */ - preserve_invalidate(tb,tbS0, tb->R[0]); - preserve_invalidate(tb,tb->L[0], tb->R[0]); -#endif reiserfs_invalidate_buffer (tb, tbS0); reiserfs_invalidate_buffer (tb, tb->L[0]); @@ -247,9 +238,6 @@ static int balance_leaf_when_delete (str /* all contents of L[0] and S[0] will be in L[0] */ leaf_shift_left(tb, n, -1); -#if 0/*preserve list*/ - preserve_invalidate(tb, tbS0, tb->L[0]); /* preserved, shifting */ -#endif reiserfs_invalidate_buffer (tb, tbS0); return 0; @@ -272,10 +260,6 @@ static int balance_leaf_when_delete (str leaf_shift_left (tb, tb->lnum[0], tb->lbytes); leaf_shift_right(tb, tb->rnum[0], tb->rbytes); -#if 0/*preserve list*/ - preserve_invalidate (tb, tbS0, tb->L[0]); - mark_suspected_recipient (tb->tb_sb, tb->R[0]); -#endif reiserfs_invalidate_buffer (tb, tbS0); return 0; @@ -284,9 +268,6 @@ static int balance_leaf_when_delete (str if ( tb->rnum[0] == -1 ) { /* all contents of R[0] and S[0] will be in R[0] */ leaf_shift_right(tb, n, -1); -#if 0/*preserve list*/ - preserve_invalidate(tb, tbS0, tb->R[0]); -#endif reiserfs_invalidate_buffer (tb, tbS0); return 0; } @@ -310,10 +291,6 @@ static int balance_leaf (struct tree_bal ) { struct buffer_head * tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#if 0/*preserve list*/ - struct buffer_head * tbF0 = PATH_H_PPARENT (tb->tb_path, 0); - int S0_b_item_order = PATH_H_B_ITEM_ORDER (tb->tb_path, 0); -#endif int item_pos = PATH_LAST_POSITION (tb->tb_path); /* index into the array of item headers in S[0] of the affected item */ struct buffer_info bi; @@ -369,15 +346,6 @@ static int balance_leaf (struct tree_bal RFALSE( !is_direct_le_ih (ih), "PAP-12075: only direct inserted item can be broken. %h", ih); ret_val = leaf_shift_left (tb, tb->lnum[0]-1, -1); - /* when reading the if conditions preceding the subsequent preserve_shifted - lines understand that their goal is to determine if all that we are - shifting is the new data being added */ -#if 0/*preserve list*/ - if (tb->lnum[0] - 1 > 0) { - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->L[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); - } -#endif /* Calculate item length to insert to S[0] */ new_item_len = le16_to_cpu (ih->ih_item_len) - tb->lbytes; @@ -416,23 +384,12 @@ static int balance_leaf (struct tree_bal /* new item in whole falls into L[0] */ /* Shift lnum[0]-1 items to L[0] */ ret_val = leaf_shift_left(tb, tb->lnum[0]-1, tb->lbytes); -#if 0/*preserve list*/ - if (tb->lnum[0] > 1) { - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->L[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); - } -#endif /* Insert new item into L[0] */ bi.tb = tb; bi.bi_bh = tb->L[0]; bi.bi_parent = tb->FL[0]; bi.bi_position = get_left_neighbor_position (tb, 0); leaf_insert_into_buf (&bi, n + item_pos - ret_val, ih, body, zeros_num); -#if 0/*preserve list*/ - if (tb->preserve_mode == PRESERVE_INDIRECT_TO_DIRECT){ - mark_suspected_recipient (tb->tb_sb, bi.bi_bh); - } -#endif tb->insert_size[0] = 0; zeros_num = 0; } @@ -454,10 +411,6 @@ static int balance_leaf (struct tree_bal /* Shift lnum[0] - 1 items in whole. Shift lbytes - 1 entries from given directory item */ ret_val = leaf_shift_left(tb, tb->lnum[0], tb->lbytes - 1); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->L[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif if ( ret_val && ! item_pos ) { pasted = B_N_PITEM_HEAD(tb->L[0],B_NR_ITEMS(tb->L[0])-1); l_pos_in_item += I_ENTRY_COUNT(pasted) - (tb->lbytes-1); @@ -485,10 +438,6 @@ static int balance_leaf (struct tree_bal /* new directory item doesn't fall into L[0] */ /* Shift lnum[0]-1 items in whole. Shift lbytes directory entries from directory item number lnum[0] */ leaf_shift_left (tb, tb->lnum[0], tb->lbytes); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->L[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif } /* Calculate new position to append in item body */ pos_in_item -= tb->lbytes; @@ -516,10 +465,6 @@ static int balance_leaf (struct tree_bal tb->insert_size[0]); ret_val = leaf_shift_left(tb,tb->lnum[0], B_N_PITEM_HEAD(tbS0,item_pos)->ih_item_len); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->L[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif /* Append to body of item in L[0] */ bi.tb = tb; bi.bi_bh = tb->L[0]; @@ -547,10 +492,6 @@ static int balance_leaf (struct tree_bal set_le_key_k_offset (version, B_N_PDELIM_KEY(tb->CFL[0],tb->lkey[0]), le_key_k_offset (version, B_N_PDELIM_KEY(tb->CFL[0],tb->lkey[0])) + l_n); } - /* k_offset (B_N_PKEY (tbS0, 0)) += l_n; - k_offset (B_N_PDELIM_KEY(tb->CFL[0],tb->lkey[0])) += l_n; - k_offset (B_PRIGHT_DELIM_KEY(tb->L[0])) += l_n;*/ - /* Calculate new body, position in item and insert_size[0] */ if ( l_n > zeros_num ) { body += (l_n - zeros_num); @@ -581,10 +522,6 @@ static int balance_leaf (struct tree_bal /* Shift lnum[0] - 1 items in whole. Shift lbytes - 1 byte from item number lnum[0] */ leaf_shift_left(tb,tb->lnum[0],tb->lbytes); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->L[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif } } } @@ -604,10 +541,6 @@ static int balance_leaf (struct tree_bal /* Shift lnum[0] - 1 items in whole. Shift lbytes - 1 byte from item number lnum[0] */ ret_val = leaf_shift_left(tb,tb->lnum[0],tb->lbytes); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->L[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif /* Append to body of item in L[0] */ bi.tb = tb; bi.bi_bh = tb->L[0]; @@ -637,10 +570,6 @@ static int balance_leaf (struct tree_bal } else { /* new item doesn't fall into L[0] */ leaf_shift_left(tb,tb->lnum[0],tb->lbytes); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->L[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif } } /* tb->lnum[0] > 0 */ @@ -667,12 +596,6 @@ static int balance_leaf (struct tree_bal ih); leaf_shift_right(tb,tb->rnum[0]-1,-1); -#if 0/*preserve list*/ - if (tb->rnum[0]>1) { - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->R[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); - } -#endif version = le16_to_cpu (ih->ih_version); /* Remember key component and item length */ @@ -714,23 +637,12 @@ static int balance_leaf (struct tree_bal { /* Shift rnum[0]-1 items to R[0] */ ret_val = leaf_shift_right(tb,tb->rnum[0]-1,tb->rbytes); -#if 0/*preserve list*/ - if (tb->rnum[0]>1) { - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->R[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); - } -#endif /* Insert new item into R[0] */ bi.tb = tb; bi.bi_bh = tb->R[0]; bi.bi_parent = tb->FR[0]; bi.bi_position = get_right_neighbor_position (tb, 0); leaf_insert_into_buf (&bi, item_pos - n + tb->rnum[0] - 1, ih, body, zeros_num); -#if 0/*preserve list*/ - if (tb->preserve_mode == PRESERVE_INDIRECT_TO_DIRECT){ - mark_suspected_recipient (tb->tb_sb, bi.bi_bh); - } -#endif /* If we insert new item in the begin of R[0] change the right delimiting key */ if ( item_pos - n + tb->rnum[0] - 1 == 0 ) { @@ -748,10 +660,6 @@ static int balance_leaf (struct tree_bal else /* new item or part of it doesn't fall into R[0] */ { leaf_shift_right(tb,tb->rnum[0],tb->rbytes); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->R[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif } break; @@ -779,13 +687,6 @@ static int balance_leaf (struct tree_bal tb->rbytes, entry_count); /* Shift rnum[0]-1 items in whole. Shift rbytes-1 directory entries from directory item number rnum[0] */ leaf_shift_right(tb,tb->rnum[0],tb->rbytes - 1); -#if 0/*preserve list*/ - /* if we are shifting more than just the new entry */ - if (tb->rbytes > 1 || tb->rnum[0] > 1) { - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->R[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); - } -#endif /* Paste given directory entry to directory item */ paste_entry_position = pos_in_item - entry_count + tb->rbytes - 1; bi.tb = tb; @@ -815,10 +716,6 @@ static int balance_leaf (struct tree_bal else /* new directory entry doesn't fall into R[0] */ { leaf_shift_right(tb,tb->rnum[0],tb->rbytes); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->R[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif } } else /* regular object */ @@ -835,13 +732,6 @@ static int balance_leaf (struct tree_bal pos_in_item, B_N_PITEM_HEAD(tbS0,item_pos)->ih_item_len); leaf_shift_right(tb,tb->rnum[0],n_shift); -#if 0/*preserve list*/ - /* if we are shifting an old part from the appended item or more than the appended item is going into R */ - if (n_shift || tb->rnum[0] > 1) { - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->R[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); - } -#endif /* Calculate number of bytes which must remain in body after appending to R[0] */ if ( (n_rem = tb->insert_size[0] - tb->rbytes) < 0 ) n_rem = 0; @@ -899,10 +789,6 @@ static int balance_leaf (struct tree_bal struct item_head * pasted; ret_val = leaf_shift_right(tb,tb->rnum[0],tb->rbytes); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->R[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif /* append item in R[0] */ if ( pos_in_item >= 0 ) { bi.tb = tb; @@ -927,10 +813,6 @@ static int balance_leaf (struct tree_bal /* update delimiting keys */ replace_key(tb, tb->CFR[0],tb->rkey[0],tb->R[0],0); -#if 0 - copy_key(B_PRIGHT_DELIM_KEY(tbS0),B_N_PKEY(tb->R[0], 0)); - reiserfs_mark_buffer_dirty (tbS0, 0); -#endif } } @@ -942,10 +824,6 @@ static int balance_leaf (struct tree_bal else /* new item doesn't fall into R[0] */ { leaf_shift_right(tb,tb->rnum[0],tb->rbytes); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, tb->R[0]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif } break; default: /* cases d and t */ @@ -1024,12 +902,6 @@ static int balance_leaf (struct tree_bal /* Move snum[i]-1 items from S[0] to S_new[i] */ leaf_move_items (LEAF_FROM_S_TO_SNEW, tb, snum[i] - 1, -1, S_new[i]); -#if 0/*preserve list*/ - if (snum[i] > 1 ) { - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, S_new[i]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); - } -#endif /* Remember key component and item length */ version = ih_version (ih); old_key_comp = le_key_k_offset (version, &(ih->ih_key)); @@ -1075,11 +947,6 @@ static int balance_leaf (struct tree_bal bi.bi_parent = 0; bi.bi_position = 0; leaf_insert_into_buf (&bi, item_pos - n + snum[i] - 1, ih, body, zeros_num); -#if 0/*preserve list*/ - if (tb->preserve_mode == PRESERVE_INDIRECT_TO_DIRECT){ - mark_suspected_recipient (tb->tb_sb, bi.bi_bh); - } -#endif zeros_num = tb->insert_size[0] = 0; } @@ -1088,10 +955,6 @@ static int balance_leaf (struct tree_bal else /* new item or it part don't falls into S_new[i] */ { leaf_move_items (LEAF_FROM_S_TO_SNEW, tb, snum[i], sbytes[i], S_new[i]); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, S_new[i]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif } break; @@ -1123,14 +986,6 @@ static int balance_leaf (struct tree_bal /* Shift snum[i]-1 items in whole. Shift sbytes[i] directory entries from directory item number snum[i] */ leaf_move_items (LEAF_FROM_S_TO_SNEW, tb, snum[i], sbytes[i]-1, S_new[i]); -#if 0/*preserve list*/ - /* if more than the affected item is shifted, or if more than - one entry (from the affected item) is shifted */ - if (snum[i] > 1 || sbytes[i] > 1) { - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, S_new[i]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); - } -#endif /* Paste given directory entry to directory item */ bi.tb = tb; bi.bi_bh = S_new[i]; @@ -1219,11 +1074,6 @@ static int balance_leaf (struct tree_bal #endif /* CONFIG_REISERFS_CHECK */ ret_val = leaf_move_items (LEAF_FROM_S_TO_SNEW, tb, snum[i], sbytes[i], S_new[i]); -#if 0/*preserve list*/ - /* we must preserve that which we are pasting onto the end of and shifting */ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, S_new[i]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif RFALSE( ret_val, "PAP-12240: unexpected value returned by leaf_move_items (%d)", @@ -1255,10 +1105,6 @@ static int balance_leaf (struct tree_bal else /* pasted item doesn't fall into S_new[i] */ { leaf_move_items (LEAF_FROM_S_TO_SNEW, tb, snum[i], sbytes[i], S_new[i]); -#if 0/*preserve list*/ - preserve_shifted(tb, &(PATH_PLAST_BUFFER (tb->tb_path)), tbF0, S0_b_item_order, S_new[i]); - tbS0 = PATH_PLAST_BUFFER (tb->tb_path); -#endif } break; default: /* cases d and t */ @@ -1297,11 +1143,6 @@ static int balance_leaf (struct tree_bal bi.bi_parent = PATH_H_PPARENT (tb->tb_path, 0); bi.bi_position = PATH_H_POSITION (tb->tb_path, 1); leaf_insert_into_buf (&bi, item_pos, ih, body, zeros_num); -#if 0/*preserve list*/ - if (tb->preserve_mode == PRESERVE_INDIRECT_TO_DIRECT){ - mark_suspected_recipient (tb->tb_sb, bi.bi_bh); - } -#endif /* If we insert the first key change the delimiting key */ if( item_pos == 0 ) { Only in linux-2.4.7-ac1.patched/fs/reiserfs: do_balan.c~ diff -rup linux-2.4.7-ac1/fs/reiserfs/prints.c linux-2.4.7-ac1.patched/fs/reiserfs/prints.c --- linux-2.4.7-ac1/fs/reiserfs/prints.c Fri Jul 27 23:04:17 2001 +++ linux-2.4.7-ac1.patched/fs/reiserfs/prints.c Fri Jul 27 23:25:31 2001 @@ -294,7 +294,7 @@ void reiserfs_debug (struct super_block panics in reiserfs_fs.h have numbers from 1000 to 1999 super.c 2000 to 2999 - preserve.c 3000 to 3999 + preserve.c (unused) 3000 to 3999 bitmap.c 4000 to 4999 stree.c 5000 to 5999 prints.c 6000 to 6999 @@ -699,9 +699,9 @@ void print_statistics (struct super_bloc { /* - printk ("reiserfs_put_super: session statistics: balances %d, fix_nodes %d, preserve list freeings %d, \ + printk ("reiserfs_put_super: session statistics: balances %d, fix_nodes %d, \ bmap with search %d, without %d, dir2ind %d, ind2dir %d\n", - s->u.reiserfs_sb.s_do_balance, s->u.reiserfs_sb.s_fix_nodes, s->u.reiserfs_sb.s_preserve_list_freeings, + s->u.reiserfs_sb.s_do_balance, s->u.reiserfs_sb.s_fix_nodes, s->u.reiserfs_sb.s_bmaps, s->u.reiserfs_sb.s_bmaps_without_search, s->u.reiserfs_sb.s_direct2indirect, s->u.reiserfs_sb.s_indirect2direct); */ diff -rup linux-2.4.7-ac1/fs/reiserfs/super.c linux-2.4.7-ac1.patched/fs/reiserfs/super.c --- linux-2.4.7-ac1/fs/reiserfs/super.c Fri Jul 27 22:47:05 2001 +++ linux-2.4.7-ac1.patched/fs/reiserfs/super.c Fri Jul 27 23:25:31 2001 @@ -83,9 +83,6 @@ void reiserfs_unlockfs(struct super_bloc // at the ext2 code and comparing. It's subfunctions contain no code // used as a template unless they are so labeled. // -/* there should be no suspected recipients already. True and cautious - bitmaps should not differ. We only have to free preserve list and - write both bitmaps */ void reiserfs_put_super (struct super_block * s) { int i; .