packed-backend.c: reorder some definitions

No code has been changed. This will make subsequent patches more self-contained. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Sep 25, 2017 at 10:00 UTC 14b3c344ead04deb7ff9680cd8cf927f9f9ac12a
1 file changed +24 -24
refs/packed-backend.c
+24 -24
@@ -36,30 +36,6 @@ struct packed_ref_cache {
36 struct stat_validity validity;
37 };
38
39 -/*
40 - * Increment the reference count of *packed_refs.
41 - */
42 -static void acquire_packed_ref_cache(struct packed_ref_cache *packed_refs)
43 -{
44 - packed_refs->referrers++;
45 -}
46 -
47 -/*
48 - * Decrease the reference count of *packed_refs. If it goes to zero,
49 - * free *packed_refs and return true; otherwise return false.
50 - */
51 -static int release_packed_ref_cache(struct packed_ref_cache *packed_refs)
52 -{
53 - if (!--packed_refs->referrers) {
54 - free_ref_cache(packed_refs->cache);
55 - stat_validity_clear(&packed_refs->validity);
56 - free(packed_refs);
57 - return 1;
58 - } else {
59 - return 0;
60 - }
61 -}
62 -
39 /*
40 * A container for `packed-refs`-related data. It is not (yet) a
41 * `ref_store`.
@@ -92,6 +68,30 @@ struct packed_ref_store {
68 struct tempfile tempfile;
69 };
70
71 +/*
72 + * Increment the reference count of *packed_refs.
73 + */
74 +static void acquire_packed_ref_cache(struct packed_ref_cache *packed_refs)
75 +{
76 + packed_refs->referrers++;
77 +}
78 +
79 +/*
80 + * Decrease the reference count of *packed_refs. If it goes to zero,
81 + * free *packed_refs and return true; otherwise return false.
82 + */
83 +static int release_packed_ref_cache(struct packed_ref_cache *packed_refs)
84 +{
85 + if (!--packed_refs->referrers) {
86 + free_ref_cache(packed_refs->cache);
87 + stat_validity_clear(&packed_refs->validity);
88 + free(packed_refs);
89 + return 1;
90 + } else {
91 + return 0;
92 + }
93 +}
94 +
95 struct ref_store *packed_ref_store_create(const char *path,
96 unsigned int store_flags)
97 {