aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_file.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-03-16 09:05:56 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-03-16 09:05:56 +0000
commit7b0d017245d110ee6fd8d06e8be535e51e5b2c2e (patch)
tree404fd197b2192781e5eb218c6684e76b7bd7aef4 /sys/compat/linux/linux_file.c
parent537370d0a437d2e2bf3640725761bc621a23eb86 (diff)
downloadsrc-7b0d017245d110ee6fd8d06e8be535e51e5b2c2e.tar.gz
src-7b0d017245d110ee6fd8d06e8be535e51e5b2c2e.zip
Use vfs_nmount() to mount linprocfs filesystems in linux_mount();
linprocfs doesn't support the old mount interface.
Notes
Notes: svn path=/head/; revision=127059
Diffstat (limited to 'sys/compat/linux/linux_file.c')
-rw-r--r--sys/compat/linux/linux_file.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 857c73d62bc8..ae5ad36568dc 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