Only call these if we have values to set on this iteration. This is
rarely true for omap.
Signed-off-by: Sage Weil <sage@redhat.com>
off += p.get_len();
}
- t->omap_setkeys(target_coll, target_oid, omap_entries);
- t->setattrs(target_coll, target_oid, attrs);
+ if (!omap_entries.empty())
+ t->omap_setkeys(target_coll, target_oid, omap_entries);
+ if (!attrs.empty())
+ t->setattrs(target_coll, target_oid, attrs);
if (complete) {
if (!first) {