Author: trasz Date: Sat Apr 18 09:49:09 2015 New Revision: 281689 URL: https://svnweb.freebsd.org/changeset/base/281689
Log: Remove unused code from linux_mount(), and make it possible to mount any kind of filesystem instead of harcoded three. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sat Apr 18 09:08:47 2015 (r281688) +++ head/sys/compat/linux/linux_file.c Sat Apr 18 09:49:09 2015 (r281689) @@ -55,10 +55,6 @@ __FBSDID("$FreeBSD$"); #include <security/mac/mac_framework.h> -#include <ufs/ufs/extattr.h> -#include <ufs/ufs/quota.h> -#include <ufs/ufs/ufsmount.h> - #ifdef COMPAT_LINUX32 #include <machine/../linux32/linux.h> #include <machine/../linux32/linux32_proto.h> @@ -1078,12 +1074,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); @@ -1104,20 +1098,10 @@ linux_mount(struct thread *td, struct li 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; @@ -1137,19 +1121,11 @@ linux_mount(struct thread *td, struct li 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); } _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"