]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: pretty-print fh_key 29277/head
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 5 Jun 2019 14:40:08 +0000 (10:40 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 24 Jul 2019 14:39:08 +0000 (16:39 +0200)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 84a2c22108a3d15b836680894ba750b637e49cd2)

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

index b2e20c4c4980ce69fdc53348e6652c4601c0874c..3ab675682f0cd03a41aee3b45a9d27036bd9a871 100644 (file)
@@ -816,6 +816,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 025854c681479f0c4a668462c9f45658832f8dac..eade60cff8f606aa74ada893a4201f2e7b357088 100644 (file)
@@ -142,6 +142,9 @@ namespace rgw {
       }
       DECODE_FINISH(bl);
     }
+
+    friend std::ostream& operator<<(std::ostream &os, fh_key const &fhk);
+
   }; /* fh_key */
 
   WRITE_CLASS_ENCODER(fh_key);
@@ -1047,15 +1050,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*/,