]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: pretty-print fh_key 28854/head
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 5 Jun 2019 14:40:08 +0000 (10:40 -0400)
committerPrashant D <pdhange@redhat.com>
Wed, 3 Jul 2019 01:46:23 +0000 (21:46 -0400)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 84a2c22108a3d15b836680894ba750b637e49cd2)

src/rgw/rgw_file.cc
src/rgw/rgw_file.h

index 00c197d07ff0b1747442f3b93cb0dc02f491a5e4..75141a552ef852d5555d762644da884065893572 100644 (file)
@@ -942,6 +942,15 @@ namespace rgw {
     rele();
   } /* RGWLibFS::close */
 
+  inline std::ostream& operator<<(std::ostream &os, fh_key const &fhk) {
+    os << "<fh_key: bucket=";
+    os << fhk.fh_hk.bucket;
+    os << "; object=";
+    os << fhk.fh_hk.object;
+    os << ">";
+    return os;
+  }
+
   inline std::ostream& operator<<(std::ostream &os, struct timespec const &ts) {
       os << "<timespec: tv_sec=";
       os << ts.tv_sec;
index bb5e617c6d1c6131061300672906c69055784a07..741f35c8ee7001e25dec0d984ed79ee8eb605d8f 100644 (file)
@@ -144,6 +144,9 @@ namespace rgw {
       }
       DECODE_FINISH(bl);
     }
+
+    friend std::ostream& operator<<(std::ostream &os, fh_key const &fhk);
+
   }; /* fh_key */
 
   WRITE_CLASS_ENCODER(fh_key);
@@ -1055,15 +1058,15 @@ namespace rgw {
 
       std::string obj_name{name};
       std::string key_name{parent->make_key_name(name)};
+      fh_key fhk = parent->make_fhk(obj_name);
 
       lsubdout(get_context(), rgw, 10)
        << __func__ << " lookup called on "
        << parent->object_name() << " for " << key_name
        << " (" << obj_name << ")"
+       << " -> " << fhk
        << dendl;
 
-      fh_key fhk = parent->make_fhk(obj_name);
-
     retry:
       RGWFileHandle* fh =
        fh_cache.find_latch(fhk.fh_hk.object /* partition selector*/,