Module Name: src
Committed By: pooka
Date: Fri Apr 25 13:20:45 UTC 2014
Modified Files:
src/sys/rump/librump/rumpkern: lwproc.c rump.c vm.c
Log Message:
Init function pointers to nullop() so that callers don't need a dance
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/rump/librump/rumpkern/lwproc.c
cvs rdiff -u -r1.298 -r1.299 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.155 -r1.156 src/sys/rump/librump/rumpkern/vm.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/rump/librump/rumpkern/lwproc.c
diff -u src/sys/rump/librump/rumpkern/lwproc.c:1.30 src/sys/rump/librump/rumpkern/lwproc.c:1.31
--- src/sys/rump/librump/rumpkern/lwproc.c:1.30 Wed Apr 16 22:34:02 2014
+++ src/sys/rump/librump/rumpkern/lwproc.c Fri Apr 25 13:20:45 2014
@@ -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 @@ lwproc_proc_free(struct proc *p)
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 @@ lwproc_newproc(struct proc *parent, int
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 */
Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.298 src/sys/rump/librump/rumpkern/rump.c:1.299
--- src/sys/rump/librump/rumpkern/rump.c:1.298 Fri Apr 25 13:13:26 2014
+++ src/sys/rump/librump/rumpkern/rump.c Fri Apr 25 13:20:45 2014
@@ -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 @@ rump_aiodone_worker(struct work *wk, voi
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 @@ int rump__unavailable() {return EOPNOTSU
__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 @@ cpu_reboot(int howto, char *bootstr)
/* try to sync */
if (!((howto & RB_NOSYNC) || panicstr)) {
- if (rump_vfs_fini)
- rump_vfs_fini();
+ rump_vfs_fini();
}
doshutdownhooks();
Index: src/sys/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.155 src/sys/rump/librump/rumpkern/vm.c:1.156
--- src/sys/rump/librump/rumpkern/vm.c:1.155 Sat Apr 12 20:24:46 2014
+++ src/sys/rump/librump/rumpkern/vm.c Fri Apr 25 13:20:45 2014
@@ -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 @@ uvm_pageout(void *arg)
* 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)