diff options
Diffstat (limited to 'svc_dev.c')
-rw-r--r-- | svc_dev.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -208,7 +208,7 @@ void mog_svc_devstats_subscribe(struct mog_mgmt *mgmt) struct mog_svc *svc = mgmt->svc; CHECK(int, 0, pthread_mutex_lock(&svc->devstats_lock)); - LIST_INSERT_HEAD(&svc->devstats_subscribers, mgmt, subscribed); + list_add(&svc->devstats_subscribers, &mgmt->subscribed); CHECK(int, 0, pthread_mutex_unlock(&svc->devstats_lock)); } @@ -228,7 +228,7 @@ bool mog_svc_devstats_broadcast(void *ent, void *ignored) if (len < 0) goto out; - LIST_FOREACH_SAFE(mgmt, &svc->devstats_subscribers, subscribed, tmp) { + list_for_each_safe(&svc->devstats_subscribers, mgmt, tmp, subscribed) { assert(mgmt->wbuf == NULL && "wbuf not null"); iov.iov_base = buf; iov.iov_len = (size_t)len; @@ -236,7 +236,7 @@ bool mog_svc_devstats_broadcast(void *ent, void *ignored) if (mgmt->wbuf == NULL) continue; /* success */ - LIST_REMOVE(mgmt, subscribed); + list_del(&mgmt->subscribed); mfd = mog_fd_of(mgmt); if (mgmt->wbuf == MOG_WR_ERROR) { assert(mgmt->rbuf == NULL && "would leak rbuf"); @@ -260,10 +260,10 @@ static bool devstats_shutdown_i(void *svcptr, void *ignored) struct mog_fd *mfd; CHECK(int, 0, pthread_mutex_lock(&svc->devstats_lock)); - LIST_FOREACH_SAFE(mgmt, &svc->devstats_subscribers, subscribed, tmp) { + list_for_each_safe(&svc->devstats_subscribers, mgmt, tmp, subscribed) { assert(mgmt->wbuf == NULL && "wbuf not null"); assert(mgmt->rbuf == NULL && "would leak rbuf"); - LIST_REMOVE(mgmt, subscribed); + list_del(&mgmt->subscribed); mfd = mog_fd_of(mgmt); mog_fd_put(mfd); } |