Fixes: http://tracker.ceph.com/issues/24768
Signed-off-by: Kefu Chai <kchai@redhat.com>
map<string, bufferlist> attrs;
SetAttrsOp(const hobject_t &oid, map<string, bufferlist> &_attrs)
: oid(oid) {
+ for (auto& attr : attrs) {
+ attr.second.rebuild();
+ }
attrs.swap(_attrs);
}
SetAttrsOp(const hobject_t &oid, const string &key, bufferlist &val)
: oid(oid) {
- attrs.insert(make_pair(key, val));
+ val.rebuild();
+ attrs.emplace(key, val);
}
};
struct RmAttrOp {
const hobject_t &hoid,
map<string, bufferlist> &attrs
) {
+ for (auto& attr : attrs) {
+ attr.second.rebuild();
+ }
t.setattrs(get_coll(hoid), ghobject_t(hoid), attrs);
}
void setattr(
const string &attrname,
bufferlist &bl
) {
+ bl.rebuild();
t.setattr(get_coll(hoid), ghobject_t(hoid), attrname, bl);
}
void rmattr(