]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/pick_address: conditional compile for crimson
authorKefu Chai <kchai@redhat.com>
Thu, 31 Jan 2019 04:22:44 +0000 (12:22 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 2 Feb 2019 05:20:00 +0000 (13:20 +0800)
crimson can only update configuration async, so we cannot let
pick_addreses() call set_val_or_die() without chaning its function
signature.

for implementing crimson-osd, what we need is only a single
pick_addresses() variant, which returns entity_addrvec_t. so we just
enable it if WITH_SEASTAR is defined instead of adding a wrapper or
reimplement all pick_addresses() variants for crimson-osd.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/pick_address.cc
src/common/pick_address.h

index e9a7f1f64269385470ceba793d6a5f5051da60d9..d8f261c1529e22d782714e6133807c06154b5a53 100644 (file)
@@ -16,7 +16,9 @@
 #include "include/ipaddr.h"
 #include "include/str_list.h"
 #include "common/ceph_context.h"
+#ifndef WITH_SEASTAR
 #include "common/config_obs.h"
+#endif
 #include "common/debug.h"
 #include "common/errno.h"
 #include "common/numa.h"
@@ -115,6 +117,7 @@ const struct sockaddr *find_ip_in_subnet_list(
   return r;
 }
 
+#ifndef WITH_SEASTAR
 // observe this change
 struct Observer : public md_config_obs_t {
   const char *keys[2];
@@ -219,6 +222,7 @@ void pick_addresses(CephContext *cct, int needs)
 
   freeifaddrs(ifa);
 }
+#endif // !WITH_SEASTAR
 
 static int fill_in_one_address(
   CephContext *cct,
index 2eccfd360e90bac60cdcb9dae6f467483f4942d3..1f83b71e47f94a91c90769f20d252888bf88932e 100644 (file)
@@ -18,6 +18,7 @@ class entity_addrvec_t;
 #define CEPH_PICK_ADDRESS_PREFER_IPV4 0x40
 #define CEPH_PICK_ADDRESS_DEFAULT_MON_PORTS  0x80
 
+#ifndef WITH_SEASTAR
 /*
   Pick addresses based on subnets if needed.
 
@@ -39,6 +40,8 @@ class entity_addrvec_t;
  */
 void pick_addresses(CephContext *cct, int needs);
 
+#endif // !WITH_SEASTAR
+
 int pick_addresses(CephContext *cct, unsigned flags, entity_addrvec_t *addrs,
                   int preferred_numa_node = -1);
 int pick_addresses(CephContext *cct, unsigned flags, struct ifaddrs *ifa,