From 730174445b72bb04c446c635d4c34041270b596b Mon Sep 17 00:00:00 2001 From: 0del <53461381+0del@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:26:20 +0700 Subject: [PATCH] Rename redisOpArray to serverOpArray (#157) A task of #144 Signed-off-by: 0del --- src/server.c | 8 ++++---- src/server.h | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/server.c b/src/server.c index 2b2dafd64..75ab39980 100644 --- a/src/server.c +++ b/src/server.c @@ -3117,7 +3117,7 @@ void resetErrorTableStats(void) { /* ========================== Redis OP Array API ============================ */ -int redisOpArrayAppend(redisOpArray *oa, int dbid, robj **argv, int argc, int target) { +int serverOpArrayAppend(serverOpArray *oa, int dbid, robj **argv, int argc, int target) { redisOp *op; int prev_capacity = oa->capacity; @@ -3138,7 +3138,7 @@ int redisOpArrayAppend(redisOpArray *oa, int dbid, robj **argv, int argc, int ta return oa->numops; } -void redisOpArrayFree(redisOpArray *oa) { +void serverOpArrayFree(serverOpArray *oa) { while(oa->numops) { int j; redisOp *op; @@ -3322,7 +3322,7 @@ void alsoPropagate(int dbid, robj **argv, int argc, int target) { argvcopy[j] = argv[j]; incrRefCount(argv[j]); } - redisOpArrayAppend(&server.also_propagate,dbid,argvcopy,argc,target); + serverOpArrayAppend(&server.also_propagate,dbid,argvcopy,argc,target); } /* It is possible to call the function forceCommandPropagation() inside a @@ -3419,7 +3419,7 @@ static void propagatePendingCommands(void) { propagateNow(-1,&shared.exec,1,PROPAGATE_AOF|PROPAGATE_REPL); } - redisOpArrayFree(&server.also_propagate); + serverOpArrayFree(&server.also_propagate); } /* Performs operations that should be performed after an execution unit ends. diff --git a/src/server.h b/src/server.h index 1d911cc8d..ec07b0a8c 100644 --- a/src/server.h +++ b/src/server.h @@ -1385,14 +1385,14 @@ typedef struct redisOp { /* Defines an array of Redis operations. There is an API to add to this * structure in an easy way. * - * int redisOpArrayAppend(redisOpArray *oa, int dbid, robj **argv, int argc, int target); - * void redisOpArrayFree(redisOpArray *oa); + * int serverOpArrayAppend(serverOpArray *oa, int dbid, robj **argv, int argc, int target); + * void serverOpArrayFree(serverOpArray *oa); */ -typedef struct redisOpArray { +typedef struct serverOpArray { redisOp *ops; int numops; int capacity; -} redisOpArray; +} serverOpArray; /* This structure is returned by the getMemoryOverheadData() function in * order to return memory overhead information. */ @@ -1844,7 +1844,7 @@ struct redisServer { int child_info_pipe[2]; /* Pipe used to write the child_info_data. */ int child_info_nread; /* Num of bytes of the last read from pipe */ /* Propagation of commands in AOF / replication */ - redisOpArray also_propagate; /* Additional command to propagate. */ + serverOpArray also_propagate; /* Additional command to propagate. */ int replication_allowed; /* Are we allowed to replicate? */ /* Logging */ char *logfile; /* Path of log file */ @@ -3065,7 +3065,7 @@ int incrCommandStatsOnError(struct redisCommand *cmd, int flags); void call(client *c, int flags); void alsoPropagate(int dbid, robj **argv, int argc, int target); void postExecutionUnitOperations(void); -void redisOpArrayFree(redisOpArray *oa); +void serverOpArrayFree(serverOpArray *oa); void forceCommandPropagation(client *c, int flags); void preventCommandPropagation(client *c); void preventCommandAOF(client *c);