pack: move pack_report()
authorJonathan Tan <jonathantanmy@google.com>
Fri, 18 Aug 2017 22:20:18 +0000 (15:20 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Aug 2017 22:12:06 +0000 (15:12 -0700)
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
packfile.c
packfile.h
sha1_file.c
diff --git a/cache.h b/cache.h
index dbc02ad81704fa07cbd60daa47044f00fd5d83c3..aaf825fb7bf8e5bdc7772395ac4a42122d7d0264 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1626,8 +1626,6 @@ unsigned long approximate_object_count(void);
 extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
                                         struct packed_git *packs);
 
-extern void pack_report(void);
-
 /*
  * Create a temporary file rooted in the object database directory, or
  * die on failure. The filename is taken from "pattern", which should have the
index 0f46e06175de7fcc7fa32ed11374a11ad2f15172..60d9fc3b036a7d7ab62c6adb01953f743ddceb6a 100644 (file)
@@ -35,3 +35,27 @@ struct packed_git *packed_git;
 
 static struct mru packed_git_mru_storage;
 struct mru *packed_git_mru = &packed_git_mru_storage;
+
+#define SZ_FMT PRIuMAX
+static inline uintmax_t sz_fmt(size_t s) { return s; }
+
+void pack_report(void)
+{
+       fprintf(stderr,
+               "pack_report: getpagesize()            = %10" SZ_FMT "\n"
+               "pack_report: core.packedGitWindowSize = %10" SZ_FMT "\n"
+               "pack_report: core.packedGitLimit      = %10" SZ_FMT "\n",
+               sz_fmt(getpagesize()),
+               sz_fmt(packed_git_window_size),
+               sz_fmt(packed_git_limit));
+       fprintf(stderr,
+               "pack_report: pack_used_ctr            = %10u\n"
+               "pack_report: pack_mmap_calls          = %10u\n"
+               "pack_report: pack_open_windows        = %10u / %10u\n"
+               "pack_report: pack_mapped              = "
+                       "%10" SZ_FMT " / %10" SZ_FMT "\n",
+               pack_used_ctr,
+               pack_mmap_calls,
+               pack_open_windows, peak_pack_open_windows,
+               sz_fmt(pack_mapped), sz_fmt(peak_pack_mapped));
+}
index a76bb7cec80c273a582d45e0885d53aa0e2ec72b..bfa94c8fee275a262908a08d0cfc16f72acb1b03 100644 (file)
@@ -33,4 +33,6 @@ extern unsigned int pack_max_fds;
 extern size_t peak_pack_mapped;
 extern size_t pack_mapped;
 
+extern void pack_report(void);
+
 #endif
index d0033b980e1e23bef9e0cc60159338c909603cd8..4895f45b51ca013054eec324fb0c14abe5781aa8 100644 (file)
@@ -30,9 +30,6 @@
 #include "quote.h"
 #include "packfile.h"
 
-#define SZ_FMT PRIuMAX
-static inline uintmax_t sz_fmt(size_t s) { return s; }
-
 const unsigned char null_sha1[20];
 const struct object_id null_oid;
 const struct object_id empty_tree_oid = {
@@ -684,27 +681,6 @@ static int has_loose_object(const unsigned char *sha1)
        return check_and_freshen(sha1, 0);
 }
 
-void pack_report(void)
-{
-       fprintf(stderr,
-               "pack_report: getpagesize()            = %10" SZ_FMT "\n"
-               "pack_report: core.packedGitWindowSize = %10" SZ_FMT "\n"
-               "pack_report: core.packedGitLimit      = %10" SZ_FMT "\n",
-               sz_fmt(getpagesize()),
-               sz_fmt(packed_git_window_size),
-               sz_fmt(packed_git_limit));
-       fprintf(stderr,
-               "pack_report: pack_used_ctr            = %10u\n"
-               "pack_report: pack_mmap_calls          = %10u\n"
-               "pack_report: pack_open_windows        = %10u / %10u\n"
-               "pack_report: pack_mapped              = "
-                       "%10" SZ_FMT " / %10" SZ_FMT "\n",
-               pack_used_ctr,
-               pack_mmap_calls,
-               pack_open_windows, peak_pack_open_windows,
-               sz_fmt(pack_mapped), sz_fmt(peak_pack_mapped));
-}
-
 /*
  * Open and mmap the index file at path, perform a couple of
  * consistency checks, then record its information to p.  Return 0 on