Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/kernfs Add need-flags for kernfs.



details:   https://anonhg.NetBSD.org/src/rev/fda70b8190d7
branches:  trunk
changeset: 1010473:fda70b8190d7
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Tue May 26 10:37:24 2020 +0000

description:
Add need-flags for kernfs.
Compile Xen kernfs support only if kernfs is compiled in the kernel.
Should fix MODULAR build.

diffstat:

 sys/arch/xen/conf/files.xen        |  4 ++--
 sys/arch/xen/xen/hypervisor.c      |  7 +++++--
 sys/arch/xen/xen/privcmd.c         |  5 ++---
 sys/arch/xen/xenbus/xenbus_probe.c |  8 ++++++--
 sys/miscfs/kernfs/files.kernfs     |  4 ++--
 5 files changed, 17 insertions(+), 11 deletions(-)

diffs (134 lines):

diff -r df7a2e59e2ef -r fda70b8190d7 sys/arch/xen/conf/files.xen
--- a/sys/arch/xen/conf/files.xen       Tue May 26 10:36:20 2020 +0000
+++ b/sys/arch/xen/conf/files.xen       Tue May 26 10:37:24 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.xen,v 1.185 2020/05/05 17:02:01 bouyer Exp $
+#      $NetBSD: files.xen,v 1.186 2020/05/26 10:37:24 bouyer Exp $
 
 defflag        opt_xen.h                       XEN XENPVH XENPVHVM PAE DOM0OPS
 
@@ -27,7 +27,7 @@
 attach xenbus at xendevbus
 file arch/xen/xenbus/xenbus_client.c xenbus needs-flag
 file arch/xen/xenbus/xenbus_comms.c xenbus needs-flag
-file arch/xen/xenbus/xenbus_dev.c xenbus needs-flag
+file arch/xen/xenbus/xenbus_dev.c xenbus & kernfs
 file arch/xen/xenbus/xenbus_probe.c xenbus needs-flag
 file arch/xen/xenbus/xenbus_xs.c xenbus needs-flag
 
diff -r df7a2e59e2ef -r fda70b8190d7 sys/arch/xen/xen/hypervisor.c
--- a/sys/arch/xen/xen/hypervisor.c     Tue May 26 10:36:20 2020 +0000
+++ b/sys/arch/xen/xen/hypervisor.c     Tue May 26 10:37:24 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.85 2020/05/21 21:12:31 ad Exp $ */
+/* $NetBSD: hypervisor.c,v 1.86 2020/05/26 10:37:25 bouyer Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.85 2020/05/21 21:12:31 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.86 2020/05/26 10:37:25 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -65,6 +65,7 @@
 #include "isa.h"
 #include "pci.h"
 #include "acpica.h"
+#include "kernfs.h"
 
 #include "opt_xen.h"
 #include "opt_mpbios.h"
@@ -778,10 +779,12 @@
 void
 xenkernfs_init(void)
 {
+#if NKERNFS > 0
        kernfs_entry_t *dkt;
 
        KERNFS_ALLOCENTRY(dkt, KM_SLEEP);
        KERNFS_INITENTRY(dkt, DT_DIR, "xen", NULL, KFSsubdir, VDIR, DIR_MODE);
        kernfs_addentry(NULL, dkt);
        kernxen_pkt = KERNFS_ENTOPARENTDIR(dkt);
+#endif
 }
diff -r df7a2e59e2ef -r fda70b8190d7 sys/arch/xen/xen/privcmd.c
--- a/sys/arch/xen/xen/privcmd.c        Tue May 26 10:36:20 2020 +0000
+++ b/sys/arch/xen/xen/privcmd.c        Tue May 26 10:37:24 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: privcmd.c,v 1.58 2020/05/26 10:11:56 bouyer Exp $ */
+/* $NetBSD: privcmd.c,v 1.59 2020/05/26 10:37:25 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2004 Christian Limpach.
@@ -27,7 +27,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.58 2020/05/26 10:11:56 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.59 2020/05/26 10:37:25 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -782,7 +782,6 @@
        case IOCTL_PRIVCMD_MMAPBATCH_V2:
                return privcmd_mmapbatch_v2(ap);
 
-
        case IOCTL_PRIVCMD_MMAP_RESOURCE:
                return privcmd_mmap_resource(ap);
 
diff -r df7a2e59e2ef -r fda70b8190d7 sys/arch/xen/xenbus/xenbus_probe.c
--- a/sys/arch/xen/xenbus/xenbus_probe.c        Tue May 26 10:36:20 2020 +0000
+++ b/sys/arch/xen/xenbus/xenbus_probe.c        Tue May 26 10:37:24 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_probe.c,v 1.54 2020/05/14 13:18:55 jdolecek Exp $ */
+/* $NetBSD: xenbus_probe.c,v 1.55 2020/05/26 10:37:25 bouyer Exp $ */
 /******************************************************************************
  * Talks to Xen Store to figure out what devices we have.
  *
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.54 2020/05/14 13:18:55 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.55 2020/05/26 10:37:25 bouyer Exp $");
 
 #if 0
 #define DPRINTK(fmt, args...) \
@@ -56,6 +56,8 @@
 
 #include "xenbus_comms.h"
 
+#include "kernfs.h"
+
 static int  xenbus_match(device_t, cfdata_t, void *);
 static void xenbus_attach(device_t, device_t, void *);
 static int  xenbus_print(void *, const char *);
@@ -719,8 +721,10 @@
 #endif /* DOM0OPS */
        }
 
+#if NKERNFS > 0
        /* Publish xenbus and Xenstore info in /kern/xen */
        xenbus_kernfs_init();
+#endif
 
        /* register event handler */
        xb_init_comms(xenbus_dev);
diff -r df7a2e59e2ef -r fda70b8190d7 sys/miscfs/kernfs/files.kernfs
--- a/sys/miscfs/kernfs/files.kernfs    Tue May 26 10:36:20 2020 +0000
+++ b/sys/miscfs/kernfs/files.kernfs    Tue May 26 10:37:24 2020 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: files.kernfs,v 1.6 2014/10/11 06:42:20 uebayasi Exp $
+#      $NetBSD: files.kernfs,v 1.7 2020/05/26 10:37:25 bouyer Exp $
 
 deffs                                  KERNFS
 
 define kernfs: vfs
 file   miscfs/kernfs/kernfs_vfsops.c   kernfs
-file   miscfs/kernfs/kernfs_vnops.c    kernfs
+file   miscfs/kernfs/kernfs_vnops.c    kernfs needs-flag



Home | Main Index | Thread Index | Old Index