> How it got that way, I couldn't really say without looking at your code. 

It works like this:

In new ioctl operation
    zfs_ioc_replicate_send(zfs_cmd_t *zc) 
           
we open filesystem ( not snapshot )

   dmu_objset_open(zc->zc_name, DMU_OST_ANY,
        DS_MODE_STANDARD | DS_MODE_READONLY, &filesystem);

call dmu replicate send function
   
   dmu_replicate_send(filesystem,  &txg, ...);
 (  txg  - is tranzaction group number  )

we set max_txg
  ba.max_txg = (spa_get_dsl(filesystem->os->os_spa))->dp_tx.tx_synced_txg;

and call traverse_dsl_dataset

   traverse_dsl_dataset(filesystem->os->os_dsl_dataset, *txg,
            ADVANCE_PRE | ADVANCE_HOLES | ADVANCE_DATA | ADVANCE_NOLOCK,
            replicate_cb, &ba);

after traversing next txg is returned

   if (ba.got_data != 0)
          *txg = ba.max_txg + 1;
 
in replicate_cb we do the same what backup_cb does, but at the beginning we 
are checking txg:

        /* remember last txg */
        if (bc->bc_blkptr.blk_birth) {
                
                if (bc->bc_blkptr.blk_birth > ba->max_txg) return;

                ba->got_data = 1;
        }

After 5 seconds delay we call ioctl with txg returned from last operation.
 
 
This message posted from opensolaris.org
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to