Fixed a very stupid bug I introduced in r10056 (the Haiku-only switch):

CachedNode::Allocate() could return the wrong offset for the new node when
taken from the free node pool (it accidently returned the offset for the
next free node...).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14084 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-08-29 22:18:15 +00:00
parent 0afc66fa69
commit 1733a44231
@@ -294,12 +294,12 @@ CachedNode::Allocate(Transaction &transaction, bplustree_node **_node, off_t *_o
if (header == NULL) if (header == NULL)
return B_IO_ERROR; return B_IO_ERROR;
*_offset = header->FreeNode();
*_node = fNode;
// set new free node pointer // set new free node pointer
header->free_node_pointer = fNode->left_link; header->free_node_pointer = fNode->left_link;
fNode->Initialize(); fNode->Initialize();
*_offset = header->FreeNode();
*_node = fNode;
return B_OK; return B_OK;
} }