From 18a237816419e6f88ab0383b43d8060914d26a9a Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Thu, 15 Sep 2011 11:23:08 -0700 Subject: [PATCH] notifiers: Rename run and wait functions. It makes more sense to call nln_notifier_run() and nln_notifier_wait() simply nln_run() and nln_wait() since they don't operate on notifiers but the entire nln object. This patch changes the nln and the rtnetlink-link modules to the new convention. --- lib/dpif-linux.c | 4 ++-- lib/netdev-linux.c | 4 ++-- lib/netlink-notifier.c | 6 +++--- lib/netlink-notifier.h | 4 ++-- lib/route-table.c | 8 ++++---- lib/rtnetlink-link.c | 8 ++++---- lib/rtnetlink-link.h | 4 ++-- vswitchd/ovs-brcompatd.c | 6 +++--- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index 3d081aab..ee487951 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -320,7 +320,7 @@ static void dpif_linux_run(struct dpif *dpif OVS_UNUSED) { if (nln) { - nln_notifier_run(nln); + nln_run(nln); } } @@ -328,7 +328,7 @@ static void dpif_linux_wait(struct dpif *dpif OVS_UNUSED) { if (nln) { - nln_notifier_wait(nln); + nln_wait(nln); } } diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index ee3c5f52..cc930e1d 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -469,14 +469,14 @@ netdev_linux_init(void) static void netdev_linux_run(void) { - rtnetlink_link_notifier_run(); + rtnetlink_link_run(); netdev_linux_miimon_run(); } static void netdev_linux_wait(void) { - rtnetlink_link_notifier_wait(); + rtnetlink_link_wait(); netdev_linux_miimon_wait(); } diff --git a/lib/netlink-notifier.c b/lib/netlink-notifier.c index 1b7529dd..d0a031b2 100644 --- a/lib/netlink-notifier.c +++ b/lib/netlink-notifier.c @@ -109,7 +109,7 @@ nln_notifier_register(struct nln *nln, struct nln_notifier *notifier, } else { /* Catch up on notification work so that the new notifier won't * receive any stale notifications. */ - nln_notifier_run(nln); + nln_run(nln); } list_push_back(&nln->all_notifiers, ¬ifier->node); @@ -133,7 +133,7 @@ nln_notifier_unregister(struct nln *nln, struct nln_notifier *notifier) /* Calls all of the registered notifiers, passing along any as-yet-unreported * change events. */ void -nln_notifier_run(struct nln *nln) +nln_run(struct nln *nln) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); @@ -171,7 +171,7 @@ nln_notifier_run(struct nln *nln) /* Causes poll_block() to wake up when change notifications are ready. */ void -nln_notifier_wait(struct nln *nln) +nln_wait(struct nln *nln) { nln->has_run = false; if (nln->notify_sock) { diff --git a/lib/netlink-notifier.h b/lib/netlink-notifier.h index 60b5991b..e3dacef0 100644 --- a/lib/netlink-notifier.h +++ b/lib/netlink-notifier.h @@ -49,6 +49,6 @@ void nln_destroy(struct nln *); int nln_notifier_register(struct nln *, struct nln_notifier *, nln_notify_func *, void *aux); void nln_notifier_unregister(struct nln *, struct nln_notifier *); -void nln_notifier_run(struct nln *); -void nln_notifier_wait(struct nln *); +void nln_run(struct nln *); +void nln_wait(struct nln *); #endif /* netlink-notifier.h */ diff --git a/lib/route-table.c b/lib/route-table.c index de335f57..c8245dfd 100644 --- a/lib/route-table.c +++ b/lib/route-table.c @@ -199,8 +199,8 @@ void route_table_run(void) { if (nln) { - rtnetlink_link_notifier_run(); - nln_notifier_run(nln); + rtnetlink_link_run(); + nln_run(nln); } } @@ -209,8 +209,8 @@ void route_table_wait(void) { if (nln) { - rtnetlink_link_notifier_wait(); - nln_notifier_wait(nln); + rtnetlink_link_wait(); + nln_wait(nln); } } diff --git a/lib/rtnetlink-link.c b/lib/rtnetlink-link.c index dbdf724b..eef07d69 100644 --- a/lib/rtnetlink-link.c +++ b/lib/rtnetlink-link.c @@ -109,19 +109,19 @@ rtnetlink_link_notifier_unregister(struct nln_notifier *notifier) /* Calls all of the registered notifiers, passing along any as-yet-unreported * netdev change events. */ void -rtnetlink_link_notifier_run(void) +rtnetlink_link_run(void) { if (nln) { - nln_notifier_run(nln); + nln_run(nln); } } /* Causes poll_block() to wake up when network device change notifications are * ready. */ void -rtnetlink_link_notifier_wait(void) +rtnetlink_link_wait(void) { if (nln) { - nln_notifier_wait(nln); + nln_wait(nln); } } diff --git a/lib/rtnetlink-link.h b/lib/rtnetlink-link.h index 1e52a7dc..80fbd5cf 100644 --- a/lib/rtnetlink-link.h +++ b/lib/rtnetlink-link.h @@ -53,6 +53,6 @@ bool rtnetlink_link_parse(struct ofpbuf *buf, int rtnetlink_link_notifier_register(struct nln_notifier*, rtnetlink_link_notify_func *, void *aux); void rtnetlink_link_notifier_unregister(struct nln_notifier *); -void rtnetlink_link_notifier_run(void); -void rtnetlink_link_notifier_wait(void); +void rtnetlink_link_run(void); +void rtnetlink_link_wait(void); #endif /* rtnetlink-link.h */ diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c index bfa13ca2..df2b75da 100644 --- a/vswitchd/ovs-brcompatd.c +++ b/vswitchd/ovs-brcompatd.c @@ -724,7 +724,7 @@ brc_recv_update(void) * (XenServer Tools 5.5.0 does not exhibit this behavior, and neither does * a VM without Tools installed at all.) */ - rtnetlink_link_notifier_run(); + rtnetlink_link_run(); switch (genlmsghdr->cmd) { case BRC_GENL_C_DP_ADD: @@ -830,14 +830,14 @@ main(int argc, char *argv[]) for (;;) { unixctl_server_run(unixctl); - rtnetlink_link_notifier_run(); + rtnetlink_link_run(); brc_recv_update(); netdev_run(); nl_sock_wait(brc_sock, POLLIN); unixctl_server_wait(unixctl); - rtnetlink_link_notifier_wait(); + rtnetlink_link_wait(); netdev_wait(); poll_block(); } -- 2.30.2