Detecting new file name after receiving kevent's NOTE_RENAME

Conrad Meyer cem at FreeBSD.org
Wed Nov 11 20:08:07 UTC 2015


On Wed, Nov 11, 2015 at 11:36 AM, Konstantin Belousov
<kostikbel at gmail.com> wrote:
> 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.

I'm not sure what you're talking about.  To have a NOTE_RENAME monitor
as originally discussed, the userspace program must have an fd open to
the vnode.  With a vnode, the boring generic vn_fullpath and
vop_stdvptocnp can find a whole path using .. and directory traversal.
It may not be fast, but it is possible.

Conrad


More information about the freebsd-hackers mailing list