Well in the creation of a snapshot, the code now copies the *physical* block 
pointer for the objset.

Then if a live object changes, the live objset changes, but since this is 
copy-on-write the snapshot objset still exists unchanged at the same physical 
location.  So the live objset sees the new data and the snapshot objset sees 
the old data.

But at snapshot creation, the objset does not need to be copied.

In principle, I think you're right, in that an objset could hold both versions 
of a file.  It would contain physical pointers to each copy.  They would start 
out the same and diverge when one or other copy was modified.

For instance, zfs could support a fast "cp" which just cloned the file i.e. 
copied the objset entry to a new objset entry.  This would allow you to copy a 
100GB file in milliseconds, and still have the ability to update both copies of 
the file independently.  This is similar in principle to UNIX fork().

But I'm not aware of any user-level interfaces that would allow this to happen.
-- 
This message posted from opensolaris.org

Reply via email to