mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
reftable/stack: stop using fsync_component() directly
We're executing `fsync_component()` directly in the reftable library so that we can fsync data to disk depending on "core.fsync". But as we're in the process of converting the reftable library to become standalone we cannot use that function in the library anymore. Refactor the code such that users of the library can inject a custom fsync function via the write options. This allows us to get rid of the dependency on "write-or-die.h". Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
c2f08236ed
commit
86b770b0bb
@@ -62,6 +62,12 @@ struct reftable_write_options {
|
||||
* negative value will cause us to block indefinitely.
|
||||
*/
|
||||
long lock_timeout_ms;
|
||||
|
||||
/*
|
||||
* Optional callback used to fsync files to disk. Falls back to using
|
||||
* fsync(3P) when unset.
|
||||
*/
|
||||
int (*fsync)(int fd);
|
||||
};
|
||||
|
||||
/* reftable_block_stats holds statistics for a single block type */
|
||||
|
||||
Reference in New Issue
Block a user