You can get the list of file systems from current->namespace
. By iterating current->namespace->list
(items being struct vfsmount
) you can get all mounted file systems. vfsmount->mnt_mountpoint
is the directory entry you want.
You can follow the code that prints /proc/mounts
(e.g. base.c/mountstats_open
, namespace.c/m_start
) to get more details (e.g. some locking is needed).
I don't know if you can do it in a kernel module, however.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…