get filesystem mount point in kernel module

后端 未结 2 488
[愿得一人]
[愿得一人] 2021-01-19 05:51

I want to get the filesystem mount point for a file system in my kernel module, which is a stackable filesystem. Eg. if /home/ab/abc is a file and /home is mounted on a diff

2条回答
  •  萌比男神i
    2021-01-19 06:36

    If someone still needs to "dereference" given path to its mount point there is follow_up function which does exactly this thing :) It operates on the struct path and changes it accordingly to its .mnt entry. Maybe someone will find it handy!

    Edit: I've used it in the 5.6 kernel version. I don't know if it was always available (<5.6)

提交回复
热议问题