On 28 apr 2010, at 14.06, Edward Ned Harvey wrote:

>> From: zfs-discuss-boun...@opensolaris.org [mailto:zfs-discuss-
>> boun...@opensolaris.org] On Behalf Of Edward Ned Harvey
>> 
>> Look up the inode number of README.  (for example, ls -i README)
>>                 (suppose it’s inode 12345)
>> find /tank/.zfs/snapshot -inum 12345
>> 
>> Problem is, the find command will run for a long time.
>> 
>> Is there any faster way to find the file name(s) when all you know is
>> the inode number?  (Actually, all you know is all the info that’s in
>> the present directory, which is not limited to inode number; but, inode
>> number is the only information that I personally know could be useful.)
> 
> Due to lack of response, and based on my personal knowledge, and lack of any
> useful response anywhere else I've asked this question, I'm drawing the
> conclusion it's not possible to quickly lookup the name(s) of an inode.
> 
> Which means in ZFS, if you want to find the previous snapshots of some
> file/directory that was renamed/moved, there are only two possibilities:
> 
> Assume the name and location didn't change.  So you can quickly "ls" or
> "stat" specific already-known name(s) in the snapshot directories.
> - or -
> Walk all the trees of all the snapshots searching for inode X.  Which would
> be probably extremely slow.  (Probably many hours to complete, in a typical
> small business fileserver, linearly dependent on number of files in the
> filesystem and number of snapshots to traverse.)
> 
> BTW, this is not an issue for Ontap.  Which is to say, yes it's absolutely
> possible to maintain reverse inode lookup tables too, but apparently not
> implemented in ... other filesystems including ZFS.

What indicators do you have that ONTAP/WAFL has inode->name lookup
functionality? I don't think it has any such thing - WAFL is pretty
much an UFS/FFS that does COW instead of in-place writing, the main
difference is that inodes are written to special inode files rather
than specific static areas. Directories I believe works very much like
UFS/FFS directories. But I may have misunderstood something and be
wrong.

> I think an inode --> name lookup table would be useful in something like
> zhist.  And it's one way of solving this problem without violating any
> Ontap-style .snapshot directory patents.  So maybe this would be a good
> thing to request in future versions of ZFS.

I must be missing something or maybe I am just plain stupid (both
are probable), and just out of curiosity: What is the exact problem
you are trying to solve? Providing a move/rename history? Is there
a specific use case?

/ragge

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

Reply via email to