#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "environment.h"
#include "gettext.h"
#include "name-hash.h"
#include "object.h"
#include "read-cache-ll.h"
#include "thread-utils.h"
#include "trace.h"
#include "trace2.h"
#include "sparse-index.h"
struct dir_entry { … };
static int dir_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata)
{ … }
static struct dir_entry *find_dir_entry__hash(struct index_state *istate,
const char *name, unsigned int namelen, unsigned int hash)
{ … }
static struct dir_entry *find_dir_entry(struct index_state *istate,
const char *name, unsigned int namelen)
{ … }
static struct dir_entry *hash_dir_entry(struct index_state *istate,
struct cache_entry *ce, int namelen)
{ … }
static void add_dir_entry(struct index_state *istate, struct cache_entry *ce)
{ … }
static void remove_dir_entry(struct index_state *istate, struct cache_entry *ce)
{ … }
static void hash_index_entry(struct index_state *istate, struct cache_entry *ce)
{ … }
static int cache_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *remove)
{ … }
static int lazy_try_threaded = …;
static int lazy_nr_dir_threads;
#define LAZY_THREAD_COST …
#define LAZY_MAX_MUTEX …
static pthread_mutex_t *lazy_dir_mutex_array;
struct lazy_entry { … };
static int lookup_lazy_params(struct index_state *istate)
{ … }
static void init_dir_mutex(void)
{ … }
static void cleanup_dir_mutex(void)
{ … }
static void lock_dir_mutex(int j)
{ … }
static void unlock_dir_mutex(int j)
{ … }
static inline int compute_dir_lock_nr(
const struct hashmap *map,
unsigned int hash)
{ … }
static struct dir_entry *hash_dir_entry_with_parent_and_prefix(
struct index_state *istate,
struct dir_entry *parent,
struct strbuf *prefix)
{ … }
static int handle_range_1(
struct index_state *istate,
int k_start,
int k_end,
struct dir_entry *parent,
struct strbuf *prefix,
struct lazy_entry *lazy_entries);
static int handle_range_dir(
struct index_state *istate,
int k_start,
int k_end,
struct dir_entry *parent,
struct strbuf *prefix,
struct lazy_entry *lazy_entries,
struct dir_entry **dir_new_out)
{ … }
static int handle_range_1(
struct index_state *istate,
int k_start,
int k_end,
struct dir_entry *parent,
struct strbuf *prefix,
struct lazy_entry *lazy_entries)
{ … }
struct lazy_dir_thread_data { … };
static void *lazy_dir_thread_proc(void *_data)
{ … }
struct lazy_name_thread_data { … };
static void *lazy_name_thread_proc(void *_data)
{ … }
static inline void lazy_update_dir_ref_counts(
struct index_state *istate,
struct lazy_entry *lazy_entries)
{ … }
static void threaded_lazy_init_name_hash(
struct index_state *istate)
{ … }
static void lazy_init_name_hash(struct index_state *istate)
{ … }
int test_lazy_init_name_hash(struct index_state *istate, int try_threaded)
{ … }
void add_name_hash(struct index_state *istate, struct cache_entry *ce)
{ … }
void remove_name_hash(struct index_state *istate, struct cache_entry *ce)
{ … }
static int slow_same_name(const char *name1, int len1, const char *name2, int len2)
{ … }
static int same_name(const struct cache_entry *ce, const char *name, int namelen, int icase)
{ … }
int index_dir_find(struct index_state *istate, const char *name, int namelen,
struct strbuf *canonical_path)
{ … }
void adjust_dirname_case(struct index_state *istate, char *name)
{ … }
struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int icase)
{ … }
void free_name_hash(struct index_state *istate)
{ … }