RGWObjManifestPart() : loc_ofs(0), size(0) {}
void encode(bufferlist& bl) const {
- __u32 ver = 1;
- ::encode(ver, bl);
+ ENCODE_START(2, 2, bl);
::encode(loc, bl);
::encode(loc_ofs, bl);
::encode(size, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u32 ver;
- ::decode(ver, bl);
+ DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl);
::decode(loc, bl);
::decode(loc_ofs, bl);
::decode(size, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(RGWObjManifestPart);
RGWObjManifest() : obj_size(0) {}
void encode(bufferlist& bl) const {
- __u32 ver = 1;
- ::encode(ver, bl);
+ ENCODE_START(2, 2, bl);
::encode(obj_size, bl);
::encode(objs, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u32 ver;
- ::decode(ver, bl);
+ DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl);
::decode(obj_size, bl);
::decode(objs, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(RGWObjManifest);
void set_permissions(int perm) { flags = perm; }
void encode(bufferlist& bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(flags, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(flags, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(ACLPermission)
void set(ACLGranteeTypeEnum t) { type = t; }
// virtual void set(const char *s) = 0;
void encode(bufferlist& bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(type, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(type, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(ACLGranteeType)
ACLGroupTypeEnum get_group() { return group; }
void encode(bufferlist& bl) const {
- __u8 struct_v = 2;
- ::encode(struct_v, bl);
+ ENCODE_START(3, 3, bl);
::encode(type, bl);
::encode(id, bl);
string uri;
::encode(name, bl);
__u32 g = (__u32)group;
::encode(g, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
::decode(type, bl);
::decode(id, bl);
string uri;
} else {
group = uri_to_group(uri);
}
+ DECODE_FINISH(bl);
}
ACLGroupTypeEnum uri_to_group(string& uri);
int get_perm(string& id, int perm_mask);
int get_group_perm(ACLGroupTypeEnum group, int perm_mask);
void encode(bufferlist& bl) const {
- __u8 struct_v = 2;
- ::encode(struct_v, bl);
+ ENCODE_START(3, 3, bl);
bool maps_initialized = true;
::encode(maps_initialized, bl);
::encode(acl_user_map, bl);
::encode(grant_map, bl);
::encode(acl_group_map, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
bool maps_initialized;
::decode(maps_initialized, bl);
::decode(acl_user_map, bl);
_add_grant(&grant);
}
}
+ DECODE_FINISH(bl);
}
void add_grant(ACLGrant *grant);
~ACLOwner() {}
void encode(bufferlist& bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(id, bl);
::encode(display_name, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(id, bl);
::decode(display_name, bl);
+ DECODE_FINISH(bl);
}
void set_id(string& _id) { id = _id; }
void set_name(string& name) { display_name = name; }
bool verify_permission(string& uid, int user_perm_mask, int perm);
void encode(bufferlist& bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(owner, bl);
::encode(acl, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(owner, bl);
::decode(acl, bl);
+ DECODE_FINISH(bl);
}
void decode_owner(bufferlist::iterator& bl) { // sometimes we only need that, should be faster
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(owner, bl);
+ DECODE_FINISH(bl);
}
void set_owner(ACLOwner& o) { owner = o; }
ObjectMetaInfo() : size(0), mtime(0) {}
void encode(bufferlist& bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(size, bl);
utime_t t(mtime, 0);
::encode(t, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(struct_v, bl);
::decode(size, bl);
utime_t t;
::decode(t, bl);
mtime = t.sec();
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(ObjectMetaInfo)
ObjectCacheInfo() : status(0), flags(0) {}
void encode(bufferlist& bl) const {
- __u8 struct_v = 2;
- ::encode(struct_v, bl);
+ ENCODE_START(3, 3, bl);
::encode(status, bl);
::encode(flags, bl);
::encode(data, bl);
::encode(xattrs, bl);
::encode(meta, bl);
::encode(rm_xattrs, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
::decode(status, bl);
::decode(flags, bl);
::decode(data, bl);
::decode(meta, bl);
if (struct_v >= 2)
::decode(rm_xattrs, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(ObjectCacheInfo)
RGWCacheNotifyInfo() : op(0), ofs(0) {}
void encode(bufferlist& obl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, obl);
+ ENCODE_START(2, 2, obl);
::encode(op, obl);
::encode(obj, obl);
::encode(obj_info, obl);
::encode(ofs, obl);
::encode(ns, obl);
+ ENCODE_FINISH(obl);
}
void decode(bufferlist::iterator& ibl) {
- __u8 struct_v;
- ::decode(struct_v, ibl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, ibl);
::decode(op, ibl);
::decode(obj, ibl);
::decode(obj_info, ibl);
::decode(ofs, ibl);
::decode(ns, ibl);
+ DECODE_FINISH(ibl);
}
};
WRITE_CLASS_ENCODER(RGWCacheNotifyInfo)
uint8_t op;
void encode(bufferlist &bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
uint8_t s = (uint8_t)state;
::encode(s, bl);
::encode(timestamp, bl);
::encode(op, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
uint8_t s;
::decode(s, bl);
state = (RGWPendingState)s;
::decode(timestamp, bl);
::decode(op, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_bucket_pending_info)
category(0), size(0) { mtime.set_from_double(0); }
void encode(bufferlist &bl) const {
- __u8 struct_v = 2;
- ::encode(struct_v, bl);
+ ENCODE_START(3, 3, bl);
::encode(category, bl);
::encode(size, bl);
::encode(mtime, bl);
::encode(owner, bl);
::encode(owner_display_name, bl);
::encode(content_type, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
::decode(category, bl);
::decode(size, bl);
::decode(mtime, bl);
::decode(owner_display_name, bl);
if (struct_v >= 2)
::decode(content_type, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_bucket_dir_entry_meta)
epoch(0), exists(false) {}
void encode(bufferlist &bl) const {
- __u8 struct_v = 2;
- if (!locator.size()) {
- struct_v = 1; // don't waste space encoding it
- }
+ ENCODE_START(3, 3, bl);
::encode(struct_v, bl);
::encode(name, bl);
::encode(epoch, bl);
::encode(exists, bl);
::encode(meta, bl);
::encode(pending_map, bl);
- if (locator.size()) {
- ::encode(locator, bl);
- }
+ ::encode(locator, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
::decode(name, bl);
::decode(epoch, bl);
::decode(exists, bl);
if (struct_v >= 2) {
::decode(locator, bl);
}
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_bucket_dir_entry)
uint64_t num_entries;
void encode(bufferlist &bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(total_size, bl);
::encode(total_size_rounded, bl);
::encode(num_entries, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(total_size, bl);
::decode(total_size_rounded, bl);
::decode(num_entries, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_bucket_category_stats)
map<uint8_t, rgw_bucket_category_stats> stats;
void encode(bufferlist &bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(stats, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(stats, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_bucket_dir_header)
std::map<string, struct rgw_bucket_dir_entry> m;
void encode(bufferlist &bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(header, bl);
::encode(m, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(header, bl);
::decode(m, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_bucket_dir)
string locator;
void encode(bufferlist &bl) const {
- __u8 struct_v = 2;
- if (!locator.size()) {
- struct_v = 1; // don't waste the encoding space
- }
- ::encode(struct_v, bl);
+ ENCODE_START(3, 3, bl);
::encode(op, bl);
::encode(name, bl);
::encode(tag, bl);
- if (locator.size()) {
- ::encode(locator, bl);
- }
+ ::encode(locator, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
::decode(op, bl);
::decode(name, bl);
::decode(tag, bl);
if (struct_v >= 2) {
::decode(locator, bl);
}
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_cls_obj_prepare_op)
string tag;
void encode(bufferlist &bl) const {
- __u8 struct_v = 2;
- if (!locator.size()) {
- struct_v = 1; // don't waste the encoding space
- }
- ::encode(struct_v, bl);
+ ENCODE_START(3, 3, bl);
::encode(op, bl);
::encode(name, bl);
::encode(epoch, bl);
::encode(meta, bl);
::encode(tag, bl);
- if (locator.size()) {
- ::encode(locator, bl);
- }
+ ::encode(locator, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
::decode(op, bl);
::decode(name, bl);
::decode(epoch, bl);
if (struct_v >= 2) {
::decode(locator, bl);
}
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_cls_obj_complete_op)
uint32_t num_entries;
void encode(bufferlist &bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(start_obj, bl);
::encode(num_entries, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(start_obj, bl);
::decode(num_entries, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_cls_list_op)
bool is_truncated;
void encode(bufferlist &bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(dir, bl);
::encode(is_truncated, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(dir, bl);
::decode(is_truncated, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_cls_list_ret)
#define RGW_BUCKETS_OBJ_PREFIX ".buckets"
-#define USER_INFO_VER 8
-
#define RGW_MAX_CHUNK_SIZE (512*1024)
#define RGW_MAX_PENDING_CHUNKS 16
#define RGW_MAX_PUT_SIZE (5ULL*1024*1024*1024)
RGWAccessKey() {}
void encode(bufferlist& bl) const {
- __u32 ver = 1;
- ::encode(ver, bl);
+ ENCODE_START(2, 2, bl);
::encode(id, bl);
::encode(key, bl);
::encode(subuser, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u32 ver;
- ::decode(ver, bl);
+ DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl);
::decode(id, bl);
::decode(key, bl);
::decode(subuser, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(RGWAccessKey);
RGWSubUser() : perm_mask(0) {}
void encode(bufferlist& bl) const {
- __u32 ver = 1;
- ::encode(ver, bl);
+ ENCODE_START(2, 2, bl);
::encode(name, bl);
::encode(perm_mask, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u32 ver;
- ::decode(ver, bl);
+ DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl);
::decode(name, bl);
::decode(perm_mask, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(RGWSubUser);
RGWUserInfo() : auid(0), suspended(0) {}
void encode(bufferlist& bl) const {
- __u32 ver = USER_INFO_VER;
- ::encode(ver, bl);
+ ENCODE_START(9, 9, bl);
::encode(auid, bl);
string access_key;
string secret_key;
::encode(subusers, bl);
::encode(suspended, bl);
::encode(swift_keys, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u32 ver;
- ::decode(ver, bl);
- if (ver >= 2) ::decode(auid, bl);
+ DECODE_START_LEGACY_COMPAT_LEN_32(9, 9, 9, bl);
+ if (struct_v >= 2) ::decode(auid, bl);
else auid = CEPH_AUTH_UID_DEFAULT;
string access_key;
string secret_key;
::decode(access_key, bl);
::decode(secret_key, bl);
- if (ver < 6) {
+ if (struct_v < 6) {
RGWAccessKey k;
k.id = access_key;
k.key = secret_key;
::decode(user_email, bl);
string swift_name;
string swift_key;
- if (ver >= 3) ::decode(swift_name, bl);
- if (ver >= 4) ::decode(swift_key, bl);
- if (ver >= 5)
+ if (struct_v >= 3) ::decode(swift_name, bl);
+ if (struct_v >= 4) ::decode(swift_key, bl);
+ if (struct_v >= 5)
::decode(user_id, bl);
else
user_id = access_key;
- if (ver >= 6) {
+ if (struct_v >= 6) {
::decode(access_keys, bl);
::decode(subusers, bl);
}
suspended = 0;
- if (ver >= 7) {
+ if (struct_v >= 7) {
::decode(suspended, bl);
}
- if (ver >= 8) {
+ if (struct_v >= 8) {
::decode(swift_keys, bl);
}
+ DECODE_FINISH(bl);
}
void clear() {
}
void encode(bufferlist& bl) const {
- __u8 struct_v = 2;
- ::encode(struct_v, bl);
+ ENCODE_START(3, 3, bl);
::encode(name, bl);
::encode(pool, bl);
::encode(marker, bl);
::encode(bucket_id, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
::decode(name, bl);
::decode(pool, bl);
if (struct_v >= 2) {
::decode(marker, bl);
::decode(bucket_id, bl);
}
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(rgw_bucket)
uint32_t flags;
void encode(bufferlist& bl) const {
- __u32 ver = 3;
- ::encode(ver, bl);
+ ENCODE_START(4, 4, bl);
::encode(bucket, bl);
::encode(owner, bl);
::encode(flags, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u32 ver;
- ::decode(ver, bl);
+ DECODE_START_LEGACY_COMPAT_LEN_32(4, 4, 4, bl);
::decode(bucket, bl);
- if (ver >= 2)
+ if (struct_v >= 2)
::decode(owner, bl);
- if (ver >= 3)
+ if (struct_v >= 3)
::decode(flags, bl);
+ DECODE_FINISH(bl);
}
RGWBucketInfo() : flags(0) {}
RGWBucketEnt() : size(0), size_rounded(0), mtime(0), count(0) {}
void encode(bufferlist& bl) const {
- __u8 struct_v = 4;
- ::encode(struct_v, bl);
+ ENCODE_START(5, 5, bl);
uint64_t s = size;
__u32 mt = mtime;
string empty_str; // originally had the bucket name here, but we encode bucket later
::encode(bucket, bl);
s = size_rounded;
::encode(s, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(5, 5, 5, bl);
__u32 mt;
uint64_t s;
string empty_str; // backward compatibility
if (struct_v >= 4)
::decode(s, bl);
size_rounded = s;
+ DECODE_FINISH(bl);
}
void clear() {
bucket.clear();
utime_t modified;
void encode(bufferlist& bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(num, bl);
::encode(size, bl);
::encode(etag, bl);
::encode(modified, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(num, bl);
::decode(size, bl);
::decode(etag, bl);
::decode(modified, bl);
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(RGWUploadPartInfo)
}
void encode(bufferlist& bl) const {
- __u8 struct_v = 2;
- ::encode(struct_v, bl);
+ ENCODE_START(3, 3, bl);
::encode(bucket.name, bl);
::encode(key, bl);
::encode(ns, bl);
::encode(object, bl);
::encode(bucket, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
::decode(bucket.name, bl);
::decode(key, bl);
::decode(ns, bl);
::decode(object, bl);
if (struct_v >= 2)
::decode(bucket, bl);
+ DECODE_FINISH(bl);
}
bool operator==(const rgw_obj& o) const {
#include "rgw_common.h"
#include "include/utime.h"
-#define LOG_ENTRY_VER 4
-#define INTENT_LOG_ENTRY_VER 1
-
#define RGW_SHOULD_LOG_DEFAULT 1
#define RGW_LOG_POOL_NAME ".log"
uint64_t bucket_id;
void encode(bufferlist &bl) const {
- uint8_t ver;
- ver = LOG_ENTRY_VER;
- ::encode(ver, bl);
+ ENCODE_START(5, 5, bl);
::encode(object_owner, bl);
::encode(bucket_owner, bl);
::encode(bucket, bl);
::encode(referrer, bl);
::encode(bytes_received, bl);
::encode(bucket_id, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &p) {
- uint8_t ver;
- ::decode(ver, p);
+ DECODE_START_LEGACY_COMPAT_LEN(5, 5, 5, p);
::decode(object_owner, p);
- if (ver > 3)
+ if (struct_v > 3)
::decode(bucket_owner, p);
::decode(bucket, p);
::decode(time, p);
::decode(total_time, p);
::decode(user_agent, p);
::decode(referrer, p);
- if (ver >= 2)
+ if (struct_v >= 2)
::decode(bytes_received, p);
else
bytes_received = 0;
- if (ver >= 3)
+ if (struct_v >= 3)
::decode(bucket_id, p);
else
bucket_id = -1;
+ DECODE_FINISH(p);
}
};
WRITE_CLASS_ENCODER(rgw_log_entry)
uint32_t intent;
void encode(bufferlist &bl) const {
- uint8_t ver;
- ver = INTENT_LOG_ENTRY_VER;
- ::encode(ver, bl);
+ ENCODE_START(2, 2, bl);
+ ::encode(struct_v, bl);
::encode(obj, bl);
::encode(op_time, bl);
::encode(intent, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &p) {
- uint8_t ver;
- ::decode(ver, p);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, p);
::decode(obj, p);
::decode(op_time, p);
::decode(intent, p);
+ DECODE_FINISH(p);
}
};
WRITE_CLASS_ENCODER(rgw_intent_log_entry)