| 533 | } |
| 534 | |
| 535 | static int close_one_pack(struct repository *r) |
| 536 | { |
| 537 | struct odb_source *source; |
| 538 | struct packfile_list_entry *e; |
| 539 | struct packed_git *lru_p = NULL; |
| 540 | struct pack_window *mru_w = NULL; |
| 541 | int accept_windows_inuse = 1; |
| 542 | |
| 543 | for (source = r->objects->sources; source; source = source->next) { |
| 544 | struct odb_source_files *files = odb_source_files_downcast(source); |
| 545 | for (e = files->packed->packs.head; e; e = e->next) { |
| 546 | if (e->pack->pack_fd == -1) |
| 547 | continue; |
| 548 | find_lru_pack(e->pack, &lru_p, &mru_w, &accept_windows_inuse); |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | if (lru_p) |
| 553 | return close_pack_fd(lru_p); |
| 554 | |
| 555 | return 0; |
| 556 | } |
| 557 | |
| 558 | static unsigned int get_max_fd_limit(void) |
| 559 | { |
no test coverage detected