diff options
author | tjr <tjr@FreeBSD.org> | 2004-03-16 09:05:56 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-03-16 09:05:56 +0000 |
commit | 5fb6c2e59a903622a747f6f9f728dab4a8597747 (patch) | |
tree | 404fd197b2192781e5eb218c6684e76b7bd7aef4 /sys/compat | |
parent | d37f036c1829ff37b16b16900d8784d8548978b4 (diff) | |
download | FreeBSD-src-5fb6c2e59a903622a747f6f9f728dab4a8597747.zip FreeBSD-src-5fb6c2e59a903622a747f6f9f728dab4a8597747.tar.gz |
Use vfs_nmount() to mount linprocfs filesystems in linux_mount();
linprocfs doesn't support the old mount interface.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_file.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 857c73d..ae5ad36 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -732,9 +732,10 @@ linux_mount(struct thread *td, struct linux_mount_args *args) struct ufs_args ufs; char fstypename[MFSNAMELEN]; char mntonname[MNAMELEN], mntfromname[MNAMELEN]; + struct uio auio; + struct iovec iov[4]; int error; int fsflags; - const char *fstype; void *fsdata; error = copyinstr(args->filesystemtype, fstypename, MFSNAMELEN - 1, @@ -755,7 +756,7 @@ linux_mount(struct thread *td, struct linux_mount_args *args) #endif if (strcmp(fstypename, "ext2") == 0) { - fstype = "ext2fs"; + strcpy(fstypename, "ext2fs"); fsdata = &ufs; ufs.fspec = mntfromname; #define DEFAULT_ROOTID -2 @@ -763,7 +764,7 @@ linux_mount(struct thread *td, struct linux_mount_args *args) ufs.export.ex_flags = args->rwflag & LINUX_MS_RDONLY ? MNT_EXRDONLY : 0; } else if (strcmp(fstypename, "proc") == 0) { - fstype = "linprocfs"; + strcpy(fstypename, "linprocfs"); fsdata = NULL; } else { return (ENODEV); @@ -788,7 +789,23 @@ linux_mount(struct thread *td, struct linux_mount_args *args) fsflags |= MNT_UPDATE; } - return (vfs_mount(td, fstype, mntonname, fsflags, fsdata)); + if (strcmp(fstypename, "linprocfs") == 0) { + bzero(&auio, sizeof(auio)); + auio.uio_iov = iov; + auio.uio_iovcnt = sizeof(iov) / sizeof(*iov); + auio.uio_segflg = UIO_SYSSPACE; + iov[0].iov_base = "fstype"; + iov[0].iov_len = sizeof("fstype"); + iov[1].iov_base = fstypename; + iov[1].iov_len = strlen(fstypename) + 1; + iov[2].iov_base = "fspath"; + iov[2].iov_len = sizeof("fspath"); + iov[3].iov_base = mntonname; + iov[3].iov_len = strlen(mntonname) + 1; + error = vfs_nmount(td, fsflags, &auio); + } else + error = vfs_mount(td, fstypename, mntonname, fsflags, fsdata); + return (error); } int |