aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2017-08-18 15:20:21 -0700
committerJunio C Hamano <gitster@pobox.com>2017-08-23 15:12:06 -0700
commit3836d88ae575cf2321fb17296f748c0bb35ba268 (patch)
tree5f1e224972bc8c3456862e387cd13977fb1ae205 /sha1_file.c
parentf0e17e86e1b1030b2719f3d6e9d4124c9b5bc480 (diff)
downloadgit-3836d88ae575cf2321fb17296f748c0bb35ba268.tar.gz
git-3836d88ae575cf2321fb17296f748c0bb35ba268.tar.xz
pack: move pack-closing functions
The function close_pack_fd() needs to be temporarily made global. Its scope will be restored to static in a subsequent commit. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/sha1_file.c b/sha1_file.c
index dce232fb5..de4aed63d 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -719,53 +719,6 @@ void *xmmap(void *start, size_t length,
return ret;
}
-void close_pack_windows(struct packed_git *p)
-{
- while (p->windows) {
- struct pack_window *w = p->windows;
-
- if (w->inuse_cnt)
- die("pack '%s' still has open windows to it",
- p->pack_name);
- munmap(w->base, w->len);
- pack_mapped -= w->len;
- pack_open_windows--;
- p->windows = w->next;
- free(w);
- }
-}
-
-static int close_pack_fd(struct packed_git *p)
-{
- if (p->pack_fd < 0)
- return 0;
-
- close(p->pack_fd);
- pack_open_fds--;
- p->pack_fd = -1;
-
- return 1;
-}
-
-static void close_pack(struct packed_git *p)
-{
- close_pack_windows(p);
- close_pack_fd(p);
- close_pack_index(p);
-}
-
-void close_all_packs(void)
-{
- struct packed_git *p;
-
- for (p = packed_git; p; p = p->next)
- if (p->do_not_close)
- die("BUG: want to close pack marked 'do-not-close'");
- else
- close_pack(p);
-}
-
-
/*
* The LRU pack is the one with the oldest MRU window, preferring packs
* with no used windows, or the oldest mtime if it has no windows allocated.
@@ -848,14 +801,6 @@ void unuse_pack(struct pack_window **w_cursor)
}
}
-void close_pack_index(struct packed_git *p)
-{
- if (p->index_data) {
- munmap((void *)p->index_data, p->index_size);
- p->index_data = NULL;
- }
-}
-
static unsigned int get_max_fd_limit(void)
{
#ifdef RLIMIT_NOFILE