pkg_add: greatly reduce the number of open files
modified libpkg/pkg_add.c
@@ -310,14 +310,24 @@ fill_timespec_buf(const struct stat *aest, struct timespec tspec[2])
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
| + | |
|
|
|
|
|
@@ -327,6 +337,16 @@ get_tempdir(int rootfd, const char *path, tempdirs_t *tempdirs)
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -335,27 +355,33 @@ create_dir(struct pkg *pkg, struct pkg_dir *d, tempdirs_t *tempdirs)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
| + | |
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -365,6 +391,7 @@ create_dir(struct pkg *pkg, struct pkg_dir *d, tempdirs_t *tempdirs)
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -436,8 +463,10 @@ create_symlinks(struct pkg *pkg, struct pkg_file *f, const char *target, tempdir
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
| + | |
|
|
|
|
|
@@ -447,10 +476,12 @@ retry:
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -508,6 +539,7 @@ create_hardlink(struct pkg *pkg, struct pkg_file *f, const char *path, tempdirs_
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -517,6 +549,7 @@ create_hardlink(struct pkg *pkg, struct pkg_file *f, const char *path, tempdirs_
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -541,14 +574,21 @@ retry:
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -618,11 +658,18 @@ create_regfile(struct pkg *pkg, struct pkg_file *f, struct archive *a,
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
| + | |
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
| + | |
|
|
|
|
|
@@ -645,11 +692,13 @@ create_regfile(struct pkg *pkg, struct pkg_file *f, struct archive *a,
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -671,11 +720,14 @@ create_regfile(struct pkg *pkg, struct pkg_file *f, struct archive *a,
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -823,7 +875,6 @@ pkg_extract_finalize(struct pkg *pkg, tempdirs_t *tempdirs)
|
|
|
|
|
|
| - | |
|
|
|
|
|