pack: move static state variables
[git/git.git] / packfile.c
CommitLineData
4f39cd82 1#include "cache.h"
6d6a80e0 2#include "mru.h"
4f39cd82
JT
3
4char *odb_pack_name(struct strbuf *buf,
5 const unsigned char *sha1,
6 const char *ext)
7{
8 strbuf_reset(buf);
9 strbuf_addf(buf, "%s/pack/pack-%s.%s", get_object_directory(),
10 sha1_to_hex(sha1), ext);
11 return buf->buf;
12}
13
14char *sha1_pack_name(const unsigned char *sha1)
15{
16 static struct strbuf buf = STRBUF_INIT;
17 return odb_pack_name(&buf, sha1, "pack");
18}
19
20char *sha1_pack_index_name(const unsigned char *sha1)
21{
22 static struct strbuf buf = STRBUF_INIT;
23 return odb_pack_name(&buf, sha1, "idx");
24}
6d6a80e0
JT
25
26unsigned int pack_used_ctr;
27unsigned int pack_mmap_calls;
28unsigned int peak_pack_open_windows;
29unsigned int pack_open_windows;
30unsigned int pack_open_fds;
31unsigned int pack_max_fds;
32size_t peak_pack_mapped;
33size_t pack_mapped;
34struct packed_git *packed_git;
35
36static struct mru packed_git_mru_storage;
37struct mru *packed_git_mru = &packed_git_mru_storage;