vn_fullpath()
Igor Shmukler
shmukler at mail.ru
Mon Feb 21 07:16:43 PST 2005
Robert and David,
Thank you for your help.
> It depends a lot on the requirements. There are some nasty edge cases
> where the process of determining a name for an object can be quite
> expensive. Here's one of them:
>
> ln /usr/local/etc/apache/httpd.conf /usr/local/etc/apache.old/httpd.conf
> reboot
> apachectl start
> rm /usr/local/etc/apache/httpd.conf
>
> Now generate the name of the file that Apache has open. Note that you
> can't just look in the name cache, because the object has a name but the
> name used to open the object has been invalidated. And UFS even knows it
> has a name, because the link count remains non-zero when the unlink of one
> of the names occurs -- but the only way it can find the other name is to
> search the file system.
>
> So the first thing to do is to decied what your requirements are: are you
> willing to fail in the edge cases like the above? If so, life is a lot
> easier :-).
I guess I am willing to fail :). Perhaps in some distant future, we will look into the nasty corner cases,
but for now, as long as I get a name, it will do. We don't even mind the hardlinks so much, but we cannot
afford to use existing vn_fullpath() because it does not guarantee "anything".
Thank you,
Igor
More information about the freebsd-hackers
mailing list