Module Name: src
Committed By: pooka
Date: Wed May 26 21:50:56 UTC 2010
Modified Files:
src/sys/rump/librump/rumpvfs: rump_vfs.c rumpvfs.ifspec
Log Message:
Add public namespace helper routine for dumping info on mountpoints.
To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/rump/librump/rumpvfs/rump_vfs.c
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/librump/rumpvfs/rumpvfs.ifspec
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/rumpvfs/rump_vfs.c
diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.51 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.52
--- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.51 Thu May 20 15:46:47 2010
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c Wed May 26 21:50:56 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_vfs.c,v 1.51 2010/05/20 15:46:47 pooka Exp $ */
+/* $NetBSD: rump_vfs.c,v 1.52 2010/05/26 21:50:56 pooka Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.51 2010/05/20 15:46:47 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.52 2010/05/26 21:50:56 pooka Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -430,6 +430,36 @@
printf("syncwait: unsynced buffers: %d\n", n);
}
+/*
+ * Dump info about mount point. No locking.
+ */
+void
+rump_vfs_mount_print(const char *path, int full)
+{
+#ifdef DEBUGPRINT
+ struct vnode *mvp;
+ struct vnode *vp;
+ int error;
+
+ rumpuser_dprintf("\n==== dumping mountpoint at ``%s'' ====\n\n", path);
+ if ((error = namei_simple_user(path, NSM_FOLLOW_NOEMULROOT, &mvp))!=0) {
+ rumpuser_dprintf("==== lookup error %d ====\n\n", error);
+ return;
+ }
+ vfs_mount_print(mvp->v_mount, full, (void *)rumpuser_dprintf);
+ if (full) {
+ rumpuser_dprintf("\n== dumping vnodes ==\n\n");
+ TAILQ_FOREACH(vp, &mvp->v_mount->mnt_vnodelist, v_mntvnodes) {
+ vfs_vnode_print(vp, full, (void *)rumpuser_dprintf);
+ }
+ }
+ vrele(mvp);
+ rumpuser_dprintf("\n==== done ====\n\n");
+#else
+ rumpuser_dprintf("mount dump not supported without DEBUGPRINT\n");
+#endif
+}
+
void
rump_biodone(void *arg, size_t count, int error)
{
Index: src/sys/rump/librump/rumpvfs/rumpvfs.ifspec
diff -u src/sys/rump/librump/rumpvfs/rumpvfs.ifspec:1.3 src/sys/rump/librump/rumpvfs/rumpvfs.ifspec:1.4
--- src/sys/rump/librump/rumpvfs/rumpvfs.ifspec:1.3 Thu May 20 15:46:47 2010
+++ src/sys/rump/librump/rumpvfs/rumpvfs.ifspec Wed May 26 21:50:56 2010
@@ -1,4 +1,4 @@
-; $NetBSD: rumpvfs.ifspec,v 1.3 2010/05/20 15:46:47 pooka Exp $
+; $NetBSD: rumpvfs.ifspec,v 1.4 2010/05/26 21:50:56 pooka Exp $
NAME|vfs
PUBHDR|include/rump/rumpvfs_if_pub.h
@@ -51,6 +51,8 @@
void |vfs_syncwait |struct mount *
int |vfs_getmp |const char *, struct mount **
+void |vfs_mount_print|const char *, int
+
void |rcvp_set |struct vnode *, struct vnode *
struct vnode * |cdir_get |void