Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15871 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-01-08 13:59:37 +00:00
parent 5ce1a7a509
commit 1397187532
@@ -746,8 +746,7 @@ BPlusTree::FindFreeDuplicateFragment(Transaction &transaction,
const bplustree_node *fragment = cached.SetTo( const bplustree_node *fragment = cached.SetTo(
bplustree_node::FragmentOffset(value), false); bplustree_node::FragmentOffset(value), false);
if (fragment == NULL) { if (fragment == NULL) {
FATAL(("Could not get duplicate fragment at %Ld\n", FATAL(("Could not get duplicate fragment at %Ld\n", value));
BFS_ENDIAN_TO_HOST_INT64(values[i])));
continue; continue;
} }
@@ -812,7 +811,8 @@ BPlusTree::InsertDuplicate(Transaction &transaction, CachedNode &cached,
offset = bplustree_node::FragmentOffset(oldValue); offset = bplustree_node::FragmentOffset(oldValue);
memmove(duplicate->DuplicateArray(), array, (NUM_FRAGMENT_VALUES + 1) * sizeof(off_t)); memmove(duplicate->DuplicateArray(), array, (NUM_FRAGMENT_VALUES + 1) * sizeof(off_t));
duplicate->left_link = duplicate->right_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL); duplicate->left_link = duplicate->right_link = HOST_ENDIAN_TO_BFS_INT64(
(uint64)BPLUSTREE_NULL);
array = duplicate->DuplicateArray(); array = duplicate->DuplicateArray();
array->Insert(value); array->Insert(value);
@@ -842,15 +842,14 @@ BPlusTree::InsertDuplicate(Transaction &transaction, CachedNode &cached,
if (cached.MakeWritable(transaction) == NULL) if (cached.MakeWritable(transaction) == NULL)
return B_IO_ERROR; return B_IO_ERROR;
values[index] = HOST_ENDIAN_TO_BFS_INT64(bplustree_node::MakeLink(BPLUSTREE_DUPLICATE_NODE, offset)); values[index] = HOST_ENDIAN_TO_BFS_INT64(bplustree_node::MakeLink(
BPLUSTREE_DUPLICATE_NODE, offset));
} }
return B_OK; return B_OK;
} }
//
// Put the value into a dedicated duplicate node // Put the value into a dedicated duplicate node
//
// search for free space in the duplicate nodes of that key // search for free space in the duplicate nodes of that key
duplicate_array *array; duplicate_array *array;
@@ -897,10 +896,8 @@ BPlusTree::InsertDuplicate(Transaction &transaction, CachedNode &cached,
return B_OK; return B_OK;
} }
//
// Search for a free duplicate fragment or create a new one // Search for a free duplicate fragment or create a new one
// to insert the duplicate value into // to insert the duplicate value into
//
uint32 fragmentIndex = 0; uint32 fragmentIndex = 0;
bplustree_node *fragment; bplustree_node *fragment;
@@ -920,7 +917,8 @@ BPlusTree::InsertDuplicate(Transaction &transaction, CachedNode &cached,
if (cached.MakeWritable(transaction) == NULL) if (cached.MakeWritable(transaction) == NULL)
return B_IO_ERROR; return B_IO_ERROR;
values[index] = HOST_ENDIAN_TO_BFS_INT64(bplustree_node::MakeLink(BPLUSTREE_DUPLICATE_FRAGMENT, offset, fragmentIndex)); values[index] = HOST_ENDIAN_TO_BFS_INT64(bplustree_node::MakeLink(
BPLUSTREE_DUPLICATE_FRAGMENT, offset, fragmentIndex));
return B_OK; return B_OK;
} }