osandov / drgn

Programmable debugger
Other
1.78k stars 165 forks source link

helpers.linux.fs: add dentry_path_first_mount() #426

Closed brenns10 closed 2 months ago

brenns10 commented 3 months ago

This is a bit of a drive-by helper idea, inspired by something we have in drgn-tools. We frequently want a way to just convert a dentry to a path even if we don't know the vfsmount associated with the path we want. This helper is a good way to do it. Let me know your thoughts!

brenns10 commented 3 months ago

What do you think?

That's even better! I am not 100% attached to the specific heuristic either. It's really just a way to get any path for a dentry that goes all the way down to the root filesystem. I'll update this, probably tomorrow though. Thanks!