On Tuesday 16 February 2010 04:04:17 Ian Kent wrote:
> On 02/16/2010 05:53 AM, Stef Bon wrote:
> > Hello,
> > 

> 
> Yes, checking /proc/mounts is slow but is the only way when using older
> versions of the kernel module.
> 
> In a recent source tree, have a look at lib/mounts.c:is_mounted() and
> lib/dev-ioctl-lib.c, and in particular dev_ioctl_ismountpoint().
> 
> Ian

Thanks for you fast answer.

I've checked the code and found the functions you're pointed, they are indeed 
what I'm looking for.

The function is_mounted looks like an internal function. It makes use of a 
struct ioctl_ops, which is initialised with get_ioctl_ops.  I do not 
understand this, cause this function does not use any parameter (like path!) 
so how does this function determine it's a mountpoint?

Or is it initialised somewhere else?? 
(in that case it looks like an constrcution with fuse handling 
filedescriptors.. when openening a file for writing, it looks for a fd already 
set in the runtimeoptions fuse_file_info->fh, and opens that in stead of 
looking at the path, which happens to be a parameter also) 


The other function you mention is dev_ioctl_ismounpoint, which looks more 
suitable to use in an external program like a fusemodule. The ioctl device, is 
that the device /var/run/autofs.fifo-mnt-mount.md5key-sbon-mount?

(if the map looks like:
/mnt/mount.md5key/sbon/mount  /etc/autofs/auto.md5key MD5KEY_USER=sbon
)

Stef


_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to