MCPcopy Create free account
hub / github.com/git/git / fsync_loose_object_transaction

Function fsync_loose_object_transaction

object-file.c:521–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519}
520
521static void fsync_loose_object_transaction(struct odb_transaction *base,
522 int fd, const char *filename)
523{
524 struct odb_transaction_files *transaction =
525 container_of_or_null(base, struct odb_transaction_files, base);
526
527 /*
528 * If we have an active ODB transaction, we issue a call that
529 * cleans the filesystem page cache but avoids a hardware flush
530 * command. Later on we will issue a single hardware flush
531 * before renaming the objects to their final names as part of
532 * flush_batch_fsync.
533 */
534 if (!transaction || !transaction->objdir ||
535 git_fsync(fd, FSYNC_WRITEOUT_ONLY) < 0) {
536 if (errno == ENOSYS)
537 warning(_("core.fsyncMethod = batch is unsupported on this platform"));
538 fsync_or_die(fd, filename);
539 }
540}
541
542/*
543 * Cleanup after batch-mode fsync_object_files.

Callers 1

close_loose_objectFunction · 0.85

Calls 3

git_fsyncFunction · 0.85
warningFunction · 0.85
fsync_or_dieFunction · 0.85

Tested by

no test coverage detected