Detecting new file name after receiving kevent's NOTE_RENAME

Konstantin Belousov kostikbel at gmail.com
Wed Nov 11 19:36:21 UTC 2015


On Wed, Nov 11, 2015 at 09:24:51AM -0800, Conrad Meyer wrote:
> On Wed, Nov 11, 2015 at 2:56 AM, Konstantin Belousov
> <kostikbel at gmail.com> wrote:
> > It is up to filesystem to cache or not cache the file name entry.
> > If filesystem does not insert the name entry into namecache on rename,
> > there is nothing which could help vn_fullpath(9) to return a path.
> 
> Besides vn_vptocnp?  I thought vn_fullpath(9) should always succeed
> since 10.0 if the vnode still exists.

VOP_VPTOCNP() still must get the data somewhere. It is usually easy to
provide the name for a synthetic file system, where the data is fully
controlled by the filesystem. Also, it is always possible to provide the
name for a directory on any unix-like filesystem, due to dotdot. Both
cases are what handled by fs-specific implementations of VOP_VPTOCNP()
and by the default code.

For the rest, you e.g. must be able to answer with the name for regular
inode on UFS, given the inode number. If you can provide such code, I
will be quite amazed.


More information about the freebsd-hackers mailing list