From c8ac56d594daafee9f61348a9d9bbd716f8a52c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 29 Jul 2013 23:28:50 +0200 Subject: [PATCH] Clarify difference between bundle and exposed dmg path in logging It's not the bundle that's opened by fuse, that's just our internal pointer back to where the data lives. As far as fuse is concerned the only file we have is sparsebundle.dmg, and that's the file that's opened and released. --- sparsebundlefs.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sparsebundlefs.cpp b/sparsebundlefs.cpp index feb9934..fd0becc 100644 --- a/sparsebundlefs.cpp +++ b/sparsebundlefs.cpp @@ -120,8 +120,8 @@ static int sparsebundle_open(const char *path, struct fuse_file_info *fi) sparsebundle_t *sparsebundle = sparsebundle_current(); sparsebundle->times_opened++; - syslog(LOG_DEBUG, "opened %s, now referenced %ju times", - sparsebundle->path, uintmax_t(sparsebundle->times_opened)); + syslog(LOG_DEBUG, "opened %s%s, now referenced %ju times", + sparsebundle->mountpoint, path, uintmax_t(sparsebundle->times_opened)); return 0; } @@ -362,13 +362,13 @@ static int sparsebundle_read_buf(const char *path, struct fuse_bufvec **bufp, } #endif -static int sparsebundle_release(const char * /* path */, struct fuse_file_info *) +static int sparsebundle_release(const char *path, struct fuse_file_info *) { sparsebundle_t *sparsebundle = sparsebundle_current(); sparsebundle->times_opened--; - syslog(LOG_DEBUG, "closed %s, now referenced %ju times", - sparsebundle->path, uintmax_t(sparsebundle->times_opened)); + syslog(LOG_DEBUG, "closed %s%s, now referenced %ju times", + sparsebundle->mountpoint, path, uintmax_t(sparsebundle->times_opened)); if (sparsebundle->times_opened == 0) { syslog(LOG_DEBUG, "no more references, cleaning up"); @@ -464,6 +464,9 @@ int main(int argc, char **argv) if (!sparsebundle.path || !sparsebundle.mountpoint) return sparsebundle_show_usage(argv[0]); + syslog(LOG_DEBUG, "mounting `%s' at mount-point `%s'", + sparsebundle.path, sparsebundle.mountpoint); + char *plist_path; if (asprintf(&plist_path, "%s/Info.plist", sparsebundle.path) == -1) sparsebundle_fatal_error("could not resolve Info.plist path"); @@ -493,8 +496,8 @@ int main(int argc, char **argv) } } - syslog(LOG_DEBUG, "initialized %s, band size %ju, total size %ju", - sparsebundle.path, uintmax_t(sparsebundle.band_size), uintmax_t(sparsebundle.size)); + syslog(LOG_DEBUG, "bundle has band size %ju and total size %ju", + uintmax_t(sparsebundle.band_size), uintmax_t(sparsebundle.size)); struct fuse_operations sparsebundle_filesystem_operations = {}; sparsebundle_filesystem_operations.getattr = sparsebundle_getattr;