summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-03-02 10:01:54 -0800
committerJunio C Hamano <gitster@pobox.com>2011-03-02 11:25:30 -0800
commitd131b7afea58f47721dafd013ab6aff4adfc42dd (patch)
treeeba3c5c258ff6408d15170e03cf005ff40bceed8 /cache.h
parent38abd9b8b4e11aa0b4cdaa5c7b44e0c0ad06820b (diff)
downloadgit-d131b7afea58f47721dafd013ab6aff4adfc42dd.tar.gz
sha1_file.c: Don't retain open fds on small packs
If a pack file is small enough that its entire contents fits within one mmap window, mmap the file and then immediately close its file descriptor. This reduces the number of file descriptors that are needed to read from repositories with many tiny pack files, such as one that has received 1000 pushes (and created 1000 small pack files) since its last repack. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 3abf8950bd..663ab5804b 100644
--- a/cache.h
+++ b/cache.h
@@ -899,7 +899,8 @@ extern struct packed_git {
time_t mtime;
int pack_fd;
unsigned pack_local:1,
- pack_keep:1;
+ pack_keep:1,
+ do_not_close:1;
unsigned char sha1[20];
/* something like ".git/objects/pack/xxxxx.pack" */
char pack_name[FLEX_ARRAY]; /* more */