]> git.saurik.com Git - redis.git/commitdiff
REDIS_BIO_AOF_FSYNC implemented
authorantirez <antirez@gmail.com>
Thu, 15 Sep 2011 16:25:53 +0000 (18:25 +0200)
committerantirez <antirez@gmail.com>
Thu, 15 Sep 2011 16:25:53 +0000 (18:25 +0200)
src/bio.c
src/bio.h

index fc4d56695924fb17381dbcf8eaadd641cdb686c4..9199bf23ac57be02ec684dd4b3d4b7d372d1fb29 100644 (file)
--- 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().");
         }
index ebd01ee28813ad9fc136b7fac908a653085f3071..22a9b33e16c462bb6a819f10bd97389f1099e768 100644 (file)
--- 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