[PATCH v3 08/23] pack: move unuse_pack()
From: Jonathan Tan <hidden>
Date: 2017-08-18 22:21:06
Subsystem:
the rest · Maintainer:
Linus Torvalds
Signed-off-by: Jonathan Tan <redacted> --- cache.h | 1 - packfile.c | 9 +++++++++ packfile.h | 1 + sha1_file.c | 9 --------- 4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/cache.h b/cache.h
index a27018210..0313b0b8d 100644
--- a/cache.h
+++ b/cache.h@@ -1645,7 +1645,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);
diff --git a/packfile.c b/packfile.c
index ea451d27e..0c97c3a1a 100644
--- a/packfile.c
+++ b/packfile.c@@ -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; + } +}
diff --git a/packfile.h b/packfile.h
index 97cfc5e70..b5db490ab 100644
--- a/packfile.h
+++ b/packfile.h@@ -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, size_t *); 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);
diff --git a/sha1_file.c b/sha1_file.c
index 7704801d1..84d96d0ab 100644
--- a/sha1_file.c
+++ b/sha1_file.c@@ -718,15 +718,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));
--
2.14.1.480.gb18f417b89-goog