C How can i get the mount_point & absolute_path by the installed file struct?

I'm writing a simple hook to open / openat.
Like this

C:
static int
openat_hook(struct thread *td, register struct openat_args *uap)
{
  // print
  uprintf("  SYS_openat: \"%s\", flags: %d, mode: %X fd: %d\n", uap->path, uap->flag, uap->mode, uap->fd);
  get_whole_addr(td, uap);
  return sys_openat(td, uap);
}

But, this print relative path.

So, I kern_openat() here.
In this function, i can get struct vnode / nameidata / file / filedesc, but i don't know how to get mount_point / absolute_path.
Can somebody help me?
 
Back
Top