Author: trasz
Date: Sun Oct 18 13:58:17 2015
New Revision: 289504
URL: https://svnweb.freebsd.org/changeset/base/289504

Log:
  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

Modified:
  stable/10/sys/compat/linux/linux_file.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linux/linux_file.c
==============================================================================
--- stable/10/sys/compat/linux/linux_file.c     Sun Oct 18 13:52:53 2015        
(r289503)
+++ stable/10/sys/compat/linux/linux_file.c     Sun Oct 18 13:58:17 2015        
(r289504)
@@ -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>
@@ -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 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;
@@ -1131,19 +1115,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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to