> If the kernel (or root) can open an arbitrary directory by inode number,
> then the kernel (or root) can find the inode number of its parent by looking
> at the '..' entry, which the kernel (or root) can then open, and identify
> both:  the name of the child subdir whose inode number is already known, and
> (b) yet another '..' entry.  The kernel (or root) can repeat this process
> recursively, up to the root of the filesystem tree.  At that time, the
> kernel (or root) has completely identified the absolute path of the inode
> that it started with.
>
> The only question I want answered right now is:
>
> Although it is possible, is it implemented?  Is there any kind of function,
> or existing program, which can be run by root, to obtain either the complete
> path of a directory by inode number, or to simply open an inode by number,
> which would leave the recursion and absolute path generation yet to be
> completed?

You can do in the kernel by calling vnodetopath(). I don't know if it
is exposed to user space.

But that could be slow if you have large directories so you have to
think about where you would use it.
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to