Lines Matching refs:mo

268     struct mount_opts *mo = data;
272 if (fuse_opt_add_opt(&mo->kernel_opts, "allow_other") == -1 ||
281 set_mount_flag(arg, &mo->flags);
285 return fuse_opt_add_opt(&mo->kernel_opts, arg);
288 return fuse_opt_add_opt(&mo->fusermount_opts, arg);
292 return fuse_opt_add_opt(&mo->subtype_opt, arg);
296 return fuse_opt_add_opt(&mo->mtab_opts, arg);
302 mo->ishelp = 1;
309 mo->ishelp = 1;
481 static int fuse_mount_sys(const char *mnt, struct mount_opts *mo,
504 if (!mo->nonempty) {
524 res = fuse_opt_add_opt(&mo->kernel_opts, tmp);
528 source = malloc((mo->fsname ? strlen(mo->fsname) : 0) +
529 (mo->subtype ? strlen(mo->subtype) : 0) +
532 type = malloc((mo->subtype ? strlen(mo->subtype) : 0) + 32);
538 strcpy(type, mo->blkdev ? "fuseblk" : "fuse");
539 if (mo->subtype) {
541 strcat(type, mo->subtype);
544 mo->fsname ? mo->fsname : (mo->subtype ? mo->subtype : devname));
547 res = mount(source, mnt, MS_OPTIONSTR|mo->flags, type, NULL, 0,
548 mo->kernel_opts, MAX_MNTOPT_STR, 0, 0);
550 if (res == -1 && errno == EINVAL && mo->subtype) {
552 strcpy(type, mo->blkdev ? "fuseblk" : "fuse");
553 if (mo->fsname) {
554 if (!mo->blkdev)
555 sprintf(source, "%s#%s", mo->subtype, mo->fsname);
560 res = mount(source, mnt, MS_OPTIONSTR|mo->flags, type, NULL, 0,
561 mo->kernel_opts, MAX_MNTOPT_STR, 0, 0);
572 if (mo->blkdev && errno == ENODEV && !fuse_mnt_check_fuseblk())
612 struct mount_opts mo;
620 memset(&mo, 0, sizeof(mo));
623 mo.flags = MS_NOSUID | MS_NODEV;
625 mo.flags = 0;
634 fuse_opt_parse(args, &mo, fuse_mount_opts, fuse_mount_opt_proc) == -1)
652 mo.flags |= MS_NOSUID;
661 if (fuse_opt_add_opt(&mo.kernel_opts, "nodevices") == -1)
664 if (fuse_opt_add_opt(&mo.kernel_opts, "nosetuid") == -1)
669 if (mo.allow_other && mo.allow_root) {
674 if (mo.ishelp)
677 if (get_mnt_flag_opts(&mnt_opts, mo.flags) == -1)
680 if (!(mo.flags & MS_NODEV) && fuse_opt_add_opt(&mnt_opts, "dev") == -1)
682 if (!(mo.flags & MS_NOSUID) && fuse_opt_add_opt(&mnt_opts, "suid") == -1)
684 if (mo.kernel_opts && fuse_opt_add_opt(&mnt_opts, mo.kernel_opts) == -1)
686 if (mo.mtab_opts && fuse_opt_add_opt(&mnt_opts, mo.mtab_opts) == -1)
688 if (mo.fusermount_opts && fuse_opt_add_opt(&mnt_opts, mo.fusermount_opts) < 0)
692 if (mo.kernel_opts && fuse_opt_add_opt(&mnt_opts, mo.kernel_opts) == -1)
694 if (mo.mtab_opts && fuse_opt_add_opt(&mnt_opts, mo.mtab_opts) == -1)
696 res = fuse_mount_sys(mountpoint, &mo, mnt_opts);
698 if (mo.fusermount_opts &&
699 fuse_opt_add_opt(&mnt_opts, mo.fusermount_opts) == -1)
702 if (mo.subtype) {
707 fuse_opt_add_opt(&tmp_opts, mo.subtype_opt) == -1) {
726 free(mo.subtype);
727 free(mo.subtype_opt);
729 free(mo.fsname);
730 free(mo.fusermount_opts);
731 free(mo.kernel_opts);
732 free(mo.mtab_opts);