Lines Matching refs:mo

191 	struct mount_opts *mo = data;
198 set_mount_flag(arg, &mo->flags);
202 return fuse_opt_add_opt(&mo->kernel_opts, arg);
205 return fuse_opt_add_opt_escaped(&mo->fusermount_opts, arg);
208 return fuse_opt_add_opt(&mo->subtype_opt, arg);
211 return fuse_opt_add_opt(&mo->mtab_opts, arg);
371 static int fuse_mount_fusermount(const char *mountpoint, struct mount_opts *mo,
431 if (!mo->auto_unmount) {
448 static int fuse_mount_sys(const char *mnt, struct mount_opts *mo,
486 res = fuse_opt_add_opt(&mo->kernel_opts, tmp);
490 source = malloc((mo->fsname ? strlen(mo->fsname) : 0) +
491 (mo->subtype ? strlen(mo->subtype) : 0) +
494 type = malloc((mo->subtype ? strlen(mo->subtype) : 0) + 32);
500 strcpy(type, mo->blkdev ? "fuseblk" : "fuse");
501 if (mo->subtype) {
503 strcat(type, mo->subtype);
506 mo->fsname ? mo->fsname : (mo->subtype ? mo->subtype : devname));
508 res = mount(source, mnt, type, mo->flags, mo->kernel_opts);
509 if (res == -1 && errno == ENODEV && mo->subtype) {
511 strcpy(type, mo->blkdev ? "fuseblk" : "fuse");
512 if (mo->fsname) {
513 if (!mo->blkdev)
514 sprintf(source, "%s#%s", mo->subtype,
515 mo->fsname);
519 res = mount(source, mnt, type, mo->flags, mo->kernel_opts);
530 if (mo->blkdev && errno == ENODEV &&
587 struct mount_opts *mo;
589 mo = (struct mount_opts*) malloc(sizeof(struct mount_opts));
590 if (mo == NULL)
593 memset(mo, 0, sizeof(struct mount_opts));
594 mo->flags = MS_NOSUID | MS_NODEV;
597 fuse_opt_parse(args, mo, fuse_mount_opts, fuse_mount_opt_proc) == -1)
600 return mo;
603 destroy_mount_opts(mo);
607 void destroy_mount_opts(struct mount_opts *mo)
609 free(mo->fsname);
610 free(mo->subtype);
611 free(mo->fusermount_opts);
612 free(mo->subtype_opt);
613 free(mo->kernel_opts);
614 free(mo->mtab_opts);
615 free(mo);
619 int fuse_kern_mount(const char *mountpoint, struct mount_opts *mo)
625 if (get_mnt_flag_opts(&mnt_opts, mo->flags) == -1)
627 if (mo->kernel_opts && fuse_opt_add_opt(&mnt_opts, mo->kernel_opts) == -1)
629 if (mo->mtab_opts && fuse_opt_add_opt(&mnt_opts, mo->mtab_opts) == -1)
632 res = fuse_mount_sys(mountpoint, mo, mnt_opts);
633 if (res >= 0 && mo->auto_unmount) {
640 if (mo->fusermount_opts &&
641 fuse_opt_add_opt(&mnt_opts, mo->fusermount_opts) == -1)
644 if (mo->subtype) {
649 fuse_opt_add_opt(&tmp_opts, mo->subtype_opt) == -1) {
654 res = fuse_mount_fusermount(mountpoint, mo, tmp_opts, 1);
657 res = fuse_mount_fusermount(mountpoint, mo,
660 res = fuse_mount_fusermount(mountpoint, mo, mnt_opts, 0);