m->source->local);
if (p) {
install_packed_git(r, p);
- list_add_tail(&p->mru, &r->objects->packed_git_mru);
+ list_add_tail(&p->mru, &r->objects->packfiles->mru);
}
}
memset(o, 0, sizeof(*o));
o->repo = repo;
o->packfiles = packfile_store_new(o);
- INIT_LIST_HEAD(&o->packed_git_mru);
pthread_mutex_init(&o->replace_mutex, NULL);
string_list_init_dup(&o->submodule_source_paths);
return o;
free((char *) o->cached_objects[i].value.buf);
FREE_AND_NULL(o->cached_objects);
- INIT_LIST_HEAD(&o->packed_git_mru);
close_object_store(o);
packfile_store_free(o->packfiles);
o->packfiles = NULL;
#include "hashmap.h"
#include "object.h"
-#include "list.h"
#include "oidset.h"
#include "oidmap.h"
#include "string-list.h"
* Should only be accessed directly by packfile.c and midx.c.
*/
struct packfile_store *packfiles;
- /* A most-recently-used ordered version of the packed_git list. */
- struct list_head packed_git_mru;
-
struct {
struct packed_git **packs;
unsigned flags;
{
struct packed_git *p;
- INIT_LIST_HEAD(&r->objects->packed_git_mru);
+ INIT_LIST_HEAD(&r->objects->packfiles->mru);
for (p = r->objects->packfiles->packs; p; p = p->next)
- list_add_tail(&p->mru, &r->objects->packed_git_mru);
+ list_add_tail(&p->mru, &r->objects->packfiles->mru);
}
static void prepare_packed_git(struct repository *r)
struct list_head *get_packed_git_mru(struct repository *r)
{
prepare_packed_git(r);
- return &r->objects->packed_git_mru;
+ return &r->objects->packfiles->mru;
}
unsigned long unpack_object_header_buffer(const unsigned char *buf,
if (!r->objects->packfiles->packs)
return 0;
- list_for_each(pos, &r->objects->packed_git_mru) {
+ list_for_each(pos, &r->objects->packfiles->mru) {
struct packed_git *p = list_entry(pos, struct packed_git, mru);
if (!p->multi_pack_index && fill_pack_entry(oid, e, p)) {
- list_move(&p->mru, &r->objects->packed_git_mru);
+ list_move(&p->mru, &r->objects->packfiles->mru);
return 1;
}
}
struct packfile_store *store;
CALLOC_ARRAY(store, 1);
store->odb = odb;
+ INIT_LIST_HEAD(&store->mru);
hashmap_init(&store->map, pack_map_entry_cmp, NULL, 0);
return store;
}
*/
struct packed_git *packs;
+ /* A most-recently-used ordered version of the packs list. */
+ struct list_head mru;
+
/*
* A map of packfile names to packed_git structs for tracking which
* packs have been loaded already.