OSDN Git Service

pack: move unuse_pack()
authorJonathan Tan <jonathantanmy@google.com>
Fri, 18 Aug 2017 22:20:23 +0000 (15:20 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Aug 2017 22:12:07 +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 2e02b02..52deb9f 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1639,7 +1639,6 @@ extern int odb_mkstemp(struct strbuf *template, const char *pattern);
  */
 extern int odb_pack_keep(const char *name);
 
-extern void unuse_pack(struct pack_window **);
 extern void clear_delta_base_cache(void);
 extern struct packed_git *add_packed_git(const char *path, size_t path_len, int local);
 
index 85cb655..93526ea 100644 (file)
@@ -596,3 +596,12 @@ unsigned char *use_pack(struct packed_git *p,
                *left = win->len - xsize_t(offset);
        return win->base + offset;
 }
+
+void unuse_pack(struct pack_window **w_cursor)
+{
+       struct pack_window *w = *w_cursor;
+       if (w) {
+               w->inuse_cnt--;
+               *w_cursor = NULL;
+       }
+}
index e0596bb..c669c11 100644 (file)
@@ -45,6 +45,7 @@ extern void close_pack_index(struct packed_git *);
 extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
 extern void close_pack_windows(struct packed_git *);
 extern void close_all_packs(void);
+extern void unuse_pack(struct pack_window **);
 
 extern void release_pack_memory(size_t);
 
index abd3b59..9df1bd7 100644 (file)
@@ -719,15 +719,6 @@ void *xmmap(void *start, size_t length,
        return ret;
 }
 
-void unuse_pack(struct pack_window **w_cursor)
-{
-       struct pack_window *w = *w_cursor;
-       if (w) {
-               w->inuse_cnt--;
-               *w_cursor = NULL;
-       }
-}
-
 static struct packed_git *alloc_packed_git(int extra)
 {
        struct packed_git *p = xmalloc(st_add(sizeof(*p), extra));