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

Christian chanlists@googlemail.com
Fri, 31 Aug 2018 15:55:11 +0200


Dear Ken,

thank you, this is exactly what I was looking for. I can confirm that it
works. The code from Michael were also very helpful. Thanks to all those
who replied,

Christian

On 04/08/2018 06:40, Ken Hornstein wrote:
>> 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
>