From ca2d1b37d907362dfc18310365f10498e15c71be Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Sun, 7 Nov 2021 09:25:46 -0500 Subject: [PATCH] cls/rgw: move stream operator from rgw_common.h Signed-off-by: Casey Bodley --- src/cls/rgw/cls_rgw_types.h | 12 +++++++----- src/rgw/rgw_common.h | 8 -------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/cls/rgw/cls_rgw_types.h b/src/cls/rgw/cls_rgw_types.h index 3e30725606be7..7ad40d7edd072 100644 --- a/src/cls/rgw/cls_rgw_types.h +++ b/src/cls/rgw/cls_rgw_types.h @@ -376,11 +376,6 @@ struct cls_rgw_obj_key { return !(k < *this); } - std::ostream& operator<<(std::ostream& out) const { - out << to_string(); - return out; - } - void encode(ceph::buffer::list &bl) const { ENCODE_START(1, 1, bl); encode(name, bl); @@ -407,6 +402,13 @@ struct cls_rgw_obj_key { }; WRITE_CLASS_ENCODER(cls_rgw_obj_key) +inline std::ostream& operator<<(std::ostream& out, const cls_rgw_obj_key& o) { + out << o.name; + if (!o.instance.empty()) { + out << '[' << o.instance << ']'; + } + return out; +} struct rgw_bucket_dir_entry { /* a versioned object instance */ diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index eebf31e2dfe79..0a038d7e99c76 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -1492,14 +1492,6 @@ inline std::ostream& operator<<(std::ostream& out, const rgw_obj_key &o) { return out << o.to_str(); } -inline std::ostream& operator<<(std::ostream& out, const rgw_obj_index_key &o) { - if (o.instance.empty()) { - return out << o.name; - } else { - return out << o.name << "[" << o.instance << "]"; - } -} - struct req_init_state { /* Keeps [[tenant]:]bucket until we parse the token. */ std::string url_bucket; -- 2.39.5