summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-09-15 18:25:53 +0200
committerantirez <antirez@gmail.com>2011-09-19 17:43:34 +0200
commit3ae56d845859428dba9130d982bea1d8e72798a9 (patch)
tree1c6fe2d9c41340f415624773457bd5301bcf66dc
parent0807f5b9ffddbd4b190ec5d104e0bc145fbf3f8f (diff)
downloadredis-3ae56d845859428dba9130d982bea1d8e72798a9.tar.gz
REDIS_BIO_AOF_FSYNC implemented
-rw-r--r--src/bio.c2
-rw-r--r--src/bio.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bio.c b/src/bio.c
index fc4d56695..9199bf23a 100644
--- a/src/bio.c
+++ b/src/bio.c
@@ -129,6 +129,8 @@ void *bioProcessBackgroundJobs(void *arg) {
/* Process the job accordingly to its type. */
if (type == REDIS_BIO_CLOSE_FILE) {
close((long)job->arg1);
+ } else if (type == REDIS_BIO_AOF_FSYNC) {
+ fsync((long)job->arg1);
} else {
redisPanic("Wrong job type in bioProcessBackgroundJobs().");
}
diff --git a/src/bio.h b/src/bio.h
index ebd01ee28..22a9b33e1 100644
--- a/src/bio.h
+++ b/src/bio.h
@@ -7,4 +7,5 @@ time_t bioOlderJobOfType(int type);
/* Background job opcodes */
#define REDIS_BIO_CLOSE_FILE 0 /* Deferred close(2) syscall. */
-#define REDIS_BIO_NUM_OPS 1
+#define REDIS_BIO_AOF_FSYNC 1 /* Deferred AOF fsync. */
+#define REDIS_BIO_NUM_OPS 2