notifiers: Rename run and wait functions.
authorEthan Jackson <ethan@nicira.com>
Thu, 15 Sep 2011 18:23:08 +0000 (11:23 -0700)
committerEthan Jackson <ethan@nicira.com>
Fri, 16 Sep 2011 18:22:30 +0000 (11:22 -0700)
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
lib/netdev-linux.c
lib/netlink-notifier.c
lib/netlink-notifier.h
lib/route-table.c
lib/rtnetlink-link.c
lib/rtnetlink-link.h
vswitchd/ovs-brcompatd.c

index 3d081aa..ee48795 100644 (file)
@@ -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);
     }
 }
 
index ee3c5f5..cc930e1 100644 (file)
@@ -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();
 }
 
index 1b7529d..d0a031b 100644 (file)
@@ -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, &notifier->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) {
index 60b5991..e3dacef 100644 (file)
@@ -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 */
index de335f5..c8245df 100644 (file)
@@ -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);
     }
 }
 
index dbdf724..eef07d6 100644 (file)
@@ -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);
     }
 }
index 1e52a7d..80fbd5c 100644 (file)
@@ -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 */
index bfa13ca..df2b75d 100644 (file)
@@ -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();
     }