(WIP Answer)
Thanks to muru's answer for the kickstart.
Using the information in /proc/[pid]/fdinfo/[fd#]:
- Get mountpoint pathname and device using
mnt_idas an index into/proc/[pid]/mountinfoor possibly use a global mountinfo - Convert
inoto decimal - Lookup pathnames from inode:
btrfs(requires pathname)ext4(requires device, possibly via https://unix.stackexchange.com/q/387086/143394 )
Possibly lsof: list only files of a particular type with a_inode.
Too slow as a shell script with all the greping. Perhaps system call interface to /proc information.