Page MenuHomeFreeBSD

D26959.id78774.diff
No OneTemporary

D26959.id78774.diff

Index: sys/compat/linux/linux_file.c
===================================================================
--- sys/compat/linux/linux_file.c
+++ sys/compat/linux/linux_file.c
@@ -1119,13 +1119,15 @@
int
linux_mount(struct thread *td, struct linux_mount_args *args)
{
- char fstypename[MFSNAMELEN];
- char *mntonname, *mntfromname;
+ struct mntarg *ma = NULL;
+ char *fstypename, *mntonname, *mntfromname, *data;
int error, fsflags;
+ fstypename = malloc(MNAMELEN, M_TEMP, M_WAITOK);
mntonname = malloc(MNAMELEN, M_TEMP, M_WAITOK);
mntfromname = malloc(MNAMELEN, M_TEMP, M_WAITOK);
- error = copyinstr(args->filesystemtype, fstypename, MFSNAMELEN - 1,
+ data = NULL;
+ error = copyinstr(args->filesystemtype, fstypename, MNAMELEN - 1,
NULL);
if (error != 0)
goto out;
@@ -1146,6 +1148,25 @@
strcpy(fstypename, "linprocfs");
} else if (strcmp(fstypename, "vfat") == 0) {
strcpy(fstypename, "msdosfs");
+ } else if (strcmp(fstypename, "fuse") == 0) {
+ char *fuse_options, *fuse_option, *fuse_name;
+
+ if (strcmp(mntfromname, "fuse") == 0)
+ strcpy(mntfromname, "/dev/fuse");
+
+ strcpy(fstypename, "fusefs");
+ data = malloc(MNAMELEN, M_TEMP, M_WAITOK);
+ error = copyinstr(args->data, data, MNAMELEN - 1, NULL);
+ if (error != 0)
+ goto out;
+
+ fuse_options = data;
+ while ((fuse_option = strsep(&fuse_options, ",")) != NULL) {
+ fuse_name = strsep(&fuse_option, "=");
+ if (fuse_name == NULL || fuse_option == NULL)
+ goto out;
+ ma = mount_arg(ma, fuse_name, fuse_option, -1);
+ }
}
fsflags = 0;
@@ -1163,14 +1184,15 @@
if (args->rwflag & LINUX_MS_REMOUNT)
fsflags |= MNT_UPDATE;
- error = kernel_vmount(fsflags,
- "fstype", fstypename,
- "fspath", mntonname,
- "from", mntfromname,
- NULL);
+ ma = mount_arg(ma, "fstype", fstypename, -1);
+ ma = mount_arg(ma, "fspath", mntonname, -1);
+ ma = mount_arg(ma, "from", mntfromname, -1);
+ error = kernel_mount(ma, fsflags);
out:
+ free(fstypename, M_TEMP);
free(mntonname, M_TEMP);
free(mntfromname, M_TEMP);
+ free(data, M_TEMP);
return (error);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 1, 6:15 PM (7 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27442234
Default Alt Text
D26959.id78774.diff (2 KB)

Event Timeline