lib/commit: Use direct repo writes if fsync is disabled
authorColin Walters <walters@verbum.org>
Tue, 28 Nov 2017 20:17:10 +0000 (15:17 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 29 Nov 2017 11:22:14 +0000 (11:22 +0000)
commitbd6a15e7a32b1879c301ac1a77bbe4de1cee523d
treed623fd4888aec5375c04574c028a2be98c0276bf
parenta1745e1a79ea1c41cc62e91b346a2a9961997a76
lib/commit: Use direct repo writes if fsync is disabled

For situations where fsync is disabled, there's basically
no reason to do the whole "staging directory" dance.  Just
write directly into the repo.

Today I use `fsync=false` for my build/cache repos.

I briefly considered not allocating a tmpdir at all
in this case, but we actually do want the txn tmpdir
for the non-`O_TMPFILE` case.

Part of https://github.com/ostreedev/ostree/issues/1184

Closes: #1354
Approved by: giuseppe
src/libostree/ostree-repo-commit.c