Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpkern Init function pointers to nullop()...



details:   https://anonhg.NetBSD.org/src/rev/bb8fdca6d8a0
branches:  trunk
changeset: 795703:bb8fdca6d8a0
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Apr 25 13:20:45 2014 +0000

description:
Init function pointers to nullop() so that callers don't need a dance

diffstat:

 sys/rump/librump/rumpkern/lwproc.c |  10 ++++------
 sys/rump/librump/rumpkern/rump.c   |  15 +++++++--------
 sys/rump/librump/rumpkern/vm.c     |   7 +++----
 3 files changed, 14 insertions(+), 18 deletions(-)

diffs (116 lines):

diff -r de6376444f98 -r bb8fdca6d8a0 sys/rump/librump/rumpkern/lwproc.c
--- a/sys/rump/librump/rumpkern/lwproc.c        Fri Apr 25 13:13:26 2014 +0000
+++ b/sys/rump/librump/rumpkern/lwproc.c        Fri Apr 25 13:20:45 2014 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: lwproc.c,v 1.30 2014/04/16 22:34:02 pooka Exp $       */
+/*      $NetBSD: lwproc.c,v 1.31 2014/04/25 13:20:45 pooka Exp $       */
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 #define RUMP__CURLWP_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lwproc.c,v 1.30 2014/04/16 22:34:02 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lwproc.c,v 1.31 2014/04/25 13:20:45 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -115,8 +115,7 @@
 
        cred = p->p_cred;
        chgproccnt(kauth_cred_getuid(cred), -1);
-       if (rump_proc_vfs_release)
-               rump_proc_vfs_release(p);
+       rump_proc_vfs_release(p);
 
        doexithooks(p);
        lim_free(p->p_limit);
@@ -216,8 +215,7 @@
        kauth_proc_fork(parent, p);
 
        /* initialize cwd in rump kernels with vfs */
-       if (rump_proc_vfs_init)
-               rump_proc_vfs_init(p);
+       rump_proc_vfs_init(p);
 
        chgproccnt(uid, 1); /* not enforced */
 
diff -r de6376444f98 -r bb8fdca6d8a0 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Fri Apr 25 13:13:26 2014 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Fri Apr 25 13:20:45 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.298 2014/04/25 13:13:26 pooka Exp $ */
+/*     $NetBSD: rump.c,v 1.299 2014/04/25 13:20:45 pooka Exp $ */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.298 2014/04/25 13:13:26 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.299 2014/04/25 13:20:45 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -129,8 +129,8 @@
 
 static int rump_inited;
 
-void (*rump_vfs_drainbufs)(int);
-void (*rump_vfs_fini)(void);
+void (*rump_vfs_drainbufs)(int) = (void *)nullop;
+void (*rump_vfs_fini)(void) = (void *)nullop;
 int  (*rump_vfs_makeonedevnode)(dev_t, const char *,
                                devmajor_t, devminor_t) = (void *)nullop;
 int  (*rump_vfs_makedevnodes)(dev_t, const char *, char,
@@ -142,8 +142,8 @@
 __weak_alias(biodone,rump__unavailable);
 __weak_alias(sopoll,rump__unavailable);
 
-rump_proc_vfs_init_fn rump_proc_vfs_init;
-rump_proc_vfs_release_fn rump_proc_vfs_release;
+rump_proc_vfs_init_fn rump_proc_vfs_init = (void *)nullop;
+rump_proc_vfs_release_fn rump_proc_vfs_release = (void *)nullop;
 
 static void add_linkedin_modules(const struct modinfo *const *, size_t);
 
@@ -569,8 +569,7 @@
 
        /* try to sync */
        if (!((howto & RB_NOSYNC) || panicstr)) {
-               if (rump_vfs_fini)
-                       rump_vfs_fini();
+               rump_vfs_fini();
        }
 
        doshutdownhooks();
diff -r de6376444f98 -r bb8fdca6d8a0 sys/rump/librump/rumpkern/vm.c
--- a/sys/rump/librump/rumpkern/vm.c    Fri Apr 25 13:13:26 2014 +0000
+++ b/sys/rump/librump/rumpkern/vm.c    Fri Apr 25 13:20:45 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm.c,v 1.155 2014/04/12 20:24:46 pooka Exp $   */
+/*     $NetBSD: vm.c,v 1.156 2014/04/25 13:20:45 pooka Exp $   */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.155 2014/04/12 20:24:46 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.156 2014/04/25 13:20:45 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -1124,8 +1124,7 @@
                 * And then drain the pools.  Wipe them out ... all of them.
                 */
                for (pp_first = NULL;;) {
-                       if (rump_vfs_drainbufs)
-                               rump_vfs_drainbufs(10 /* XXX: estimate! */);
+                       rump_vfs_drainbufs(10 /* XXX: estimate! */);
 
                        succ = pool_drain(&pp);
                        if (succ || pp == pp_first)



Home | Main Index | Thread Index | Old Index