summaryrefslogtreecommitdiff
path: root/lockfile.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-12-23 07:34:01 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-12-29 19:36:44 (GMT)
commit9bc879c1ced505089e2a1e420d32599bb15b35b5 (patch)
tree8fb8afafeac20359343f2acd2d142199a2de2546 /lockfile.c
parent75025ccdb79b5d6b290c630f8777c9f7bb9d257c (diff)
downloadgit-9bc879c1ced505089e2a1e420d32599bb15b35b5.zip
git-9bc879c1ced505089e2a1e420d32599bb15b35b5.tar.gz
git-9bc879c1ced505089e2a1e420d32599bb15b35b5.tar.bz2
Refactor how we open pack files to prepare for multiple windows.
To efficiently support mmaping of multiple regions of the same pack file we want to keep the pack's file descriptor open while we are actively working with that pack. So we are now keeping that file descriptor in packed_git.pack_fd and closing it only after we unmap the last window. This is going to increase the number of file descriptors that are in use at once, however that will be bounded by the total number of pack files present and therefore should not be very high. It is a small tradeoff which we may need to revisit after some testing can be done on various repositories and systems. For code clarity we also want to seperate out the implementation of how we open a pack file from the implementation which locates a suitable window (or makes a new one) from the given pack file. Since this is a rather large delta I'm taking advantage of doing it now, in a fairly isolated change. When we open a pack file we need to examine the header and trailer without having a mmap in place, as we may only need to mmap the middle section of this particular pack. Consequently the verification code has been refactored to make use of the new read_or_die function. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'lockfile.c')
0 files changed, 0 insertions, 0 deletions