From 5a559993044fbfa54c9e666a54b757b847d49549 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 21 May 2012 16:50:05 +0200 Subject: [PATCH] Use comments to split aof.c into sections. This makes the code more readable, it is still not the case to split the file itself into three different files, but the logical separation improves the readability especially since new commits are going to introduce an additional section. --- src/aof.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/aof.c b/src/aof.c index 115da29ba..59b5ab89f 100644 --- a/src/aof.c +++ b/src/aof.c @@ -12,6 +12,12 @@ void aofUpdateCurrentSize(void); +/* ---------------------------------------------------------------------------- + * AOF file implementation + * ------------------------------------------------------------------------- */ + +/* Starts a background task that performs fsync() against the specified + * file descriptor (the one of the AOF file) in another thread. */ void aof_background_fsync(int fd) { bioCreateBackgroundJob(REDIS_BIO_AOF_FSYNC,(void*)(long)fd,NULL,NULL); } @@ -280,6 +286,10 @@ void feedAppendOnlyFile(struct redisCommand *cmd, int dictid, robj **argv, int a sdsfree(buf); } +/* ---------------------------------------------------------------------------- + * AOF loading + * ------------------------------------------------------------------------- */ + /* In Redis commands are always executed in the context of a client, so in * order to load the append only file we need to create a fake client. */ struct redisClient *createFakeClient(void) { @@ -424,6 +434,10 @@ fmterr: exit(1); } +/* ---------------------------------------------------------------------------- + * AOF rewrite + * ------------------------------------------------------------------------- */ + /* Delegate writing an object to writing a bulk string or bulk long long. * This is not placed in rio.c since that adds the redis.h dependency. */ int rioWriteBulkObject(rio *r, robj *obj) { -- GitLab