From: Yehuda Sadeh Date: Tue, 22 Oct 2019 22:17:50 +0000 (-0700) Subject: rgw: rgw_bucket operator fixes X-Git-Tag: v15.1.0~22^2~88 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b831b2e70dd5d24a137b53b6b2aee6d1f48cfc9e;p=ceph.git rgw: rgw_bucket operator fixes Fix smaller-than operator, ostream operator. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 8c3872cf2ae4..ce206281146d 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -1265,11 +1265,19 @@ struct rgw_bucket { rgw_bucket& operator=(const rgw_bucket&) = default; bool operator<(const rgw_bucket& b) const { - if (tenant == b.tenant) { - return name < b.name; - } else { - return tenant < b.tenant; + if (name < b.name) { + return true; + } else if (name > b.name) { + return false; + } + + if (bucket_id < b.bucket_id) { + return true; + } else if (bucket_id > b.bucket_id) { + return false; } + + return (tenant < b.tenant); } bool operator==(const rgw_bucket& b) const { @@ -1284,7 +1292,7 @@ struct rgw_bucket { WRITE_CLASS_ENCODER(rgw_bucket) inline ostream& operator<<(ostream& out, const rgw_bucket &b) { - out << b.tenant << ":" << b.name << "[" << b.marker << "])"; + out << b.tenant << ":" << b.name << "[" << b.bucket_id << "])"; return out; }