summaryrefslogtreecommitdiff
path: root/ctdb/utils
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2018-07-17 23:36:36 +0200
committerKarolin Seeger <kseeger@samba.org>2018-08-21 11:47:25 +0200
commit3ec4c73a53ec8a9d7d73aad3c88b86e73cbb07fc (patch)
treecf690dc50f4b5fc7cf7d6fff4f3bd04c3d094116 /ctdb/utils
parent05295db70482c35d58ef4a9d541b3ff508769af6 (diff)
downloadsamba-3ec4c73a53ec8a9d7d73aad3c88b86e73cbb07fc.tar.gz
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)
Diffstat (limited to 'ctdb/utils')
-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;