Using FSExtentType.zeroFill for allocated but uninitialized extents?

When implementing kernel offloaded IO, FSExtentType.zeroFill (https://developer.apple.com/documentation/fskit/fsextenttype/zerofill) indicates it should only be used for sparse files to represent ranges that haven’t been allocated yet. What if I have ranges that have been allocated disk space but not yet zeroed out, and have some kind of marker that indicates that those ranges aren’t initialized (and thus should be interpreted as zeroes)? Is it fine to use zeroFill to represent this case?

Answered by Apple Staff in 891144022

Yes, you can use a zeroFill extent for that case. If, later on, a write comes in for that range, the kernel will discard the zeroFill extent from its extent cache and perform another blockmap operation.

Accepted Answer

Yes, you can use a zeroFill extent for that case. If, later on, a write comes in for that range, the kernel will discard the zeroFill extent from its extent cache and perform another blockmap operation.

Using FSExtentType.zeroFill for allocated but uninitialized extents?
 
 
Q