Re: vode to pathname
From: Robert Watson (rwatson_at_FreeBSD.org)
Date: 08/25/05
- Previous message: M. Warner Losh: "Re: Enumerating devices and hardware conf from userland"
- In reply to: Dag-Erling Smørgrav: "Re: vode to pathname"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 25 Aug 2005 06:17:32 +0100 (BST) To: Dag-Erling Smørgrav <des@des.no>
On Wed, 24 Aug 2005, Dag-Erling Smørgrav wrote:
> "Kamal R. Prasad" <kamalpr@yahoo.com> writes:
>> So the question is, how do I get hold of pathname given
>> vnode*/(inode, devno, generation no) -without relying on the name
>> cache (on freebsd)?
>
> You can't. The semantics of Unix file systems are such that the mapping
> from file name to file is one-way. Furthermore, a file can be
> associated with more than one file name, or even none at all (if it has
> been unlinked but is still held open by a process).
In fact, there's another troublesome edge case -- different files can also
return the same name, if you have a way to generate names from linked
files, due to mountpoint covering. Covered vnodes can still be accessed
after the mount, if they have been opened, or if the cwd of a process is a
directory (other than the mountpoint vnode) of the covered file system,
and an identically named node can exist in the covering file system.
Robert N M Watson
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: M. Warner Losh: "Re: Enumerating devices and hardware conf from userland"
- In reply to: Dag-Erling Smørgrav: "Re: vode to pathname"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]