From c8828530b7797f5ab584c84dc2b86d3c14b39c8d Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 23 Apr 2020 15:41:13 -0600 Subject: commit-graph: close descriptors after mmap We don't ever refer to the descriptor after mmap-ing it. And keeping it open means we can run out of descriptors in degenerate cases (e.g., thousands of split chain files). Let's close it as soon as possible. Signed-off-by: Jeff King Signed-off-by: Taylor Blau Signed-off-by: Junio C Hamano --- commit-graph.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'commit-graph.h') diff --git a/commit-graph.h b/commit-graph.h index 98ef121924..1254eae948 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -40,8 +40,6 @@ struct tree *get_commit_tree_in_graph(struct repository *r, const struct commit *c); struct commit_graph { - int graph_fd; - const unsigned char *data; size_t data_len; @@ -66,8 +64,7 @@ struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st, struct object_directory *odb); struct commit_graph *read_commit_graph_one(struct repository *r, struct object_directory *odb); -struct commit_graph *parse_commit_graph(void *graph_map, int fd, - size_t graph_size); +struct commit_graph *parse_commit_graph(void *graph_map, size_t graph_size); /* * Return 1 if and only if the repository has a commit-graph -- cgit v1.2.1