Module Name:    src
Committed By:   martin
Date:           Sat Aug 25 11:13:06 UTC 2018

Modified Files:
        src/sys/compat/netbsd32 [netbsd-8]: netbsd32.h netbsd32_fs.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #977):

        sys/compat/netbsd32/netbsd32_fs.c: revision 1.81
        sys/compat/netbsd32/netbsd32.h: revision 1.119

support nullfs in netbsd32.


To generate a diff of this commit:
cvs rdiff -u -r1.114.8.2 -r1.114.8.3 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.80 -r1.80.2.1 src/sys/compat/netbsd32/netbsd32_fs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.114.8.2 src/sys/compat/netbsd32/netbsd32.h:1.114.8.3
--- src/sys/compat/netbsd32/netbsd32.h:1.114.8.2	Sat Apr 14 03:04:06 2018
+++ src/sys/compat/netbsd32/netbsd32.h	Sat Aug 25 11:13:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.114.8.2 2018/04/14 03:04:06 snj Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.114.8.3 2018/08/25 11:13:05 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -958,7 +958,7 @@ struct netbsd32_tmpfs_args {
 /* from <fs/cd9660/cd9660_mount.h> */
 struct netbsd32_iso_args {
 	netbsd32_charp fspec;
-	struct export_args30 _pad1;
+	struct netbsd32_export_args30 _pad1;
 	int	flags;
 };
 
@@ -1014,8 +1014,6 @@ struct netbsd32_mountd_exports_list {
 	netbsd32_export_argsp	mel_exports;
 };
 
-/* no struct export_args30 yet */
-
 /* from <nfs/nfsmount,h> */
 struct netbsd32_nfs_args {
 	int32_t		version;	/* args structure version number */
@@ -1053,6 +1051,17 @@ struct netbsd32_msdosfs_args {
 	int	gmtoff;		/* v3: offset from UTC in seconds */
 };
 
+/* from <miscfs/genfs/layer.h> */
+struct netbsd32_layer_args {
+	netbsd32_charp target;		/* Target of loopback  */
+	struct netbsd32_export_args30 _pad1; /* compat with old userland tools */
+};
+
+/* from <miscfs/nullfs/null.h> */
+struct netbsd32_null_args {
+	struct	netbsd32_layer_args	la;	/* generic layerfs args */
+};
+
 struct netbsd32_posix_spawn_file_actions_entry {
 	enum { FAE32_OPEN, FAE32_DUP2, FAE32_CLOSE } fae_action;
 

Index: src/sys/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.80 src/sys/compat/netbsd32/netbsd32_fs.c:1.80.2.1
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.80	Thu Jun  1 02:45:08 2017
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Sat Aug 25 11:13:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.80 2017/06/01 02:45:08 chs Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.80.2.1 2018/08/25 11:13:05 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.80 2017/06/01 02:45:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.80.2.1 2018/08/25 11:13:05 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.
 #include <fs/msdosfs/bpb.h>
 #include <fs/msdosfs/msdosfsmount.h>
 #include <ufs/ufs/ufsmount.h>
+#include <miscfs/nullfs/null.h>
 
 #define NFS_ARGS_ONLY
 #include <nfs/nfsmount.h>
@@ -799,6 +800,7 @@ netbsd32___mount50(struct lwp *l, const 
 		struct netbsd32_nfs_args nfs_args;
 		struct netbsd32_msdosfs_args msdosfs_args;
 		struct netbsd32_tmpfs_args tmpfs_args;
+		struct netbsd32_null_args null_args;
 	} fs_args32;
 	union {
 		struct ufs_args ufs_args;
@@ -807,6 +809,7 @@ netbsd32___mount50(struct lwp *l, const 
 		struct nfs_args nfs_args;
 		struct msdosfs_args msdosfs_args;
 		struct tmpfs_args tmpfs_args;
+		struct null_args null_args;
 	} fs_args;
 	const char *type = SCARG_P32(uap, type);
 	const char *path = SCARG_P32(uap, path);
@@ -953,6 +956,20 @@ netbsd32___mount50(struct lwp *l, const 
 		data_seg = UIO_SYSSPACE;
 		data = &fs_args.nfs_args;
 		data_len = sizeof(fs_args.nfs_args);
+	} else if (strcmp(mtype, MOUNT_NULL) == 0) {
+		if (data_len > sizeof(fs_args32.null_args))
+			return EINVAL;
+		if ((flags & MNT_GETARGS) == 0) {
+			error = copyin(data, &fs_args32.null_args, 
+			    sizeof(fs_args32.null_args));
+			if (error)
+				return error;
+			fs_args.null_args.la.target =
+			    NETBSD32PTR64(fs_args32.null_args.la.target);
+		}
+		data_seg = UIO_SYSSPACE;
+		data = &fs_args.null_args;
+		data_len = sizeof(fs_args.null_args);
 	} else {
 		data_seg = UIO_USERSPACE;
 	}
@@ -1032,6 +1049,13 @@ netbsd32___mount50(struct lwp *l, const 
 			    fs_args.nfs_args.hostname);
 			error = copyout(&fs_args32.nfs_args, data,
 			    sizeof(fs_args32.nfs_args));
+		} else if (strcmp(mtype, MOUNT_NULL) == 0) {
+			if (data_len != sizeof(fs_args.null_args))
+				return EINVAL;
+			NETBSD32PTR32(fs_args32.null_args.la.target,
+			    fs_args.null_args.la.target);
+			error = copyout(&fs_args32.null_args, data, 
+			    sizeof(fs_args32.null_args));
 		}
 	}
 	return error;

Reply via email to