* A helper function that will load the specified range of cache entries * from the memory mapped file and add them to the given index. */
| 2028 | * from the memory mapped file and add them to the given index. |
| 2029 | */ |
| 2030 | static unsigned long load_cache_entry_block(struct index_state *istate, |
| 2031 | struct mem_pool *ce_mem_pool, int offset, int nr, const char *mmap, |
| 2032 | unsigned long start_offset, const struct cache_entry *previous_ce) |
| 2033 | { |
| 2034 | int i; |
| 2035 | unsigned long src_offset = start_offset; |
| 2036 | |
| 2037 | for (i = offset; i < offset + nr; i++) { |
| 2038 | struct cache_entry *ce; |
| 2039 | unsigned long consumed; |
| 2040 | |
| 2041 | ce = create_from_disk(ce_mem_pool, istate->version, |
| 2042 | mmap + src_offset, |
| 2043 | &consumed, previous_ce); |
| 2044 | set_index_entry(istate, i, ce); |
| 2045 | |
| 2046 | src_offset += consumed; |
| 2047 | previous_ce = ce; |
| 2048 | } |
| 2049 | return src_offset - start_offset; |
| 2050 | } |
| 2051 | |
| 2052 | static unsigned long load_all_cache_entries(struct index_state *istate, |
| 2053 | const char *mmap, size_t mmap_size, unsigned long src_offset) |
no test coverage detected