From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 09EA64696C3 for ; Wed, 15 Apr 2020 17:14:05 +0300 (MSK) Received: by mail-lj1-f196.google.com with SMTP id u15so3861969ljd.3 for ; Wed, 15 Apr 2020 07:14:05 -0700 (PDT) From: Cyrill Gorcunov Date: Wed, 15 Apr 2020 17:13:59 +0300 Message-Id: <20200415141359.16253-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] vclock: rename vclock_reset to vclock_set List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml The `reset` keyword is too overloaded, its traditional context is to setup some value either to zero or to default. That is not what we're doing in this helper: we rather set up a new value to the replica_id in the map, keeping consistency of the sum. Thus lets name it as it should -- vclock_set. Signed-off-by: Cyrill Gorcunov --- src/box/box.cc | 2 +- src/box/vclock.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index af92b55a8..c4f83c575 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -1905,7 +1905,7 @@ box_process_subscribe(struct ev_io *io, struct xrow_header *header) * Speaking of gc, remote instances' local vclock * components are not used by consumers at all. */ - vclock_reset(&replica_clock, 0, vclock_get(&replicaset.vclock, 0)); + vclock_set(&replica_clock, 0, vclock_get(&replicaset.vclock, 0)); /* * Process SUBSCRIBE request via replication relay * Send current recovery vector clock as a marker diff --git a/src/box/vclock.h b/src/box/vclock.h index 5865f7443..8d62b561f 100644 --- a/src/box/vclock.h +++ b/src/box/vclock.h @@ -193,7 +193,7 @@ vclock_inc(struct vclock *vclock, uint32_t replica_id) * @param lsn Lsn to set */ static inline void -vclock_reset(struct vclock *vclock, uint32_t replica_id, int64_t lsn) +vclock_set(struct vclock *vclock, uint32_t replica_id, int64_t lsn) { assert(lsn >= 0); assert(replica_id < VCLOCK_MAX); @@ -411,7 +411,7 @@ vclock_min_ignore0(struct vclock *a, const struct vclock *b) int64_t lsn_b = vclock_get(b, replica_id); if (lsn_a <= lsn_b) continue; - vclock_reset(a, replica_id, lsn_b); + vclock_set(a, replica_id, lsn_b); } } -- 2.20.1