[OpenAFS] check in c (linux) whether a directory entry is a mount point for an AFS volume

Ken Hornstein kenh@cmf.nrl.navy.mil
Sat, 04 Aug 2018 00:40:16 -0400


>is there an easy  way to check in C (under linux) whether a directory
>entry is a mount point for an afs volume and maybe also obtain the name
>of the volume mounted?

Assuming vanilla AFS ... the absolute easiest way to check to see if a
directory entry is a mount point is stat() the directory.  If the inode
number of the directory is odd, it's a "real" directory.  If the inode
number is even, it's a mount point.

Determing the mount point NAME is more code from C; popen("fs lsm <X>")
might be the easist.  You won't have to do it that often once you figure
out what is and isn't a mountpoint, though.

--Ken