From 8e84b7eda7d0fdf6a893d6c20d55e317d0677019 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 10 May 2008 22:56:37 +0000 Subject: [PATCH] HAMMER Utilities: scan feedback * Add support for and report the number of records scanned by the pruning code --- sbin/hammer/cmd_prune.c | 6 ++++-- sys/vfs/hammer/hammer_ioctl.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sbin/hammer/cmd_prune.c b/sbin/hammer/cmd_prune.c index 8e82ca50e0..bf05abd927 100644 --- a/sbin/hammer/cmd_prune.c +++ b/sbin/hammer/cmd_prune.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sbin/hammer/Attic/cmd_prune.c,v 1.7 2008/05/10 17:54:59 dillon Exp $ + * $DragonFly: src/sbin/hammer/Attic/cmd_prune.c,v 1.8 2008/05/10 22:56:37 dillon Exp $ */ #include "hammer.h" @@ -111,8 +111,10 @@ hammer_cmd_prune(char **av, int ac) close(fd); if (LinkPath) hammer_prune_create_links(filesystem, &prune); - printf("Pruned %lld records (%lld directory entries) and %lld bytes\n", + printf("Pruned %lld/%lld records (%lld directory entries) " + "and %lld bytes\n", prune.stat_rawrecords, + prune.stat_scanrecords, prune.stat_dirrecords, prune.stat_bytes ); diff --git a/sys/vfs/hammer/hammer_ioctl.c b/sys/vfs/hammer/hammer_ioctl.c index 3d4c082603..9fc9353838 100644 --- a/sys/vfs/hammer/hammer_ioctl.c +++ b/sys/vfs/hammer/hammer_ioctl.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/vfs/hammer/hammer_ioctl.c,v 1.13 2008/05/10 20:07:14 dillon Exp $ + * $DragonFly: src/sys/vfs/hammer/hammer_ioctl.c,v 1.14 2008/05/10 22:56:36 dillon Exp $ */ #include "hammer.h" @@ -188,6 +188,7 @@ retry: elm->base.obj_id, elm->base.key); } } + ++prune->stat_scanrecords; /* * Bad hack for now, don't blow out the kernel's buffer -- 2.11.4.GIT