checkout: Add an option to require hardlinks
I've seen a few people hit this and wonder why checkouts are slow/take space. Really, ensuring this happens is the *point* of OSTree. Physical copies should be a last resort fallback for very unusual situations (one of those is rpm-ostree checking out the db since librpm doesn't know how to read from libostree). Even I hit the fact that `/var` is a mountpoint disallowing hardlinks with `/ostree` once and was confused. =) Add this to the rofiles-fuse test case because it creates a mount point. Closes: #368 Approved by: jlebon
This commit is contained in:
1 parent
da989b473d
commit
439069b2bb
4 files changed
+18
-4
No files matched your search
@@ -346,7 +346,7 @@ checkout_file_hardlink (OstreeRepo *self,
|
||||
again:
|
||||
if (linkat (srcfd, loose_path, destination_dfd, destination_name, 0) != -1)
|
||||
ret_was_supported = TRUE;
|
||||
else if (errno == EMLINK || errno == EXDEV || errno == EPERM)
|
||||
else if (!options->no_copy_fallback && (errno == EMLINK || errno == EXDEV || errno == EPERM))
|
||||
{
|
||||
/* EMLINK, EXDEV and EPERM shouldn't be fatal; we just can't do the
|
||||
* optimization of hardlinking instead of copying.
|
||||
|
||||
@@ -750,7 +750,8 @@ typedef struct {
|
||||
guint enable_uncompressed_cache : 1;
|
||||
guint disable_fsync : 1;
|
||||
guint process_whiteouts : 1;
|
||||
guint reserved : 29;
|
||||
guint no_copy_fallback : 1;
|
||||
guint reserved : 28;
|
||||
|
||||
const char *subpath;
|
||||
|
||||
|
||||
Reference in new issue
Block a user