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 23:32:05 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/do_balan.c      Fri Jul 27 23:39:58 2001
@@ -108,17 +108,6 @@ static int balance_leaf_when_delete (str
                "vs-12013: mode Delete, insert size %d, ih to be deleted %h",
                -tb->insert_size [0], ih);

-#if 0 /* rigth delim key not supported */
-       if ( ! item_pos && (! tb->L[0] || COMP_KEYS(B_PRIGHT_DELIM_KEY(tb->L[0]), B_N_PKEY(tbS0, 0))) ) {
-           print_cur_tb ("12015");
-           reiserfs_panic (tb->tb_sb, "PAP-12015: balance_leaf_when_delete: L0's rkey does not match to 1st key of S0: "
-                           "rkey in L %k, first key in S0 %k, rkey in CFL %k",
-                           tb->L[0] ? B_PRIGHT_DELIM_KEY(tb->L[0]) : 0,
-                           B_N_PKEY(tbS0, 0),
-                           tb->CFL[0] ? B_N_PDELIM_KEY(tb->CFL[0],tb->lkey[0]) : 0);
-       }
-#endif
-
       bi.tb = tb;
       bi.bi_bh = tbS0;
       bi.bi_parent = PATH_H_PPARENT (tb->tb_path, 0);
@@ -128,18 +117,10 @@ static int balance_leaf_when_delete (str
       if ( ! item_pos && tb->CFL[0] ) {
           if ( B_NR_ITEMS(tbS0) ) {
               replace_key(tb, tb->CFL[0],tb->lkey[0],tbS0,0);
-#if 0 /* right delim key support */
-               copy_key(B_PRIGHT_DELIM_KEY(tb->L[0]), B_N_PKEY(tbS0, 0));
-               reiserfs_mark_buffer_dirty (tb->L[0], 0);
-#endif
           }
           else {
               if ( ! PATH_H_POSITION (tb->tb_path, 1) )
                   replace_key(tb, tb->CFL[0],tb->lkey[0],PATH_H_PPARENT(tb->tb_path, 0),0);
-#if 0 /* right delim key support */
-               copy_key(B_PRIGHT_DELIM_KEY(tb->L[0]), B_PRIGHT_DELIM_KEY(tbS0));
-               reiserfs_mark_buffer_dirty (tb->L[0], 0);
-#endif
           }
       }

@@ -155,14 +136,6 @@ static int balance_leaf_when_delete (str
       bi.bi_position = PATH_H_POSITION (tb->tb_path, 1);
       if (is_direntry_le_ih (ih)) {

-#ifdef CONFIG_REISERFS_CHECK
-#if 0 /* right delim key support */
-           if ( ! item_pos && ! pos_in_item && (! tb->L[0] || COMP_KEYS(B_PRIGHT_DELIM_KEY(tb->L[0]),
-                                                                        B_N_PKEY(tbS0, 0))) )
-               reiserfs_panic(tb->tb_sb, "PAP-12025: balance_leaf_when_delete: illegal right delimiting key");
-#endif
-#endif
-
           /* UFS unlink semantics are such that you can only delete one directory entry at a time. */
           /* when we cut a directory tb->insert_size[0] means number of entries to be cut (always 1) */
           tb->insert_size[0] = -1;
@@ -174,10 +147,6 @@ static int balance_leaf_when_delete (str

           if ( ! item_pos && ! pos_in_item && tb->CFL[0] ) {
               replace_key(tb, tb->CFL[0],tb->lkey[0],tbS0,0);
-#if 0/* right delim key support */
-               copy_key(B_PRIGHT_DELIM_KEY(tb->L[0]), B_N_PKEY(tbS0, 0));
-               reiserfs_mark_buffer_dirty (tb->L[0], 0);
-#endif
           }
       } else {
           leaf_cut_from_buffer (&bi, item_pos, pos_in_item, -tb->insert_size[0]);
@@ -208,10 +177,6 @@ static int balance_leaf_when_delete (str
                   if ( PATH_H_POSITION (tb->tb_path, 1) == 0 && 1 < B_NR_ITEMS(tb->FR[0]) )
                       replace_key(tb, tb->CFL[0],tb->lkey[0],tb->FR[0],1);

-                   /* update right_delimiting_key field */
-#if 0
-                   copy_key (B_PRIGHT_DELIM_KEY (tb->L[0]), B_PRIGHT_DELIM_KEY (tb->R[0]));
-#endif
                   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);

@@ -644,15 +609,9 @@ static int balance_leaf (struct tree_bal
                   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 we insert new item in the begin of R[0] change the right delimiting key */
                   if ( item_pos - n + tb->rnum[0] - 1 == 0 ) {
                       replace_key(tb, tb->CFR[0],tb->rkey[0],tb->R[0],0);

-#if 0
-                       /* update right delimiting key */
-                       copy_key(B_PRIGHT_DELIM_KEY(tbS0), &(ih->ih_key));
-                       reiserfs_mark_buffer_dirty (tbS0, 0);
-#endif
                   }
                   zeros_num = tb->insert_size[0] = 0;
               }
@@ -704,10 +663,6 @@ static int balance_leaf (struct tree_bal
                           if ( paste_entry_position == 0 ) {
                               /* change 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
                           }

                           tb->insert_size[0] = 0;
@@ -749,11 +704,6 @@ static int balance_leaf (struct tree_bal
                 k_offset (B_N_PDELIM_KEY(tb->CFR[0],tb->rkey[0])) += n_rem;*/
                       do_balance_mark_internal_dirty (tb, tb->CFR[0], 0);

-#if 0
-                       set_le_key_k_offset (B_PRIGHT_DELIM_KEY(tbS0), le_key_k_offset (B_PRIGHT_DELIM_KEY(tbS0)) + n_rem);
-/*               k_offset (B_PRIGHT_DELIM_KEY(tbS0)) += n_rem;*/
-                       reiserfs_mark_buffer_dirty (tbS0, 0);
-#endif
                       /* Append part of body into R[0] */
                       bi.tb = tb;
                       bi.bi_bh = tb->R[0];
@@ -1121,12 +1071,6 @@ static int balance_leaf (struct tree_bal
                  buffer_journal_dirty(S_new[i]))),
               "PAP-12247: S_new[%d] : (%b)\n", i, S_new[i]);

-#if 0
-       /* update right_delimiting_key fields */
-       copy_key (B_PRIGHT_DELIM_KEY (S_new[i]), B_PRIGHT_DELIM_KEY (tbS0));
-       copy_key (B_PRIGHT_DELIM_KEY (tbS0), B_N_PKEY (S_new[i], 0));
-       reiserfs_mark_buffer_dirty (tbS0, 0);
-#endif

    }

@@ -1149,18 +1093,6 @@ static int balance_leaf (struct tree_bal
               if (tb->CFL[0]) /* can be 0 in reiserfsck */
                   replace_key(tb, tb->CFL[0], tb->lkey[0],tbS0,0);

-#if 0 /* right delim key support */
-#ifdef CONFIG_REISERFS_CHECK
-               if ( ! tb->CFL[0] || ! tb->L[0] || (B_NR_ITEMS (tbS0) > 1 &&
-                                                   COMP_KEYS(B_PRIGHT_DELIM_KEY(tb->L[0]), B_N_PKEY(tbS0, 1))) )
-                   reiserfs_panic(tb->tb_sb, "PAP-12250: balance_leaf: invalid right delimiting key");
-               if (!buffer_dirty (tb->L[0]) && !(buffer_journaled(tb->L[0]) ||
-                    buffer_journal_dirty(tb->L[0])))
-                   reiserfs_panic (tb->tb_sb, "PAP-12255: balance_leaf: tb->L[0] must be dirty");
-#endif
-               if (tb->L[0]) /* can be 0 in reiserfsck */
-                   copy_key (B_PRIGHT_DELIM_KEY (tb->L[0]), &(ih->ih_key));
-#endif /* right delim key support */
           }
           break;

@@ -1182,15 +1114,6 @@ static int balance_leaf (struct tree_bal
                   bi.bi_position = PATH_H_POSITION (tb->tb_path, 1);
                   leaf_paste_in_buffer(&bi, item_pos, pos_in_item, tb->insert_size[0], body, zeros_num);

-
-#ifdef CONFIG_REISERFS_CHECK
-#if 0
-                   if ( ! item_pos && ! pos_in_item  && (! tb->L[0] || COMP_KEYS(B_PRIGHT_DELIM_KEY(tb->L[0]),
-                                                                                 B_N_PKEY(tbS0, 0))) )
-                       reiserfs_panic(tb->tb_sb, "PAP-12265: balance_leaf: invalid right delimiting key");
-#endif
-#endif
-
                   /* paste entry */
                   leaf_paste_entries (
                       bi.bi_bh, item_pos, pos_in_item, 1, (struct reiserfs_de_head *)body,
@@ -1202,12 +1125,6 @@ static int balance_leaf (struct tree_bal
                       if (tb->CFL[0]) {
                           replace_key(tb, tb->CFL[0], tb->lkey[0],tbS0,0);

-#if 0
-                           /* update right delimiting key */
-                           copy_key (B_PRIGHT_DELIM_KEY (tb->L[0]), B_N_PKEY(tbS0, 0));
-                           /* probably not needed as something has been shifted to tb->L[0] already */
-                           reiserfs_mark_buffer_dirty (tb->L[0], 0);
-#endif
                       }
                   }
                   tb->insert_size[0] = 0;
diff -rup linux-2.4.7-ac1/fs/reiserfs/fix_node.c linux-2.4.7-ac1.patched/fs/reiserfs/fix_node.c
--- linux-2.4.7-ac1/fs/reiserfs/fix_node.c      Fri Jul 27 22:26:37 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/fix_node.c      Fri Jul 27 23:41:02 2001
@@ -1134,15 +1134,6 @@ static int  get_parents (struct tree_bal
    decrement_bcount(p_s_tb->CFR[n_h]);
    p_s_tb->CFR[n_h] = p_s_curcf; /* New initialization of CFR[n_path_offset]. */

-#ifdef CONFIG_REISERFS_CHECK
-#if 0
-    if (n_h == 0 && p_s_tb->CFR[n_h] && COMP_KEYS (B_PRIGHT_DELIM_KEY (PATH_H_PBUFFER(p_s_path, n_h)),
-                                                  B_N_PDELIM_KEY (p_s_tb->CFR[n_h], p_s_tb->rkey[n_h]))) {
-       reiserfs_panic (p_s_tb->tb_sb, "PAP-8200: get_parents: rdkey in S0 %k, rdkey in CFR0 %k do not match",
-                       B_PRIGHT_DELIM_KEY (PATH_H_PBUFFER(p_s_path, n_h)), B_N_PDELIM_KEY (p_s_tb->CFR[n_h], p_s_tb->rkey[n_h]));
-    }
-#endif
-#endif
    RFALSE( (p_s_curf && !B_IS_IN_TREE (p_s_curf)) ||
           (p_s_curcf && !B_IS_IN_TREE (p_s_curcf)),
           "PAP-8205: FR (%b) or CFR (%b) is invalid", p_s_curf, p_s_curcf);
diff -rup linux-2.4.7-ac1/fs/reiserfs/lbalance.c linux-2.4.7-ac1.patched/fs/reiserfs/lbalance.c
--- linux-2.4.7-ac1/fs/reiserfs/lbalance.c      Fri Jul 27 22:47:05 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/lbalance.c      Fri Jul 27 23:42:16 2001
@@ -603,18 +603,10 @@ int leaf_shift_left (struct tree_balance
      if (PATH_H_POSITION (tb->tb_path, 1) == 0)
       replace_key (tb, tb->CFL[0], tb->lkey[0], PATH_H_PPARENT (tb->tb_path, 0), 0);

-#if 0
-      /* change right_delimiting_key field in L0's block header */
-      copy_key (B_PRIGHT_DELIM_KEY(tb->L[0]), B_PRIGHT_DELIM_KEY (S0));
-#endif
    } else {
      /* replace lkey in CFL[0] by 0-th key from S[0]; */
      replace_key (tb, tb->CFL[0], tb->lkey[0], S0, 0);

-#if 0
-      /* change right_delimiting_key field in L0's block header */
-      copy_key (B_PRIGHT_DELIM_KEY(tb->L[0]), B_N_PKEY (S0, 0));
-#endif
      RFALSE( (shift_bytes != -1 &&
              !(is_direntry_le_ih (B_N_PITEM_HEAD (S0, 0))
                && !I_ENTRY_COUNT (B_N_PITEM_HEAD (S0, 0)))) &&
@@ -652,10 +644,6 @@ int        leaf_shift_right(
  if (shift_num) {
    replace_key (tb, tb->CFR[0], tb->rkey[0], tb->R[0], 0);

-#if 0
-    /* change right_delimiting_key field in S0's block header */
-    copy_key (B_PRIGHT_DELIM_KEY(S0), B_N_PKEY (tb->R[0], 0));
-#endif
  }

  return ret_value;
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:32:05 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/prints.c        Fri Jul 27 23:34:22 2001
@@ -123,10 +123,6 @@ static void sprintf_block_head (char * b
{
  sprintf (buf, "level=%d, nr_items=%d, free_space=%d rdkey ",
          B_LEVEL (bh), B_NR_ITEMS (bh), B_FREE_SPACE (bh));
-#if 0
-  if (B_LEVEL (bh) == DISK_LEAF_NODE_LEVEL)
-    sprintf_le_key (buf + strlen (buf), B_PRIGHT_DELIM_KEY (bh));
-#endif
}


diff -rup linux-2.4.7-ac1/include/linux/reiserfs_fs.h linux-2.4.7-ac1.patched/include/linux/reiserfs_fs.h
--- linux-2.4.7-ac1/include/linux/reiserfs_fs.h Fri Jul 27 23:24:55 2001
+++ linux-2.4.7-ac1.patched/include/linux/reiserfs_fs.h Fri Jul 27 23:34:22 2001
@@ -638,9 +638,6 @@ struct block_head {
#define PUT_B_LEVEL(bh, val)           do { B_BLK_HEAD(bh)->blk_level = cpu_to_le16(val); } while (0)
#define PUT_B_FREE_SPACE(bh)           do { B_BLK_HEAD(bh)->blk_free_space = cpu_to_le16(val); } while (0)

-/* Get right delimiting key. */
-#define B_PRIGHT_DELIM_KEY(p_s_bh)     ( &(B_BLK_HEAD(p_s_bh)->blk_right_delim_key) )
-
/* Does the buffer contain a disk leaf. */
#define B_IS_ITEMS_LEVEL(p_s_bh)       ( B_BLK_HEAD(p_s_bh)->blk_level == DISK_LEAF_NODE_LEVEL )