From: root Date: Fri, 4 Mar 2011 22:20:25 +0000 (-0800) Subject: Reduce verbosity of debugging of disk cache contents X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=1efdf8670c6e6ca137ac88a10d4e6caee810f609;p=bluesky.git Reduce verbosity of debugging of disk cache contents --- 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);