On Apr 26, 2010, at 5:02 AM, Edward Ned Harvey wrote:

>> From: Richard Elling [mailto:richard.ell...@gmail.com]
>> Sent: Sunday, April 25, 2010 2:12 PM
>> 
>>> E did exist.  Inode 12345 existed, but it had a different name at the
>> time
>> 
>> OK, I'll believe you.
>> 
>> How about this?
>> 
>>      mv a/E/c a/c
>>      mv a/E a/c
>>      mv a/c a/E
> 
> The thing that's still confusing you is the idea that directory names or
> locations matter.  They don't.

Maybe directory consistency doesn't matter for MS-DOS 1.0, but I'm
pretty sure that directory consistency is useful in UNIX.

> Remember that a directory is just an inode, with text and data inside it,
> which stores an association of child names and child inode numbers.  Suppose
> "somedir" is inode 12345.  Then if you "ls somedir/.snapshot/somesnap" then
> the system is reading a version of inode 12345 in a time gone by.  At that
> time, inode 12345 may have been referenced by its parent using the name
> "foo" instead of "somedir" but that won't even matter in this case because
> we've only instructed the system to read the contents of a past version of
> inode 12345.  In this case, we haven't told the system to do anything even
> slightly related to any parent of that inode.  We're not even going to know
> what name was associated with inode 12345 at that time.
> 
> At the time of somesnap, inode 12345 had contents which indicate "a.txt" is
> inode 1000 and "b.txt" is inode 1050 and so on.  So "a.txt" and "b.txt" will
> appear in the directory listing, and if you cat a.txt or b.txt, the system
> will fetch inode 1000 or 1050 as it appeared at the time of the snapshot.
> 
> Does that help?

I completely understand this.  No magic here.

> There is no actual entity called ".snapshot"  It's a magical thing, just
> like there is no actual entity called ".zfs"  If you "ls somedir" or "ls
> somezfsfilesystem" you will see, that the parent inode does not contain any
> reference to anything called ".snapshot" or ".zfs"   (Unless you turned it
> on for some reason.)  

Yes. And you agree that the relationship to parent directories does
not matter, correct? In other words, a tool that looks at either the parent 
or child snapshot directories is useless. Put another way, you cannot
implement something like time machine using directory-level snapshot 
subdirectories.

> However, if you "cd .snapshot" or "cd .zfs" then there's some magic behind
> the scenes that's able to handle that differently.  I don't know how they do
> that.  But I do know it's not listed in the inode like any other normal
> child subdirectory or file.


'nuff said
 -- richard

ZFS storage and performance consulting at http://www.RichardElling.com
ZFS training on deduplication, NexentaStor, and NAS performance
Las Vegas, April 29-30, 2010 http://nexenta-vegas.eventbrite.com 





_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to