Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src sys: Rename sys/miscfd.h -> sys/memfd.h.



details:   https://anonhg.NetBSD.org/src/rev/4e137f8a0dbb
branches:  trunk
changeset: 378281:4e137f8a0dbb
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Jul 29 08:46:47 2023 +0000

description:
sys: Rename sys/miscfd.h -> sys/memfd.h.

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

diffstat:

 sys/kern/sys_memfd.c |   7 ++++---
 sys/sys/memfd.h      |  47 +++++++++++++++++++++++++++++++++++++++++++++++
 sys/sys/miscfd.h     |  47 -----------------------------------------------
 usr.bin/fstat/misc.c |   6 +++---
 4 files changed, 54 insertions(+), 53 deletions(-)

diffs (157 lines):

diff -r 86e0c8c56bfc -r 4e137f8a0dbb sys/kern/sys_memfd.c
--- a/sys/kern/sys_memfd.c      Sat Jul 29 08:46:27 2023 +0000
+++ b/sys/kern/sys_memfd.c      Sat Jul 29 08:46:47 2023 +0000
@@ -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>
diff -r 86e0c8c56bfc -r 4e137f8a0dbb sys/sys/memfd.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/sys/memfd.h   Sat Jul 29 08:46:47 2023 +0000
@@ -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_ */
diff -r 86e0c8c56bfc -r 4e137f8a0dbb sys/sys/miscfd.h
--- a/sys/sys/miscfd.h  Sat Jul 29 08:46:27 2023 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*     $NetBSD: miscfd.h,v 1.1 2023/07/10 15:49:19 christos 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_ */
diff -r 86e0c8c56bfc -r 4e137f8a0dbb usr.bin/fstat/misc.c
--- a/usr.bin/fstat/misc.c      Sat Jul 29 08:46:27 2023 +0000
+++ b/usr.bin/fstat/misc.c      Sat Jul 29 08:46:47 2023 +0000
@@ -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 @@
 #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>



Home | Main Index | Thread Index | Old Index