* Replaced Chain with the new SinglyLinkedList.

* Renamed openModeToAccess() to open_mode_to_access().
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26718 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-08-01 14:20:16 +00:00
parent c1c81d42d1
commit 2accd07be4
13 changed files with 298 additions and 356 deletions
@@ -377,9 +377,10 @@ BPlusTree::~BPlusTree()
// traversing the tree - a TreeIterator doesn't lock the inode)
mutex_lock(&fIteratorLock);
TreeIterator *iterator = NULL;
while ((iterator = fIterators.Next(iterator)) != NULL)
iterator->Stop();
SinglyLinkedList<TreeIterator>::Iterator iterator
= fIterators.GetIterator();
while (iterator.HasNext())
iterator.Next()->Stop();
mutex_destroy(&fIteratorLock);
}
@@ -569,9 +570,10 @@ BPlusTree::_UpdateIterators(off_t offset, off_t nextOffset, uint16 keyIndex,
// any time, so we need to protect this loop
MutexLocker _(fIteratorLock);
TreeIterator *iterator = NULL;
while ((iterator = fIterators.Next(iterator)) != NULL)
iterator->Update(offset, nextOffset, keyIndex, splitAt, change);
SinglyLinkedList<TreeIterator>::Iterator iterator
= fIterators.GetIterator();
while (iterator.HasNext())
iterator.Next()->Update(offset, nextOffset, keyIndex, splitAt, change);
}
@@ -1862,8 +1864,7 @@ BPlusTree::Find(const uint8 *key, uint16 keyLength, off_t *_value)
TreeIterator::TreeIterator(BPlusTree *tree)
:
fTree(tree),
fCurrentNodeOffset(BPLUSTREE_NULL),
fNext(NULL)
fCurrentNodeOffset(BPLUSTREE_NULL)
{
tree->_AddIterator(this);
}