* Unmounting a volume didn't wait for the block allocator's initializer thread.

* This fixed bug #2541.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26679 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-07-29 16:26:47 +00:00
parent e9c954c387
commit d06cc6e386
3 changed files with 13 additions and 0 deletions

View File

@ -626,6 +626,15 @@ BlockAllocator::_Initialize(BlockAllocator *allocator)
}
void
BlockAllocator::Uninitialize()
{
// We only have to make sure that the initializer thread isn't running
// anymore.
mutex_lock(&fLock);
}
status_t
BlockAllocator::AllocateBlocks(Transaction &transaction, int32 group,
uint16 start, uint16 maximum, uint16 minimum, block_run &run)

View File

@ -27,6 +27,8 @@ class BlockAllocator {
status_t Initialize(bool full = true);
status_t InitializeAndClearBitmap(Transaction &transaction);
void Uninitialize();
status_t AllocateForInode(Transaction &transaction, const block_run *parent,
mode_t type, block_run &run);
status_t Allocate(Transaction &transaction, Inode *inode, off_t numBlocks,

View File

@ -429,6 +429,8 @@ Volume::Unmount()
// Unlike in BeOS, we need to put the reference to our root node ourselves
put_vnode(fVolume, ToVnode(Root()));
fBlockAllocator.Uninitialize();
// This will also flush the log & all blocks to disk
delete fJournal;
fJournal = NULL;