From 126bb89545fc96d2f8ce88ada037519eda506c3d Mon Sep 17 00:00:00 2001 From: hannken Date: Wed, 22 Jul 2015 08:36:05 +0000 Subject: [PATCH] rump_vfs_mount_print: use vfs_vnode_iterator to print attached vnodes. --- sys/rump/librump/rumpvfs/rump_vfs.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/rump/librump/rumpvfs/rump_vfs.c b/sys/rump/librump/rumpvfs/rump_vfs.c index beeefde20d1e..458d1f9cc7ed 100644 --- a/sys/rump/librump/rumpvfs/rump_vfs.c +++ b/sys/rump/librump/rumpvfs/rump_vfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: rump_vfs.c,v 1.82 2015/05/06 15:57:08 hannken Exp $ */ +/* $NetBSD: rump_vfs.c,v 1.83 2015/07/22 08:36:05 hannken Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.82 2015/05/06 15:57:08 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.83 2015/07/22 08:36:05 hannken Exp $"); #include #include @@ -468,12 +468,21 @@ rump_vfs_syncwait(struct mount *mp) /* * Dump info about mount point. No locking. */ +static bool +rump_print_selector(void *cl, struct vnode *vp) +{ + int *full = cl; + + vfs_vnode_print(vp, *full, (void *)rumpuser_dprintf); + return false; +} + void rump_vfs_mount_print(const char *path, int full) { #ifdef DEBUGPRINT struct vnode *mvp; - struct vnode *vp; + struct vnode_iterator *marker; int error; rumpuser_dprintf("\n==== dumping mountpoint at ``%s'' ====\n\n", path); @@ -484,9 +493,9 @@ rump_vfs_mount_print(const char *path, int full) 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); - } + vfs_vnode_iterator_init(mvp->v_mount, &marker); + vfs_vnode_iterator_next(marker, rump_print_selector, &full); + vfs_vnode_iterator_destroy(marker); } vrele(mvp); rumpuser_dprintf("\n==== done ====\n\n");