#include "rgw_common.h"
#include "rgw_acl.h"
#include "rgw_string.h"
+#include "rgw_rados.h"
#include "common/ceph_crypto.h"
#include "common/armor.h"
return false;
}
+void rgw_raw_obj::decode_from_rgw_obj(bufferlist::iterator& bl)
+{
+ rgw_obj old_obj;
+ ::decode(old_obj, bl);
+
+ RGWRados::obj_to_raw(old_obj, this);
+}
+
std::string rgw_bucket::get_key(char tenant_delim, char id_delim) const
{
static constexpr size_t shard_len{12}; // ":4294967295\0"
::encode(loc, bl);
ENCODE_FINISH(bl);
}
+
+ void decode_from_rgw_obj(bufferlist::iterator& bl);
+
void decode(bufferlist::iterator& bl) {
- DECODE_START(6, bl);
-#warning decode old rgw_obj
+ unsigned ofs = bl.get_off();
+ DECODE_START(6, bl);
+ if (struct_v < 6) {
+ /*
+ * this object was encoded as rgw_obj, prior to rgw_raw_obj been split out of it,
+ * let's decode it as rgw_obj and convert it
+ */
+ bl.seek(ofs);
+ decode_from_rgw_obj(bl);
+ return;
+ }
::decode(pool, bl);
::decode(oid, bl);
::decode(loc, bl);
}
int get_raw_obj_ref(const rgw_raw_obj& obj, rgw_rados_ref *ref, rgw_pool *pool = NULL);
- void obj_to_raw(const rgw_obj& obj, rgw_raw_obj *raw_obj);
+ static void obj_to_raw(const rgw_obj& obj, rgw_raw_obj *raw_obj);
int list_raw_objects(const rgw_pool& pool, const string& prefix_filter, int max,
RGWListRawObjsCtx& ctx, list<string>& oids,