// mount attempts to mount the provided FUSE mount point
func internalMount(ipfs *core.IpfsNode, m mount.Mount) error {
	c, err := fuse.Mount(m.MountPoint())
	if err != nil {
		return err
	}
	defer c.Close()

	fsys := FileSystem{Ipfs: ipfs}

	log.Infof("Mounted ipfs at %s.", m.MountPoint())
	if err := fs.Serve(c, fsys); err != nil {
		return err
	}

	// check if the mount process has an error to report
	<-c.Ready
	if err := c.MountError; err != nil {
		m.Unmount()
		return err
	}
	return nil
}