Module Name:    src
Committed By:   christos
Date:           Sun Oct  5 20:17:28 UTC 2014

Modified Files:
        src/sys/compat/netbsd32: netbsd32.h netbsd32_fs.c

Log Message:
add tmpfs.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.71 -r1.72 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.102 src/sys/compat/netbsd32/netbsd32.h:1.103
--- src/sys/compat/netbsd32/netbsd32.h:1.102	Sat Jun 28 18:27:50 2014
+++ src/sys/compat/netbsd32/netbsd32.h	Sun Oct  5 16:17:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.102 2014/06/28 22:27:50 dholland Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.103 2014/10/05 20:17:28 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -167,6 +167,7 @@ typedef netbsd32_intptr_t netbsd32_semid
 typedef netbsd32_pointer_t netbsd32_semidp_t;
 typedef netbsd32_uint64 netbsd32_dev_t;
 typedef netbsd32_int64 netbsd32_off_t;
+typedef netbsd32_uint64 netbsd32_ino_t;
 
 /* from <sys/uio.h> */
 typedef netbsd32_pointer_t netbsd32_iovecp_t;
@@ -909,6 +910,20 @@ struct netbsd32_kevent {
 typedef netbsd32_pointer_t netbsd32_sched_paramp_t;
 typedef netbsd32_pointer_t netbsd32_cpusetp_t;
 
+/* from <fs/tmpfs/tmpfs_args.h> */
+struct netbsd32_tmpfs_args {
+        int                     ta_version;
+
+        /* Size counters. */
+        netbsd32_ino_t          ta_nodes_max;
+        netbsd32_off_t          ta_size_max;
+
+        /* Root node attributes. */
+        uid_t                   ta_root_uid;
+        gid_t                   ta_root_gid;
+        mode_t                  ta_root_mode;
+};
+
 /* from <fs/cd9660/cd9660_mount.h> */
 struct netbsd32_iso_args {
 	netbsd32_charp fspec;

Index: src/sys/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.71 src/sys/compat/netbsd32/netbsd32_fs.c:1.72
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.71	Fri Sep  5 05:21:54 2014
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Sun Oct  5 16:17:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.71 2014/09/05 09:21:54 matt Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.72 2014/10/05 20:17:28 christos 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.71 2014/09/05 09:21:54 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.72 2014/10/05 20:17:28 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.
 #include <sys/vfs_syscalls.h>
 
 #include <fs/cd9660/cd9660_mount.h>
+#include <fs/tmpfs/tmpfs_args.h>
 #include <fs/msdosfs/bpb.h>
 #include <fs/msdosfs/msdosfsmount.h>
 #include <ufs/ufs/ufsmount.h>
@@ -799,6 +800,7 @@ netbsd32___mount50(struct lwp *l, const 
 		struct netbsd32_iso_args iso_args;
 		struct netbsd32_nfs_args nfs_args;
 		struct netbsd32_msdosfs_args msdosfs_args;
+		struct netbsd32_tmpfs_args tmpfs_args;
 	} fs_args32;
 	union {
 		struct ufs_args ufs_args;
@@ -806,6 +808,7 @@ netbsd32___mount50(struct lwp *l, const 
 		struct iso_args iso_args;
 		struct nfs_args nfs_args;
 		struct msdosfs_args msdosfs_args;
+		struct tmpfs_args tmpfs_args;
 	} fs_args;
 	const char *type = SCARG_P32(uap, type);
 	const char *path = SCARG_P32(uap, path);
@@ -819,7 +822,31 @@ netbsd32___mount50(struct lwp *l, const 
 	error = copyinstr(type, mtype, sizeof(mtype), &len);
 	if (error)
 		return error;
-	if (strcmp(mtype, MOUNT_MFS) == 0) {
+	if (strcmp(mtype, MOUNT_TMPFS) == 0) {
+		if (data_len != sizeof(fs_args32.tmpfs_args))
+			return EINVAL;
+		if ((flags & MNT_GETARGS) == 0) {
+			error = copyin(data, &fs_args32.tmpfs_args, 
+			    sizeof(fs_args32.tmpfs_args));
+			if (error)
+				return error;
+			fs_args.tmpfs_args.ta_version =
+			    fs_args32.tmpfs_args.ta_version;
+			fs_args.tmpfs_args.ta_nodes_max =
+			    fs_args32.tmpfs_args.ta_nodes_max;
+			fs_args.tmpfs_args.ta_size_max =
+			    fs_args32.tmpfs_args.ta_size_max;
+			fs_args.tmpfs_args.ta_root_uid =
+			    fs_args32.tmpfs_args.ta_root_uid;
+			fs_args.tmpfs_args.ta_root_gid =
+			    fs_args32.tmpfs_args.ta_root_gid;
+			fs_args.tmpfs_args.ta_root_mode =
+			    fs_args32.tmpfs_args.ta_root_mode;
+		}
+		data_seg = UIO_SYSSPACE;
+		data = &fs_args.tmpfs_args;
+		data_len = sizeof(fs_args.tmpfs_args);
+	} else if (strcmp(mtype, MOUNT_MFS) == 0) {
 		if (data_len != sizeof(fs_args32.mfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
@@ -937,7 +964,24 @@ netbsd32___mount50(struct lwp *l, const 
 		return error;
 	if (flags & MNT_GETARGS) {
 		data_len = *retval;
-		if (strcmp(mtype, MOUNT_MFS) == 0) {
+		if (strcmp(mtype, MOUNT_TMPFS) == 0) {
+			if (data_len != sizeof(fs_args.tmpfs_args))
+				return EINVAL;
+			fs_args32.tmpfs_args.ta_version =
+			    fs_args.tmpfs_args.ta_version;
+			fs_args32.tmpfs_args.ta_nodes_max =
+			    fs_args.tmpfs_args.ta_nodes_max;
+			fs_args32.tmpfs_args.ta_size_max =
+			    fs_args.tmpfs_args.ta_size_max;
+			fs_args32.tmpfs_args.ta_root_uid =
+			    fs_args.tmpfs_args.ta_root_uid;
+			fs_args32.tmpfs_args.ta_root_gid =
+			    fs_args.tmpfs_args.ta_root_gid;
+			fs_args32.tmpfs_args.ta_root_mode =
+			    fs_args.tmpfs_args.ta_root_mode;
+			error = copyout(&fs_args32.tmpfs_args, data,
+				    sizeof(fs_args32.tmpfs_args));
+		} else if (strcmp(mtype, MOUNT_MFS) == 0) {
 			if (data_len != sizeof(fs_args.mfs_args))
 				return EINVAL;
 			NETBSD32PTR32(fs_args32.mfs_args.fspec,

Reply via email to