diff options
author | Neeraj Singh <neerajsi@microsoft.com> | 2022-03-10 22:43:21 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-10 15:10:22 -0800 |
commit | 020406eaa52e67440d9b78087ec2ce25532cb219 (patch) | |
tree | 1e1946931dc25e380e3cadce28ac08dab9019c1f /pack-bitmap-write.c | |
parent | core.fsyncmethod: add writeout-only mode (diff) | |
download | tgif-020406eaa52e67440d9b78087ec2ce25532cb219.tar.xz |
core.fsync: introduce granular fsync control infrastructure
This commit introduces the infrastructure for the core.fsync
configuration knob. The repository components we want to sync
are identified by flags so that we can turn on or off syncing
for specific components.
If core.fsyncObjectFiles is set and the core.fsync configuration
also includes FSYNC_COMPONENT_LOOSE_OBJECT, we will fsync any
loose objects. This picks the strictest data integrity behavior
if core.fsync and core.fsyncObjectFiles are set to conflicting values.
This change introduces the currently unused fsync_component
helper, which will be used by a later patch that adds fsyncing to
the refs backend.
Actual configuration and documentation of the fsync components
list are in other patches in the series to separate review of
the underlying mechanism from the policy of how it's configured.
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Neeraj Singh <neerajsi@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap-write.c')
-rw-r--r-- | pack-bitmap-write.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c index cab3eaa2ac..cf681547f2 100644 --- a/pack-bitmap-write.c +++ b/pack-bitmap-write.c @@ -719,7 +719,8 @@ void bitmap_writer_finish(struct pack_idx_entry **index, if (options & BITMAP_OPT_HASH_CACHE) write_hash_cache(f, index, index_nr); - finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC | CSUM_CLOSE); + finalize_hashfile(f, NULL, FSYNC_COMPONENT_PACK_METADATA, + CSUM_HASH_IN_STREAM | CSUM_FSYNC | CSUM_CLOSE); if (adjust_shared_perm(tmp_file.buf)) die_errno("unable to make temporary bitmap file readable"); |