On Wed, Feb 09, 2011 at 06:21:01PM -0800, Steve Gonczi
wrote:> It seems ( via mdb) that a level 1 parent blocks will have an
> all-zeroes blkptr_t in it if the associated data block is a hole.
>
> I find this surprising, because I would expect at least the logical
> size to be set.
>
> Could someone from the zfs team confirm that the above is indeed the
> convention?
Hi Steve,
Holes are represented by all-zero block pointers. When compression is on,
all-zero blocks compress to holes, which means that an indirect block which
contains only holes will be all zero, which also compresses to a hole. So with
compression on, you can write terrabytes of zero data to a file, without
using any actual bytes.
BP_IS_HOLE(bp) detects the "hole" block pointers by their zero
"blk_birth"
field, which on any normal block pointer contains the transaction group the
block was "born" in.
Cheers,
- jonathan