* Resolved a TODO: determine the log size depending on the size of the volume.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24797 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -654,12 +654,18 @@ Volume::Initialize(int fd, const char *name, uint32 blockSize,
|
|||||||
fBlockShift = fSuperBlock.BlockShift();
|
fBlockShift = fSuperBlock.BlockShift();
|
||||||
fAllocationGroupShift = fSuperBlock.AllocationGroupShift();
|
fAllocationGroupShift = fSuperBlock.AllocationGroupShift();
|
||||||
|
|
||||||
|
// determine log size depending on the size of the volume
|
||||||
|
off_t logSize = 2048;
|
||||||
|
if (numBlocks <= 20480)
|
||||||
|
logSize = 512;
|
||||||
|
if (deviceSize > 1LL * 1024 * 1024 * 1024)
|
||||||
|
logSize = 4096;
|
||||||
|
|
||||||
// since the allocator has not been initialized yet, we
|
// since the allocator has not been initialized yet, we
|
||||||
// cannot use BlockAllocator::BitmapSize() here
|
// cannot use BlockAllocator::BitmapSize() here
|
||||||
fSuperBlock.log_blocks = ToBlockRun(AllocationGroups()
|
fSuperBlock.log_blocks = ToBlockRun(AllocationGroups()
|
||||||
* fSuperBlock.BlocksPerAllocationGroup() + 1);
|
* fSuperBlock.BlocksPerAllocationGroup() + 1);
|
||||||
fSuperBlock.log_blocks.length = HOST_ENDIAN_TO_BFS_INT16(2048);
|
fSuperBlock.log_blocks.length = HOST_ENDIAN_TO_BFS_INT16(logSize);
|
||||||
// ToDo: set the log size depending on the disk size
|
|
||||||
fSuperBlock.log_start = fSuperBlock.log_end = HOST_ENDIAN_TO_BFS_INT64(
|
fSuperBlock.log_start = fSuperBlock.log_end = HOST_ENDIAN_TO_BFS_INT64(
|
||||||
ToBlock(Log()));
|
ToBlock(Log()));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user