aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2018-07-17 23:36:36 +0200
committerKarolin Seeger <kseeger@samba.org>2018-08-23 10:38:27 +0200
commitc245fdce393c9c11b52576335802a5fdceeeaf96 (patch)
tree8bc4e3c1c50ba5e59d7ca74a1c907e1999ae5ded
parentaf08da45716f713ed1897a23d814cb679f3f24bf (diff)
downloadsamba-c245fdce393c9c11b52576335802a5fdceeeaf96.tar.gz
samba-c245fdce393c9c11b52576335802a5fdceeeaf96.tar.xz
samba-c245fdce393c9c11b52576335802a5fdceeeaf96.zip
ctdb_mutex_ceph_rados_helper: rename timer_ev to ppid_timer_ev
In preparation for adding a lock refresh timer. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 91a89c146453ca203a83dc2ba555bb93276c4d7f)
-rw-r--r--ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c b/ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c
index 9c31e310b91..9f020bf57d5 100644
--- a/ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c
+++ b/ctdb/utils/ceph/ctdb_mutex_ceph_rados_helper.c
@@ -142,7 +142,7 @@ struct ctdb_mutex_rados_state {
struct tevent_context *ev;
struct tevent_signal *sigterm_ev;
struct tevent_signal *sigint_ev;
- struct tevent_timer *timer_ev;
+ struct tevent_timer *ppid_timer_ev;
rados_t ceph_cluster;
rados_ioctx_t ioctx;
};
@@ -166,10 +166,10 @@ static void ctdb_mutex_rados_sigterm_cb(struct tevent_context *ev,
exit(ret ? 1 : 0);
}
-static void ctdb_mutex_rados_timer_cb(struct tevent_context *ev,
- struct tevent_timer *te,
- struct timeval current_time,
- void *private_data)
+static void ctdb_mutex_rados_ppid_timer_cb(struct tevent_context *ev,
+ struct tevent_timer *te,
+ struct timeval current_time,
+ void *private_data)
{
struct ctdb_mutex_rados_state *cmr_state = private_data;
int ret = 0;
@@ -182,11 +182,12 @@ static void ctdb_mutex_rados_timer_cb(struct tevent_context *ev,
if ((kill(cmr_state->ppid, 0) == 0) || (errno != ESRCH)) {
/* parent still around, keep waiting */
- cmr_state->timer_ev = tevent_add_timer(cmr_state->ev, cmr_state,
+ cmr_state->ppid_timer_ev = tevent_add_timer(cmr_state->ev,
+ cmr_state,
tevent_timeval_current_ofs(5, 0),
- ctdb_mutex_rados_timer_cb,
- cmr_state);
- if (cmr_state->timer_ev == NULL) {
+ ctdb_mutex_rados_ppid_timer_cb,
+ cmr_state);
+ if (cmr_state->ppid_timer_ev == NULL) {
fprintf(stderr, "Failed to create timer event\n");
/* rely on signal cb */
}
@@ -291,11 +292,11 @@ int main(int argc, char *argv[])
}
/* periodically check parent */
- cmr_state->timer_ev = tevent_add_timer(cmr_state->ev, cmr_state,
+ cmr_state->ppid_timer_ev = tevent_add_timer(cmr_state->ev, cmr_state,
tevent_timeval_current_ofs(5, 0),
- ctdb_mutex_rados_timer_cb,
+ ctdb_mutex_rados_ppid_timer_cb,
cmr_state);
- if (cmr_state->timer_ev == NULL) {
+ if (cmr_state->ppid_timer_ev == NULL) {
fprintf(stderr, "Failed to create timer event\n");
fprintf(stdout, CTDB_MUTEX_STATUS_ERROR);
ret = -ENOMEM;