]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: instantiate the templates if WITH_SEASTAR
authorKefu Chai <kchai@redhat.com>
Tue, 28 Aug 2018 07:37:21 +0000 (15:37 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 6 Sep 2018 14:03:33 +0000 (22:03 +0800)
specialize class/method of LockPolicy::SINGLE `#ifdef WITH_SEASTAR`.
in long term, probably we can remove `LockPolicy`, as WITH_SEASTAR
implies `LockPolicy::SINGLE`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/auth/AuthClientHandler.cc
src/auth/RotatingKeyRing.cc
src/auth/cephx/CephxClientHandler.cc

index 1ac96a50c4f60e3b43f06ad657c8ee340c995cd3..fe0a5238f5495c8a4c9068dc56b443aefef5852d 100644 (file)
@@ -36,8 +36,16 @@ AuthClientHandler::create(CephContext *cct, int proto,
 }
 
 // explicitly instantiate only the classes we need
+#ifdef WITH_SEASTAR
+template AuthClientHandler*
+AuthClientHandler::create<ceph::LockPolicy::SINGLE>(
+  CephContext *cct,
+  int proto,
+  RotatingKeyRing<ceph::LockPolicy::SINGLE> *rkeys);
+#else
 template AuthClientHandler*
 AuthClientHandler::create<ceph::LockPolicy::MUTEX>(
   CephContext *cct,
   int proto,
   RotatingKeyRing<ceph::LockPolicy::MUTEX> *rkeys);
+#endif
index 196b1a120521871d88ad3a20d4b99e36dc78bee4..6fade65c8a01d6d30a7869bbf3fe1809696a8724 100644 (file)
@@ -79,4 +79,8 @@ KeyRing *RotatingKeyRing<lp>::get_keyring()
 }
 
 // explicitly instantiate only the classes we need
+#ifdef WITH_SEASTAR
+template class RotatingKeyRing<LockPolicy::SINGLE>;
+#else
 template class RotatingKeyRing<LockPolicy::MUTEX>;
+#endif
index 73e4c7e16d9fa10f2feaa64d0611bbfdcee16f64..3559fd7372866b281b6741507c77dd7cc8dda631 100644 (file)
@@ -252,4 +252,8 @@ bool CephxClientHandler<lp>::need_tickets()
 }
 
 // explicitly instantiate only the classes we need
+#ifdef WITH_SEASTAR
+template class CephxClientHandler<LockPolicy::SINGLE>;
+#else
 template class CephxClientHandler<LockPolicy::MUTEX>;
+#endif