Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 3ba96dbd77..ca0085717d 100644
--- a/cache.h
+++ b/cache.h
@@ -1037,7 +1037,8 @@ extern int use_fsync;
enum fsync_method {
FSYNC_METHOD_FSYNC,
- FSYNC_METHOD_WRITEOUT_ONLY
+ FSYNC_METHOD_WRITEOUT_ONLY,
+ FSYNC_METHOD_BATCH,
};
extern enum fsync_method fsync_method;
@@ -1750,6 +1751,11 @@ void fsync_or_die(int fd, const char *);
int fsync_component(enum fsync_component component, int fd);
void fsync_component_or_die(enum fsync_component component, int fd, const char *msg);
+static inline int batch_fsync_enabled(enum fsync_component component)
+{
+ return (fsync_components & component) && (fsync_method == FSYNC_METHOD_BATCH);
+}
+
ssize_t read_in_full(int fd, void *buf, size_t count);
ssize_t write_in_full(int fd, const void *buf, size_t count);
ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset);