]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: pretty-print fh_key 29309/head
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 5 Jun 2019 14:40:08 +0000 (10:40 -0400)
committerNathan Cutler <ncutler@suse.com>
Thu, 25 Jul 2019 16:06:15 +0000 (18:06 +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 301322223dbc403b8ebe6d6a9b16ba14dd4bdb98..076e420310329c3149c28960d56f6ec44b3ee2dc 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 e45aa58cb61ad1f00e0c8be67a44cb32fb7f0583..247d0e98ff25b2710878ff6853a56448e47408f8 100644 (file)
@@ -140,6 +140,9 @@ namespace rgw {
       }
       DECODE_FINISH(bl);
     }
+
+    friend std::ostream& operator<<(std::ostream &os, fh_key const &fhk);
+
   }; /* fh_key */
 
   WRITE_CLASS_ENCODER(fh_key);
@@ -1058,15 +1061,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*/,