| 472 | } |
| 473 | |
| 474 | static void |
| 475 | close_hugefile(int fd, char *path, int list_idx) |
| 476 | { |
| 477 | const struct internal_config *internal_conf = |
| 478 | eal_get_internal_configuration(); |
| 479 | /* |
| 480 | * primary process must unlink the file, but only when not in in-memory |
| 481 | * mode (as in that case there is no file to unlink). |
| 482 | */ |
| 483 | if (!internal_conf->in_memory && |
| 484 | rte_eal_process_type() == RTE_PROC_PRIMARY && |
| 485 | unlink(path)) |
| 486 | RTE_LOG(ERR, EAL, "%s(): unlinking '%s' failed: %s\n", |
| 487 | __func__, path, strerror(errno)); |
| 488 | |
| 489 | close(fd); |
| 490 | fd_list[list_idx].memseg_list_fd = -1; |
| 491 | } |
| 492 | |
| 493 | static int |
| 494 | resize_hugefile(int fd, uint64_t fa_offset, uint64_t page_sz, bool grow, |
no test coverage detected