]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: rename set_ip() -> set_addr_unknowns()
authorGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 23 Mar 2012 20:32:46 +0000 (13:32 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Tue, 3 Apr 2012 20:21:25 +0000 (13:21 -0700)
The generic interface shouldn't reference specifics like that.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/msg/Messenger.h
src/msg/SimpleMessenger.cc
src/msg/SimpleMessenger.h
src/osd/OSD.cc

index 276f2c76f692a2fa8470b1b7686a5f5f934aca7d..5fdec3eae09345f321cd993a942c307bbb81d98d 100644 (file)
@@ -102,7 +102,16 @@ protected:
    * believes to be its own.
    */
   const entity_addr_t& get_myaddr() { return my_inst.addr; }
-  virtual void set_ip(entity_addr_t &addr) = 0;
+  /**
+   * Set the unknown address components for this Messenger.
+   * This is useful if the Messenger doesn't know its full address just by
+   * binding, but another Messenger on the same interface has already learned
+   * its full address. This function does not fill in known address elements,
+   * cause a rebind, or do anything of that sort.
+   *
+   * @param addr The address to use as a template.
+   */
+  virtual void set_addr_unknowns(entity_addr_t &addr) = 0;
   const entity_inst_t& get_myinst() { return my_inst; }
   
   /**
index 0107efc59c8739a129d1390caf367b956d9aeef8..3fef06d86c53e82139b9c601f7a06c9333fd08b1 100644 (file)
@@ -491,7 +491,7 @@ int SimpleMessenger::lazy_send_message(Message *m, const entity_inst_t& dest)
  * If my_inst.addr doesn't have an IP set, this function
  * will fill it in from the passed addr. Otherwise it does nothing and returns.
  */
-void SimpleMessenger::set_ip(entity_addr_t &addr)
+void SimpleMessenger::set_addr_unknowns(entity_addr_t &addr)
 {
   if (my_inst.addr.is_blank_ip()) {
     int port = my_inst.addr.get_port();
index 51b6f65538e1041ea4055926fdc9a0a85b1292ed..0cfc1240bcab63981e211819b238c652658bc35d 100644 (file)
@@ -65,7 +65,7 @@ public:
    *
    * @param addr The IP address to set internally.
    */
-  void set_ip(entity_addr_t& addr);
+  void set_addr_unknowns(entity_addr_t& addr);
   /**
    * Retrieve the Connection for an endpoint.
    *
index 5a2c8cd6a332adfb6a58dbabde79cf02602d2099..787d4f7391ce90f12778550339466ec9d587c440 100644 (file)
@@ -2008,7 +2008,7 @@ void OSD::send_boot()
     int port = cluster_addr.get_port();
     cluster_addr = client_messenger->get_myaddr();
     cluster_addr.set_port(port);
-    cluster_messenger->set_ip(cluster_addr);
+    cluster_messenger->set_addr_unknowns(cluster_addr);
     dout(10) << " assuming cluster_addr ip matches client_addr" << dendl;
   }
   entity_addr_t hb_addr = hbserver_messenger->get_myaddr();
@@ -2016,7 +2016,7 @@ void OSD::send_boot()
     int port = hb_addr.get_port();
     hb_addr = cluster_addr;
     hb_addr.set_port(port);
-    hbserver_messenger->set_ip(hb_addr);
+    hbserver_messenger->set_addr_unknowns(hb_addr);
     dout(10) << " assuming hb_addr ip matches cluster_addr" << dendl;
   }
   MOSDBoot *mboot = new MOSDBoot(superblock, hb_addr, cluster_addr);