]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Add cast from bucket_index_log_layout
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 14 May 2021 19:26:42 +0000 (15:26 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 1 Feb 2022 19:15:49 +0000 (14:15 -0500)
To bucket_index_layout_generation

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_bucket_layout.h

index 6ca62e233a521585b4939e1e43b5a3f0580112ef..ccc1595f8138c4c6a9cfa82a0bae5b5a02a48c62 100644 (file)
@@ -69,7 +69,6 @@ void decode(bucket_index_layout& l, bufferlist::const_iterator& bl);
 void encode_json_impl(const char *name, const bucket_index_layout& l, ceph::Formatter *f);
 void decode_json_obj(bucket_index_layout& l, JSONObj *obj);
 
-
 struct bucket_index_layout_generation {
   uint64_t gen = 0;
   bucket_index_layout layout;
@@ -104,6 +103,13 @@ inline std::ostream& operator<<(std::ostream& out, const BucketLogType &log_type
 struct bucket_index_log_layout {
   uint64_t gen = 0;
   bucket_index_normal_layout layout;
+  operator bucket_index_layout_generation() const {
+    bucket_index_layout_generation bilg;
+    bilg.gen = gen;
+    bilg.layout.type = BucketIndexType::Normal;
+    bilg.layout.normal = layout;
+    return bilg;
+  }
 };
 
 void encode(const bucket_index_log_layout& l, bufferlist& bl, uint64_t f=0);
@@ -122,7 +128,6 @@ void decode(bucket_log_layout& l, bufferlist::const_iterator& bl);
 void encode_json_impl(const char *name, const bucket_log_layout& l, ceph::Formatter *f);
 void decode_json_obj(bucket_log_layout& l, JSONObj *obj);
 
-
 struct bucket_log_layout_generation {
   uint64_t gen = 0;
   bucket_log_layout layout;