On Wed, Oct 9, 2013 at 3:35 AM, Gaurav Mahajan <[email protected]> wrote:
> Hi,
>
> I am new to ZFS and trying to understand the code and workflow.
>
> In blkptr structure there are blk_phys_birth and blk_birth are nothing but
> the txgs.
>
> What is the difference between them?
> How DDT uses these two fields?
>
> typedef struct blkptr {
> ....
> uint64_t blk_phys_birth; /* txg when block was allocated */
> uint64_t blk_birth; /* transaction group at birth */
> .....
> } blkptr_t;
>
>
blk_birth_phys is when the block was allocated.
blk_birth is when this particular reference was created.
If the block is dedup'ed, blk_birth_phys can be before blk_birth. (The
block was allocated at time A, then another reference was added to that
block at a later time B.)
If they are the same (e.g. as is the case for all non-dedup'ed blocks), we
only store blk_birth. (I believe this is for backwards compatibility with
software that doesn't understand dedup (pool version 21)).
blk_birth_phys is used by the SPA, for example when resilvering devices
that were temporarily offline.
blk_birth is used by the DMU and DSL, for example to determine when to free
a block, or what blocks should be part of a zfs send stream.
--matt
_______________________________________________
developer mailing list
[email protected]
http://lists.open-zfs.org/mailman/listinfo/developer