Module Name:    src
Committed By:   riastradh
Date:           Sat Jul 29 08:46:47 UTC 2023

Modified Files:
        src/sys/kern: sys_memfd.c
        src/usr.bin/fstat: misc.c
Added Files:
        src/sys/sys: memfd.h
Removed Files:
        src/sys/sys: miscfd.h

Log Message:
sys: Rename sys/miscfd.h -> sys/memfd.h.

Let's not create new dumping grounds for miscellaneous stuff; one
header file for one purpose.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/kern/sys_memfd.c
cvs rdiff -u -r0 -r1.1 src/sys/sys/memfd.h
cvs rdiff -u -r1.1 -r0 src/sys/sys/miscfd.h
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/fstat/misc.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/kern/sys_memfd.c
diff -u src/sys/kern/sys_memfd.c:1.3 src/sys/kern/sys_memfd.c:1.4
--- src/sys/kern/sys_memfd.c:1.3	Sat Jul 29 08:46:27 2023
+++ src/sys/kern/sys_memfd.c	Sat Jul 29 08:46:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_memfd.c,v 1.3 2023/07/29 08:46:27 riastradh Exp $	*/
+/*	$NetBSD: sys_memfd.c,v 1.4 2023/07/29 08:46:47 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,15 +30,16 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_memfd.c,v 1.3 2023/07/29 08:46:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_memfd.c,v 1.4 2023/07/29 08:46:47 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
+
 #include <sys/fcntl.h>
 #include <sys/file.h>
 #include <sys/filedesc.h>
+#include <sys/memfd.h>
 #include <sys/mman.h>
-#include <sys/miscfd.h>
 #include <sys/syscallargs.h>
 
 #include <uvm/uvm_extern.h>

Index: src/usr.bin/fstat/misc.c
diff -u src/usr.bin/fstat/misc.c:1.26 src/usr.bin/fstat/misc.c:1.27
--- src/usr.bin/fstat/misc.c:1.26	Mon Jul 10 15:49:19 2023
+++ src/usr.bin/fstat/misc.c	Sat Jul 29 08:46:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.26 2023/07/10 15:49:19 christos Exp $	*/
+/*	$NetBSD: misc.c,v 1.27 2023/07/29 08:46:47 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: misc.c,v 1.26 2023/07/10 15:49:19 christos Exp $");
+__RCSID("$NetBSD: misc.c,v 1.27 2023/07/29 08:46:47 riastradh Exp $");
 
 #include <stdbool.h>
 #include <sys/param.h>
@@ -56,7 +56,7 @@ __RCSID("$NetBSD: misc.c,v 1.26 2023/07/
 #undef _KERNEL
 #include <sys/cprng.h>
 #include <sys/vnode.h>
-#include <sys/miscfd.h>
+#include <sys/memfd.h>
 #include <sys/mount.h>
 
 #include <net/bpfdesc.h>

Added files:

Index: src/sys/sys/memfd.h
diff -u /dev/null src/sys/sys/memfd.h:1.1
--- /dev/null	Sat Jul 29 08:46:47 2023
+++ src/sys/sys/memfd.h	Sat Jul 29 08:46:47 2023
@@ -0,0 +1,47 @@
+/*	$NetBSD: memfd.h,v 1.1 2023/07/29 08:46:47 riastradh Exp $	*/
+
+/*-
+ * Copyright (c) 2023 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _SYS_MISCFD_H_
+#define _SYS_MISCFD_H_
+
+#include <sys/syslimits.h>	/* for NAME_MAX */
+#include <sys/timespec.h>	/* for struct timespec */
+#include <sys/mutex.h>		/* for kmutex_t */
+
+struct memfd {
+	char			mfd_name[NAME_MAX+1];
+	struct uvm_object	*mfd_uobj;
+	size_t			mfd_size;
+	int			mfd_seals;
+	kmutex_t		mfd_lock;	/* for truncate */
+
+	struct timespec		mfd_btime;
+	struct timespec		mfd_atime;
+	struct timespec		mfd_mtime;
+};
+
+#endif /* _SYS_MISCFD_H_ */

Reply via email to