summaryrefslogtreecommitdiff
path: root/cache-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-06-03 21:30:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-06-03 21:30:34 (GMT)
commit83937e9592832408670da38bfe6e96c90ad63521 (patch)
tree20c6895015e2c281780eba0fead78aef3862ed8e /cache-tree.c
parent377d347eb3b1a23ece080dc5e5b8df6958c56e96 (diff)
parent112a9fe60d7c5f02ee1a805d8730d54a458b7ad1 (diff)
downloadgit-83937e9592832408670da38bfe6e96c90ad63521.zip
git-83937e9592832408670da38bfe6e96c90ad63521.tar.gz
git-83937e9592832408670da38bfe6e96c90ad63521.tar.bz2
Merge branch 'ns/batch-fsync'
Introduce a filesystem-dependent mechanism to optimize the way the bits for many loose object files are ensured to hit the disk platter. * ns/batch-fsync: core.fsyncmethod: performance tests for batch mode t/perf: add iteration setup mechanism to perf-lib core.fsyncmethod: tests for batch mode test-lib-functions: add parsing helpers for ls-files and ls-tree core.fsync: use batch mode and sync loose objects by default on Windows unpack-objects: use the bulk-checkin infrastructure update-index: use the bulk-checkin infrastructure builtin/add: add ODB transaction around add_files_to_cache cache-tree: use ODB transaction around writing a tree core.fsyncmethod: batched disk flushes for loose-objects bulk-checkin: rebrand plug/unplug APIs as 'odb transactions' bulk-checkin: rename 'state' variable and separate 'plugged' boolean
Diffstat (limited to 'cache-tree.c')
-rw-r--r--cache-tree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cache-tree.c b/cache-tree.c
index 6752f69..8c5e882 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -3,6 +3,7 @@
#include "tree.h"
#include "tree-walk.h"
#include "cache-tree.h"
+#include "bulk-checkin.h"
#include "object-store.h"
#include "replace-object.h"
#include "promisor-remote.h"
@@ -474,8 +475,10 @@ int cache_tree_update(struct index_state *istate, int flags)
trace_performance_enter();
trace2_region_enter("cache_tree", "update", the_repository);
+ begin_odb_transaction();
i = update_one(istate->cache_tree, istate->cache, istate->cache_nr,
"", 0, &skip, flags);
+ end_odb_transaction();
trace2_region_leave("cache_tree", "update", the_repository);
trace_performance_leave("cache_tree_update");
if (i < 0)