From 1d4f1b8878addd28059c3a3928640491755cd615 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 4 Oct 2016 15:23:04 -0400 Subject: [PATCH] core: Do create hardlinks to symlinks for checkouts I was noticing a recent performance issue with checkouts which seemed to be mostly us going back to doing a `fsync()` on directories. Regardless, while looking at that, I saw we were spending time creating new symlinks. Even though symlinks are small, it's still better to hardlink them. Going way back in time, the reason we weren't doing this is because we were hitting `EMFILE` on ext4, but that was for gnome-continuous which creates *many* build roots. Even there though, they're just a cache, and we handle `EMFILE`. For ostree-for-host-system, we don't expect to have many roots (just 3 at most transiently), so hardlinking symlinks does make sense. Closes: #521 Approved by: jlebon --- src/libostree/ostree-repo-checkout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c index 23258a47..298fcd15 100644 --- a/src/libostree/ostree-repo-checkout.c +++ b/src/libostree/ostree-repo-checkout.c @@ -437,7 +437,7 @@ checkout_one_file_at (OstreeRepo *repo, need_copy = FALSE; } - else if (!is_symlink) + else { gboolean did_hardlink = FALSE; /* Try to do a hardlink first, if it's a regular file. This also