hi everybody,
In the MDB structure for a HFS volume has a member.
drxtTClpSiz, this member stores the clump size for the extents overflow file. In the linux code it is calculated as follows
vol.mdb.drXTClpSiz = vol.mdb.drNmAlBlks / 128 * vol.mdb.drAlBlkSiz;
where
vol.mdb.drXTClpSiz = Stores the Clump size for the extents overflow file. vol.mdb.drNmAlBlks = Stores the number of Allocation blocks for the HFS volume vol.mdb.drAlBlkSiz = Stores the number of bytes per Allocation Block.
My doubt is why this formula is used to calculate the Extent file's clump size.
Can i make it equal to just clump size calculated for the Volume??
/*Info*/
1. A allocation block is integral times of a Logical Block , which for HFS is 512 bytes.
2. Clump size is integral times of Allocation Block size and it is the amount of space allocated when a file is created to store the file contents.
Waiting for your explanations!
Bye Biswaroop
On Friday, March 15, 2002, at 02:41 AM, Biswaroop Banerjee wrote:
vol.mdb.drXTClpSiz = vol.mdb.drNmAlBlks / 128 * vol.mdb.drAlBlkSiz;
That is making it 1/128 of the total volume size.
That is basically what Mac OS 9 uses, though Mac OS 9 also tries to limit the size to 4MB (which means that for volumes over 512 MB, the clump size will be 4 MB rounded up to a multiple of the allocation block size).
Can i make it equal to just clump size calculated for the Volume??
Depends on your volume's clump size.
For the extents B-tree in particular, you want to avoid making the clump size too small. The extents B-tree can't grow beyond 3 extents for HFS (8 extents for HFS Plus), so if the clump size is too small, and files (including the B-trees!) get too fragmented, you may be unable allocate space to files because the extents B-tree is too fragmented. Essentially, you'd get a "disk full" condition even when there is lots of free space on the volume.
When mastering read-only media, I'd set the clump size to one allocation block. And since you should be able to lay out the fork content contiguously, you can also make both of the B-trees the minimum possible size (meaning an extents B-tree with just a header node).
-Mark