lib/core: Optimize breaking hardlinks for regfiles
authorColin Walters <walters@verbum.org>
Thu, 14 Dec 2017 17:09:28 +0000 (12:09 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 14 Dec 2017 21:56:26 +0000 (21:56 +0000)
commit26b7637a39e804946e0aa3f4eed3f7570c842a70
tree57d7a2081ceef6eebdb5593d4bf16fd550675146
parent4a2e08148de1ada60ba854b21489159229ed08e3
lib/core: Optimize breaking hardlinks for regfiles

It'd all be really nice if there was some sort of `O_TMPFILE` for symlinks, but
anyways the way we were doing a generic "make temp file than rename" actually
defeats some of the point of `O_TMPFILE`. It's now fully safe to do "copy to
self", so let's do that for regfiles.

Closes: #1378
Approved by: jlebon
src/libostree/ostree-core.c