-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helpers.linux.fs: support d_path() without vfsmount
There are some diagnostic use cases where all one has is a dentry and no vfsmount. This is technically ambiguous, because a superblock may be mounted in several places due to bind mounts, filesystem namespaces, etc. The dentry's full path would depend on the specific mount point. But when we're doing debugging, we frequently just want any representative filesystem path for the dentry. It turns out that the kernel always puts new mountpoints at the end of the superblock's list of mounts, so the first one is likely to be the most relevant anyway. Thus, arbitrarily choosing this first mountpoint is a good way to get a representative path. Update d_path() to accept a single dentry as well. Signed-off-by: Stephen Brennan <[email protected]>
- Loading branch information
Showing
2 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters