From 1efdf8670c6e6ca137ac88a10d4e6caee810f609 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Mar 2011 14:20:25 -0800 Subject: [PATCH] Reduce verbosity of debugging of disk cache contents --- bluesky/cache.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/bluesky/cache.c b/bluesky/cache.c index 7327e68..16e3d81 100644 --- a/bluesky/cache.c +++ b/bluesky/cache.c @@ -328,12 +328,14 @@ void bluesky_cachefile_gc(BlueSkyFS *fs) * then we'll just skip the file on this pass. */ if (g_mutex_trylock(cachefile->lock)) { int64_t age = bluesky_get_current_time() - cachefile->atime; - g_print("%s addr=%p mapcount=%d refcount=%d size=%d atime_age=%f", - cachefile->filename, cachefile->addr, cachefile->mapcount, - cachefile->refcount, cachefile->disk_used, age / 1e6); - if (cachefile->fetching) - g_print(" (fetching)"); - g_print("\n"); + if (bluesky_verbose) { + g_print("%s addr=%p mapcount=%d refcount=%d size=%d atime_age=%f", + cachefile->filename, cachefile->addr, cachefile->mapcount, + cachefile->refcount, cachefile->disk_used, age / 1e6); + if (cachefile->fetching) + g_print(" (fetching)"); + g_print("\n"); + } gboolean deletion_candidate = FALSE; if (g_atomic_int_get(&fs->log->disk_used) @@ -353,7 +355,9 @@ void bluesky_cachefile_gc(BlueSkyFS *fs) } if (deletion_candidate) { - g_print(" ...deleting\n"); + if (bluesky_verbose) { + g_print(" ...deleting\n"); + } if (unlinkat(fs->log->dirfd, cachefile->filename, 0) < 0) { fprintf(stderr, "Unable to unlink journal %s: %m\n", cachefile->filename); -- 2.20.1