From 1025735d6490984a04a96ee816a15b6f5fb34af1 Mon Sep 17 00:00:00 2001 From: trasz Date: Sun, 18 Oct 2015 13:58:17 +0000 Subject: [PATCH] MFC r281689: Remove unused code from linux_mount(), and make it possible to mount any kind of filesystem instead of harcoded three. Sponsored by: The FreeBSD Foundation git-svn-id: svn://svn.freebsd.org/base/stable/10@289504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/compat/linux/linux_file.c | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index e56e61f24..3076eece5 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -55,10 +55,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include - #ifdef COMPAT_LINUX32 #include #include @@ -1072,12 +1068,10 @@ linux_pwrite(td, uap) int linux_mount(struct thread *td, struct linux_mount_args *args) { - struct ufs_args ufs; char fstypename[MFSNAMELEN]; char mntonname[MNAMELEN], mntfromname[MNAMELEN]; int error; int fsflags; - void *fsdata; error = copyinstr(args->filesystemtype, fstypename, MFSNAMELEN - 1, NULL); @@ -1098,20 +1092,10 @@ linux_mount(struct thread *td, struct linux_mount_args *args) if (strcmp(fstypename, "ext2") == 0) { strcpy(fstypename, "ext2fs"); - fsdata = &ufs; - ufs.fspec = mntfromname; -#define DEFAULT_ROOTID -2 - ufs.export.ex_root = DEFAULT_ROOTID; - ufs.export.ex_flags = - args->rwflag & LINUX_MS_RDONLY ? MNT_EXRDONLY : 0; } else if (strcmp(fstypename, "proc") == 0) { strcpy(fstypename, "linprocfs"); - fsdata = NULL; } else if (strcmp(fstypename, "vfat") == 0) { strcpy(fstypename, "msdosfs"); - fsdata = NULL; - } else { - return (ENODEV); } fsflags = 0; @@ -1131,19 +1115,11 @@ linux_mount(struct thread *td, struct linux_mount_args *args) fsflags |= MNT_UPDATE; } - if (strcmp(fstypename, "linprocfs") == 0) { - error = kernel_vmount(fsflags, - "fstype", fstypename, - "fspath", mntonname, - NULL); - } else if (strcmp(fstypename, "msdosfs") == 0) { - error = kernel_vmount(fsflags, - "fstype", fstypename, - "fspath", mntonname, - "from", mntfromname, - NULL); - } else - error = EOPNOTSUPP; + error = kernel_vmount(fsflags, + "fstype", fstypename, + "fspath", mntonname, + "from", mntfromname, + NULL); return (error); } -- 2.45.0