]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
objclass: Utterly destroy g_ceph_context
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 8 Dec 2016 03:04:57 +0000 (22:04 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 22 Dec 2016 19:24:39 +0000 (14:24 -0500)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/objclass/class_api.cc

index a406baf872f250f4b8a84d030092773b2399d4bb..724842c1cb134f50a5e0f0f299abe64d2fd945e9 100644 (file)
 #include "auth/Crypto.h"
 #include "common/armor.h"
 
-static ClassHandler *ch;
+static constexpr int dout_subsys = ceph_subsys_objclass;
 
-#define dout_context g_ceph_context
-#define dout_subsys ceph_subsys_objclass
+static ClassHandler *ch;
 
 void cls_initialize(ClassHandler *h)
 {
@@ -643,14 +642,14 @@ int cls_gen_rand_base64(char *dest, int size) /* size should be the required str
 
   ret = cls_gen_random_bytes(buf, sizeof(buf));
   if (ret < 0) {
-    generic_derr << "cannot get random bytes: " << ret << dendl;
+    lgeneric_derr(ch->cct) << "cannot get random bytes: " << ret << dendl;
     return -1;
   }
 
   ret = ceph_armor(tmp_dest, &tmp_dest[sizeof(tmp_dest)],
                   (const char *)buf, ((const char *)buf) + ((size - 1) * 3 + 4 - 1) / 4);
   if (ret < 0) {
-    generic_derr << "ceph_armor failed" << dendl;
+    lgeneric_derr(ch->cct) << "ceph_armor failed" << dendl;
     return -1;
   }
   tmp_dest[ret] = '\0';
@@ -711,7 +710,7 @@ int cls_log(int level, const char *format, ...)
      va_end(ap);
 #define MAX_SIZE 8196
      if ((n > -1 && n < size) || size > MAX_SIZE) {
-       dout(level) << buf << dendl;
+       ldout(ch->cct, level) << buf << dendl;
        return n;
      }
      size *= 2;