patch-2.4.11-dontuse linux/fs/reiserfs/lbalance.c

Next file: linux/fs/reiserfs/namei.c
Previous file: linux/fs/reiserfs/journal.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.10/linux/fs/reiserfs/lbalance.c linux/fs/reiserfs/lbalance.c
@@ -37,10 +37,7 @@
 
     ih = B_N_PITEM_HEAD (source, item_num);
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (!is_direntry_le_ih (ih))
-	reiserfs_panic(0, "vs-10000: leaf_copy_dir_entries: item must be directory item");
-#endif
+    RFALSE( !is_direntry_le_ih (ih), "vs-10000: item must be directory item");
 
     /* length of all record to be copied and first byte of the last of them */
     deh = B_I_DEH (source, ih);
@@ -126,10 +123,7 @@
       /* there is nothing to merge */
       return 0;
       
-#ifdef CONFIG_REISERFS_CHECK
-    if ( ! ih->ih_item_len )
-      reiserfs_panic (0, "vs-10010: leaf_copy_boundary_item: item can not have empty dynamic length");
-#endif
+    RFALSE( ! ih->ih_item_len, "vs-10010: item can not have empty length");
       
     if ( is_direntry_le_ih (ih) ) {
       if ( bytes_or_entries == -1 )
@@ -162,12 +156,9 @@
 			  );
       
     if (is_indirect_le_ih (dih)) {
-#ifdef CONFIG_REISERFS_CHECK
-      if (get_ih_free_space (dih))
-	reiserfs_panic (0, "vs-10030: leaf_copy_boundary_item: " 
-			"merge to left: last unformatted node of non-last indirect item %h must have zerto free space",
-			ih);
-#endif
+      RFALSE( get_ih_free_space (dih),
+	      "vs-10030: merge to left: last unformatted node of non-last indirect item %h must have zero free space", 
+	      ih);
       if (bytes_or_entries == le16_to_cpu (ih->ih_item_len))
 	set_ih_free_space (dih, get_ih_free_space (ih));
     }
@@ -202,21 +193,17 @@
      don't create new item header
      */
   
-#ifdef CONFIG_REISERFS_CHECK  
-  if (is_indirect_le_ih(ih) && get_ih_free_space (ih))
-    reiserfs_panic (0, "vs-10040: leaf_copy_boundary_item: " 
-		    "merge to right: last unformatted node of non-last indirect item must be filled entirely (%h)",
+  RFALSE( is_indirect_le_ih(ih) && get_ih_free_space (ih),
+	  "vs-10040: merge to right: last unformatted node of non-last indirect item must be filled entirely (%h)",
 		    ih);
-#endif
 
   if ( bytes_or_entries == -1 ) {
     /* bytes_or_entries = length of last item body of SOURCE */
     bytes_or_entries = ih->ih_item_len;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (le_ih_k_offset (dih) != le_ih_k_offset (ih) + op_bytes_number (ih, src->b_size))
-      reiserfs_panic (0, "vs-10050: leaf_copy_boundary_item: items %h and %h do not match", ih, dih);
-#endif
+    RFALSE( le_ih_k_offset (dih) != 
+	    le_ih_k_offset (ih) + op_bytes_number (ih, src->b_size),
+	    "vs-10050: items %h and %h do not match", ih, dih);
 
     /* change first item key of the DEST */
     set_le_ih_k_offset (dih, le_ih_k_offset (ih));
@@ -226,26 +213,20 @@
     set_le_ih_k_type (dih, le_ih_k_type (ih));
   } else {
     /* merge to right only part of item */
-#ifdef CONFIG_REISERFS_CHECK
-    if ( le16_to_cpu (ih->ih_item_len) <= bytes_or_entries )
-      reiserfs_panic (0, "vs-10060: leaf_copy_boundary_item: no so much bytes %lu (needed %lu)",
-		      ih->ih_item_len, bytes_or_entries);
-#endif
+    RFALSE( le16_to_cpu (ih->ih_item_len) <= bytes_or_entries,
+	    "vs-10060: no so much bytes %lu (needed %lu)",
+	    ih->ih_item_len, bytes_or_entries);
     
     /* change first item key of the DEST */
     if ( is_direct_le_ih (dih) ) {
-#ifdef CONFIG_REISERFS_CHECK
-      if (le_ih_k_offset (dih) <= (unsigned long)bytes_or_entries)
-	reiserfs_panic (0, "vs-10070: leaf_copy_boundary_item: dih %h, bytes_or_entries(%d)", 
-			dih, bytes_or_entries);
-#endif
+      RFALSE( le_ih_k_offset (dih) <= (unsigned long)bytes_or_entries,
+	      "vs-10070: dih %h, bytes_or_entries(%d)", dih, bytes_or_entries);
       set_le_ih_k_offset (dih, le_ih_k_offset (dih) - bytes_or_entries);
     } else {
-#ifdef CONFIG_REISERFS_CHECK
-      if (le_ih_k_offset (dih) <= (bytes_or_entries / UNFM_P_SIZE) * dest->b_size )
-	reiserfs_panic (0, "vs-10080: leaf_copy_boundary_item: dih %h, bytes_or_entries(%d)",
-			dih, (bytes_or_entries/UNFM_P_SIZE)*dest->b_size);
-#endif
+      RFALSE( le_ih_k_offset (dih) <= 
+	      (bytes_or_entries / UNFM_P_SIZE) * dest->b_size,
+	      "vs-10080: dih %h, bytes_or_entries(%d)",
+	      dih, (bytes_or_entries/UNFM_P_SIZE)*dest->b_size);
       set_le_ih_k_offset (dih, le_ih_k_offset (dih) - ((bytes_or_entries / UNFM_P_SIZE) * dest->b_size));
     }
   }
@@ -270,27 +251,17 @@
     struct block_head * blkh;
     struct item_head * ih;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (last_first != LAST_TO_FIRST  && last_first != FIRST_TO_LAST) 
-	reiserfs_panic (0, "vs-10090: leaf_copy_items_entirely: bad last_first parameter %d", last_first);
-
-    if (B_NR_ITEMS (src) - first < cpy_num)
-	reiserfs_panic (0, "vs-10100: leaf_copy_items_entirely: too few items in source %d, required %d from %d",
-			B_NR_ITEMS(src), cpy_num, first);
-
-    if (cpy_num < 0)
-	reiserfs_panic (0, "vs-10110: leaf_copy_items_entirely: can not copy negative amount of items");
-
-    if ( ! dest_bi )
-	reiserfs_panic (0, "vs-10120: leaf_copy_items_entirely: can not copy negative amount of items");
-#endif
+    RFALSE( last_first != LAST_TO_FIRST  && last_first != FIRST_TO_LAST,
+	    "vs-10090: bad last_first parameter %d", last_first);
+    RFALSE( B_NR_ITEMS (src) - first < cpy_num,
+	    "vs-10100: too few items in source %d, required %d from %d",
+	    B_NR_ITEMS(src), cpy_num, first);
+    RFALSE( cpy_num < 0, "vs-10110: can not copy negative amount of items");
+    RFALSE( ! dest_bi, "vs-10120: can not copy negative amount of items");
 
     dest = dest_bi->bi_bh;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( ! dest )
-	reiserfs_panic (0, "vs-10130: leaf_copy_items_entirely: can not copy negative amount of items");
-#endif
+    RFALSE( ! dest, "vs-10130: can not copy negative amount of items");
 
     if (cpy_num == 0)
 	return;
@@ -303,13 +274,9 @@
     /* location of head of first new item */
     ih = B_N_PITEM_HEAD (dest, dest_before);
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (le16_to_cpu (blkh->blk_free_space) < cpy_num * IH_SIZE) {
-	reiserfs_panic (0, "vs-10140: leaf_copy_items_entirely: "
-			"not enough free space for headers %d (needed %d)",
-			B_FREE_SPACE (dest), cpy_num * IH_SIZE);
-    }
-#endif
+    RFALSE( le16_to_cpu (blkh->blk_free_space) < cpy_num * IH_SIZE,
+	    "vs-10140: not enough free space for headers %d (needed %d)",
+	    B_FREE_SPACE (dest), cpy_num * IH_SIZE);
 
     /* prepare space for headers */
     memmove (ih + cpy_num, ih, (nr-dest_before) * IH_SIZE);
@@ -330,12 +297,9 @@
     last_inserted_loc = ih[cpy_num-1].ih_item_location;
 
     /* check free space */
-#ifdef CONFIG_REISERFS_CHECK
-    if (le16_to_cpu (blkh->blk_free_space) < j - last_inserted_loc) {
-	reiserfs_panic (0, "vs-10150: leaf_copy_items_entirely: not enough free space for items %d (needed %d)",
-			le16_to_cpu (blkh->blk_free_space), j - last_inserted_loc);
-    }
-#endif
+    RFALSE( le16_to_cpu (blkh->blk_free_space) < j - last_inserted_loc,
+	    "vs-10150: not enough free space for items %d (needed %d)",
+	    le16_to_cpu (blkh->blk_free_space), j - last_inserted_loc);
 
     memmove (dest->b_data + last_loc,
 	     dest->b_data + last_loc + j - last_inserted_loc,
@@ -352,13 +316,9 @@
     do_balance_mark_leaf_dirty (dest_bi->tb, dest, 0);
 
     if (dest_bi->bi_parent) {
-#ifdef CONFIG_REISERFS_CHECK
-	if (B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number != dest->b_blocknr) {
-	    reiserfs_panic (0, "vs-10160: leaf_copy_items_entirely: "
-			    "block number in bh does not match to field in disk_child structure %lu and %lu",
-			    dest->b_blocknr, B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number);
-	}
-#endif
+	RFALSE( B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number != dest->b_blocknr,
+		"vs-10160: block number in bh does not match to field in disk_child structure %lu and %lu",
+		dest->b_blocknr, B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number);
 	B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_size +=
 	    j - last_inserted_loc + IH_SIZE * cpy_num;
     
@@ -375,10 +335,7 @@
     struct buffer_head * dest = dest_bi->bi_bh;
     struct item_head * ih;
   
-#ifdef CONFIG_REISERFS_CHECK  
-    if ( cpy_bytes == -1 ) 
-	reiserfs_panic (0, "vs-10170: leaf_item_bottle: bytes == - 1 means: do not split item");
-#endif
+    RFALSE( cpy_bytes == -1, "vs-10170: bytes == - 1 means: do not split item");
 
     if ( last_first == FIRST_TO_LAST ) {
 	/* if ( if item in position item_num in buffer SOURCE is directory item ) */
@@ -394,19 +351,15 @@
 	    memcpy (&n_ih, ih, IH_SIZE);
 	    n_ih.ih_item_len = cpu_to_le16 (cpy_bytes);
 	    if (is_indirect_le_ih (ih)) {
-#ifdef CONFIG_REISERFS_CHECK
-		if (cpy_bytes == le16_to_cpu (ih->ih_item_len) && get_ih_free_space (ih))
-		    reiserfs_panic (0, "vs-10180: leaf_item_bottle: " 
-				    "when whole indirect item is bottle to left neighbor, it must have free_space==0 (not %lu)",
-				    get_ih_free_space (ih));
-#endif
+		RFALSE( cpy_bytes == le16_to_cpu (ih->ih_item_len) && 
+			get_ih_free_space (ih),
+			"vs-10180: when whole indirect item is bottle to left neighbor, it must have free_space==0 (not %lu)",
+			get_ih_free_space (ih));
 		set_ih_free_space (&n_ih, 0);
 	    }
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if (op_is_left_mergeable (&(ih->ih_key), src->b_size))
-		reiserfs_panic (0, "vs-10190: leaf_item_bottle: bad mergeability of item %h", ih);
-#endif
+	    RFALSE( op_is_left_mergeable (&(ih->ih_key), src->b_size),
+		    "vs-10190: bad mergeability of item %h", ih);
 	    n_ih.ih_version = ih->ih_version;;
 	    leaf_insert_into_buf (dest_bi, B_NR_ITEMS(dest), &n_ih, B_N_PITEM (src, item_num), 0);
 	}
@@ -429,10 +382,8 @@
 		set_ih_free_space (&n_ih, MAX_US_INT);
 	    } else {
 		/* indirect item */
-#ifdef CONFIG_REISERFS_CHECK
-		if (!cpy_bytes && get_ih_free_space (ih))
-		    reiserfs_panic (0, "vs-10200: leaf_item_bottle: ih->ih_free_space must be 0 when indirect item will be appended");
-#endif
+		RFALSE( !cpy_bytes && get_ih_free_space (ih),
+			"vs-10200: ih->ih_free_space must be 0 when indirect item will be appended");
 		set_le_ih_k_offset (&n_ih, le_ih_k_offset (ih) + (le16_to_cpu (ih->ih_item_len) - cpy_bytes) / UNFM_P_SIZE * dest->b_size);
 		set_le_ih_k_type (&n_ih, TYPE_INDIRECT);
 		set_ih_free_space (&n_ih, get_ih_free_space (ih));
@@ -458,19 +409,12 @@
   int pos, i, src_nr_item, bytes;
 
   dest = dest_bi->bi_bh;
-#ifdef CONFIG_REISERFS_CHECK
-  if (!dest || !src)
-    reiserfs_panic (0, "vs-10210: leaf_copy_items: !dest || !src");
-  
-  if ( last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST )
-    reiserfs_panic (0, "vs-10220: leaf_copy_items: last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST");
-
-  if ( B_NR_ITEMS(src) < cpy_num )
-    reiserfs_panic (0, "vs-10230: leaf_copy_items: No enough items: %d, required %d", B_NR_ITEMS(src), cpy_num);
-
- if ( cpy_num < 0 )
-    reiserfs_panic (0, "vs-10240: leaf_copy_items: cpy_num < 0 (%d)", cpy_num);
-#endif
+  RFALSE( !dest || !src, "vs-10210: !dest || !src");
+  RFALSE( last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST,
+	  "vs-10220:last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST");
+  RFALSE( B_NR_ITEMS(src) < cpy_num,
+	  "vs-10230: No enough items: %d, req. %d", B_NR_ITEMS(src), cpy_num);
+  RFALSE( cpy_num < 0,"vs-10240: cpy_num < 0 (%d)", cpy_num);
 
  if ( cpy_num == 0 )
    return 0;
@@ -537,10 +481,8 @@
 					struct buffer_info * src_bi, int * first_last,
 					struct buffer_head * Snew)
 {
-#ifdef CONFIG_REISERFS_CHECK
     memset (dest_bi, 0, sizeof (struct buffer_info));
     memset (src_bi, 0, sizeof (struct buffer_info));
-#endif
 
     /* define dest, src, dest parent, dest position */
     switch (shift_mode) {
@@ -607,12 +549,9 @@
     default:
 	reiserfs_panic (0, "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)", shift_mode);
     }
-#ifdef CONFIG_REISERFS_CHECK
-    if (src_bi->bi_bh == 0 || dest_bi->bi_bh == 0) {
-	reiserfs_panic (0, "vs-10260: leaf_define_dest_src_etc: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly",
-			shift_mode, src_bi->bi_bh, dest_bi->bi_bh);
-    }
-#endif
+    RFALSE( src_bi->bi_bh == 0 || dest_bi->bi_bh == 0,
+	    "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly",
+	    shift_mode, src_bi->bi_bh, dest_bi->bi_bh);
 }
 
 
@@ -650,10 +589,10 @@
   if ( shift_num ) {
     if (B_NR_ITEMS (S0) == 0) { /* number of items in S[0] == 0 */
 
+      RFALSE( shift_bytes != -1,
+	      "vs-10270: S0 is empty now, but shift_bytes != -1 (%d)", 
+	      shift_bytes);
 #ifdef CONFIG_REISERFS_CHECK
-      if ( shift_bytes != -1 )
-	reiserfs_panic (tb->tb_sb, "vs-10270: leaf_shift_left: S0 is empty now, but shift_bytes != -1 (%d)", shift_bytes);
-
       if (tb->tb_mode == M_PASTE || tb->tb_mode == M_INSERT) {
 	print_cur_tb ("vs-10275");
 	reiserfs_panic (tb->tb_sb, "vs-10275: leaf_shift_left: balance condition corrupted (%c)", tb->tb_mode);
@@ -675,14 +614,11 @@
       /* 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
-#ifdef CONFIG_REISERFS_CHECK
-      if (shift_bytes != -1 && !(is_direntry_le_ih (B_N_PITEM_HEAD (S0, 0))
-				 && !I_ENTRY_COUNT (B_N_PITEM_HEAD (S0, 0)))) {
-	if (!op_is_left_mergeable (B_N_PKEY (S0, 0), S0->b_size)) {
-	  reiserfs_panic (tb->tb_sb, "vs-10280: leaf_shift_left: item must be mergeable");
-	}
-      }
-#endif
+      RFALSE( (shift_bytes != -1 && 
+	       !(is_direntry_le_ih (B_N_PITEM_HEAD (S0, 0))
+		 && !I_ENTRY_COUNT (B_N_PITEM_HEAD (S0, 0)))) &&
+	      (!op_is_left_mergeable (B_N_PKEY (S0, 0), S0->b_size)),
+	      "vs-10280: item must be mergeable");
     }
   }
   
@@ -741,17 +677,12 @@
     struct buffer_head * bh;
     int item_amount = B_NR_ITEMS (bh = cur_bi->bi_bh);
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( !bh )
-	reiserfs_panic (0, "leaf_delete_items: 10155: bh is not defined");
-
-    if ( del_num < 0 )
-	reiserfs_panic (0, "leaf_delete_items: 10160: del_num can not be < 0. del_num==%d", del_num);
-
-    if ( first < 0 || first + del_num > item_amount )
-	reiserfs_panic (0, "leaf_delete_items: 10165: invalid number of first item to be deleted (%d) or "
-			"no so much items (%d) to delete (only %d)", first, first + del_num, item_amount);
-#endif
+    RFALSE( !bh, "10155: bh is not defined");
+    RFALSE( del_num < 0, "10160: del_num can not be < 0. del_num==%d", del_num);
+    RFALSE( first < 0 || first + del_num > item_amount,
+	    "10165: invalid number of first item to be deleted (%d) or "
+	    "no so much items (%d) to delete (only %d)", 
+	    first, first + del_num, item_amount);
 
     if ( del_num == 0 )
 	return;
@@ -814,16 +745,14 @@
 
     nr = le16_to_cpu ((blkh = B_BLK_HEAD (bh))->blk_nr_item);
 
-#ifdef CONFIG_REISERFS_CHECK
     /* check free space */
-    if (le16_to_cpu (blkh->blk_free_space) < le16_to_cpu (inserted_item_ih->ih_item_len) + IH_SIZE)
-	reiserfs_panic (0, "leaf_insert_into_buf: 10170: "
-			"not enough free space in block %z, new item %h",
-			bh, inserted_item_ih);
-    if (zeros_number > inserted_item_ih->ih_item_len)
-	reiserfs_panic (0, "vs-10172: leaf_insert_into_buf: "
-			"zero number == %d, item length == %d", zeros_number, inserted_item_ih->ih_item_len);
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( le16_to_cpu (blkh->blk_free_space) < 
+	    le16_to_cpu (inserted_item_ih->ih_item_len) + IH_SIZE,
+	    "not enough free space in block %z, new item %h",
+	    bh, inserted_item_ih);
+    RFALSE( zeros_number > inserted_item_ih->ih_item_len,
+	    "vs-10172: zero number == %d, item length == %d", 
+	    zeros_number, inserted_item_ih->ih_item_len);
 
 
     /* get item new item must be inserted before */
@@ -886,11 +815,11 @@
 
     nr = le16_to_cpu ((blkh = B_BLK_HEAD(bh))->blk_nr_item);
 
-#ifdef CONFIG_REISERFS_CHECK
     /* check free space */
-    if (le16_to_cpu (blkh->blk_free_space) < paste_size)
-	reiserfs_panic (0, "leaf_paste_in_buffer: 10175: not enough free space: needed %d, available %d",
-			paste_size, le16_to_cpu (blkh->blk_free_space));
+    RFALSE( le16_to_cpu (blkh->blk_free_space) < paste_size,
+	    "10175: not enough free space: needed %d, available %d",
+	    paste_size, le16_to_cpu (blkh->blk_free_space));
+#ifdef CONFIG_REISERFS_CHECK
     if (zeros_number > paste_size) {
 	print_cur_tb ("10177");
 	reiserfs_panic (0, "vs-10177: leaf_paste_in_buffer: zero number == %d, paste_size == %d",
@@ -965,16 +894,12 @@
   int i;
 
 
-#ifdef CONFIG_REISERFS_CHECK
   /* make sure, that item is directory and there are enough entries to
      remove */
-  if (!is_direntry_le_ih (ih))
-    reiserfs_panic (0, "leaf_cut_entries: 10180: item is not directory item");
-
-  if (I_ENTRY_COUNT(ih) < from + del_count)
-    reiserfs_panic (0, "leaf_cut_entries: 10185: item contains not enough entries: entry_cout = %d, from = %d, to delete = %d",
-		    I_ENTRY_COUNT(ih), from, del_count);
-#endif
+  RFALSE( !is_direntry_le_ih (ih), "10180: item is not directory item");
+  RFALSE( I_ENTRY_COUNT(ih) < from + del_count,
+	  "10185: item contains not enough entries: entry_cout = %d, from = %d, to delete = %d",
+	  I_ENTRY_COUNT(ih), from, del_count);
 
   if (del_count == 0)
     return 0;
@@ -1042,25 +967,19 @@
         cut_size = leaf_cut_entries (bh, ih, pos_in_item, cut_size);
         if (pos_in_item == 0) {
 	        /* change key */
-#ifdef CONFIG_REISERFS_CHECK
-            if (cut_item_num)
-                reiserfs_panic (0, "leaf_cut_from_buffer: 10190: " 
+	    RFALSE( cut_item_num,
                     "when 0-th enrty of item is cut, that item must be first in the node, not %d-th", cut_item_num);
-#endif
             /* change item key by key of first entry in the item */
 	    set_le_ih_k_offset (ih, le32_to_cpu (B_I_DEH (bh, ih)->deh_offset));
             /*memcpy (&ih->ih_key.k_offset, &(B_I_DEH (bh, ih)->deh_offset), SHORT_KEY_SIZE);*/
 	    }
     } else {
         /* item is direct or indirect */
-#ifdef CONFIG_REISERFS_CHECK
-        if (is_statdata_le_ih (ih))
-	        reiserfs_panic (0, "leaf_cut_from_buffer: 10195: item is stat data");
-
-        if (pos_in_item && pos_in_item + cut_size != le16_to_cpu (ih->ih_item_len) )
-            reiserfs_panic (0, "cut_from_buf: 10200: invalid offset (%lu) or trunc_size (%lu) or ih_item_len (%lu)",
+	RFALSE( is_statdata_le_ih (ih), "10195: item is stat data");
+	RFALSE( pos_in_item && 
+		pos_in_item + cut_size != le16_to_cpu (ih->ih_item_len),
+		"invalid offset (%lu) or trunc_size (%lu) or ih_item_len (%lu)",
                 pos_in_item, cut_size, le16_to_cpu (ih->ih_item_len));
-#endif
 
         /* shift item body to left if cut is from the head of item */
         if (pos_in_item == 0) {
@@ -1072,10 +991,9 @@
 		set_le_ih_k_offset (ih, le_ih_k_offset (ih) + cut_size);
             else {
 		set_le_ih_k_offset (ih, le_ih_k_offset (ih) + (cut_size / UNFM_P_SIZE) * bh->b_size);
-#ifdef CONFIG_REISERFS_CHECK
-                if ( le16_to_cpu (ih->ih_item_len) == cut_size && get_ih_free_space (ih) )
-                    reiserfs_panic (0, "leaf_cut_from_buf: 10205: invalid ih_free_space (%h)", ih);
-#endif
+		RFALSE( le16_to_cpu (ih->ih_item_len) == cut_size && 
+			get_ih_free_space (ih),
+			"10205: invalid ih_free_space (%h)", ih);
 	        }
 	    }
     }
@@ -1130,23 +1048,16 @@
     struct block_head * blkh;
     struct item_head * ih;
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (bh == NULL)
-    reiserfs_panic (0, "leaf_delete_items_entirely: 10210: buffer is 0");
-
-  if (del_num < 0)
-    reiserfs_panic (0, "leaf_delete_items_entirely: 10215: del_num less than 0 (%d)", del_num);
-#endif /* CONFIG_REISERFS_CHECK */
+  RFALSE( bh == NULL, "10210: buffer is 0");
+  RFALSE( del_num < 0, "10215: del_num less than 0 (%d)", del_num);
 
   if (del_num == 0)
     return;
 
   nr = le16_to_cpu ((blkh = B_BLK_HEAD(bh))->blk_nr_item);
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (first < 0 || first + del_num > nr)
-    reiserfs_panic (0, "leaf_delete_items_entirely: 10220: first=%d, number=%d, there is %d items", first, del_num, nr);
-#endif /* CONFIG_REISERFS_CHECK */
+  RFALSE( first < 0 || first + del_num > nr,
+	  "10220: first=%d, number=%d, there is %d items", first, del_num, nr);
 
   if (first == 0 && del_num == nr) {
     /* this does not work */
@@ -1213,15 +1124,11 @@
 
     ih = B_N_PITEM_HEAD(bh, item_num);
 
-#ifdef CONFIG_REISERFS_CHECK
   /* make sure, that item is directory, and there are enough records in it */
-  if (!is_direntry_le_ih (ih))
-    reiserfs_panic (0, "leaf_paste_entries: 10225: item is not directory item");
-
-  if (I_ENTRY_COUNT (ih) < before)
-    reiserfs_panic (0, "leaf_paste_entries: 10230: there are no entry we paste entries before. entry_count = %d, before = %d",
-		    I_ENTRY_COUNT (ih), before);
-#endif
+  RFALSE( !is_direntry_le_ih (ih), "10225: item is not directory item");
+  RFALSE( I_ENTRY_COUNT (ih) < before,
+	  "10230: there are no entry we paste entries before. entry_count = %d, before = %d",
+	  I_ENTRY_COUNT (ih), before);
 
 
   /* first byte of dest item */
@@ -1268,13 +1175,6 @@
   /* change item key if neccessary (when we paste before 0-th entry */
   if (!before)
     {
-#ifdef CONFIG_REISERFS_CHECK
-/*
-      if ( old_entry_num && COMP_SHORT_KEYS ((unsigned long *)&ih->ih_key.k_offset,
-					     &(new_dehs->deh_offset)) <= 0)
-	reiserfs_panic (0, "leaf_paste_entries: 10235: new key must be less, that old key");
-*/
-#endif
 	set_le_ih_k_offset (ih, le32_to_cpu (new_dehs->deh_offset));
 /*      memcpy (&ih->ih_key.k_offset, 
 		       &new_dehs->deh_offset, SHORT_KEY_SIZE);*/

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)