Skip to content

Commit 41cd4b4

Browse files
ttaylorrgitster
authored andcommitted
pack-bitmap: tag bitmapped packs with their corresponding MIDX
The next commit will need to use the bitmap's MIDX (if one exists) to translate bit positions into pack-relative positions in the source pack. Ordinarily, we'd use the "midx" field of the bitmap_index struct. But since that struct is defined within pack-bitmap.c, and our caller is in a separate compilation unit, we do not have access to the MIDX field. Instead, add a "from_midx" field to the bitmapped_pack structure so that we can use that piece of data from outside of pack-bitmap.c. The caller that uses this new piece of information will be added in the following commit. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bbc393a commit 41cd4b4

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

midx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ int nth_bitmapped_pack(struct repository *r, struct multi_pack_index *m,
496496
MIDX_CHUNK_BITMAPPED_PACKS_WIDTH * local_pack_int_id +
497497
sizeof(uint32_t));
498498
bp->pack_int_id = pack_int_id;
499+
bp->from_midx = m;
499500

500501
return 0;
501502
}

pack-bitmap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,6 +2322,7 @@ void reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
23222322
packs[packs_nr].pack_int_id = pack_int_id;
23232323
packs[packs_nr].bitmap_nr = pack->num_objects;
23242324
packs[packs_nr].bitmap_pos = 0;
2325+
packs[packs_nr].from_midx = bitmap_git->midx;
23252326

23262327
objects_nr = packs[packs_nr++].bitmap_nr;
23272328
}

pack-bitmap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ struct bitmapped_pack {
6060
uint32_t bitmap_pos;
6161
uint32_t bitmap_nr;
6262

63+
struct multi_pack_index *from_midx; /* MIDX only */
6364
uint32_t pack_int_id; /* MIDX only */
6465
};
6566

0 commit comments

Comments
 (0)