::encode(bufferlist(), bl);
::encode(old_inodes, bl);
::encode(oldest_snap, bl);
+ ::encode(damage_flags, bl);
}
void InodeStoreBase::encode(bufferlist &bl, const bufferlist *snap_blob) const
{
- ENCODE_START(5, 4, bl);
+ ENCODE_START(6, 4, bl);
encode_bare(bl, snap_blob);
ENCODE_FINISH(bl);
}
::decode(inode.layout, bl); // but we only care about the layout portion
}
}
- if (struct_v >= 5 && !bl.end())
- ::decode(oldest_snap, bl);
+
+ if (struct_v >= 5) {
+ // InodeStore is embedded in dentries without proper versioning, so
+ // we consume up to the end of the buffer
+ if (!bl.end()) {
+ ::decode(oldest_snap, bl);
+ }
+
+ if (!bl.end()) {
+ ::decode(damage_flags, bl);
+ }
+ }
}
fragtree_t dirfragtree; // dir frag tree, if any. always consistent with our dirfrag map.
compact_map<snapid_t, old_inode_t> old_inodes; // key = last, value.first = first
snapid_t oldest_snap;
+ damage_flags_t damage_flags;
InodeStoreBase() : oldest_snap(CEPH_NOSNAP) { }
*/
void fnode_t::encode(bufferlist &bl) const
{
- ENCODE_START(2, 2, bl);
+ ENCODE_START(3, 2, bl);
::encode(version, bl);
::encode(snap_purged_thru, bl);
::encode(fragstat, bl);
::encode(accounted_fragstat, bl);
::encode(rstat, bl);
::encode(accounted_rstat, bl);
+ ::encode(damage_flags, bl);
ENCODE_FINISH(bl);
}
void fnode_t::decode(bufferlist::iterator &bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
::decode(version, bl);
::decode(snap_purged_thru, bl);
::decode(fragstat, bl);
::decode(accounted_fragstat, bl);
::decode(rstat, bl);
::decode(accounted_rstat, bl);
+ if (struct_v >= 3) {
+ ::decode(damage_flags, bl);
+ }
DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(inline_data_t)
+enum {
+ DAMAGE_STATS, // statistics (dirstat, size, etc)
+ DAMAGE_RSTATS, // recursive statistics (rstat, accounted_rstat)
+ DAMAGE_FRAGTREE // fragtree -- repair by searching
+};
+typedef uint32_t damage_flags_t;
+
/*
* inode_t
*/
snapid_t snap_purged_thru; // the max_last_destroy snapid we've been purged thru
frag_info_t fragstat, accounted_fragstat;
nest_info_t rstat, accounted_rstat;
+ damage_flags_t damage_flags;
void encode(bufferlist &bl) const;
void decode(bufferlist::iterator& bl);