mirror of
https://github.com/ceph/ceph
synced 2025-01-19 09:32:00 +00:00
Merge pull request #20701 from tchaikov/wip-23212
os/bluestore: recalc_allocated() when decoding bluefs_fnode_t Reviewed-by: Jianpeng Ma <jianpeng.ma@intel.com> Reviewed-by: Igor Fedotov <ifedotov@suse.com>
This commit is contained in:
commit
a1c4846fbc
@ -873,7 +873,6 @@ int BlueFS::_replay(bool noop, bool to_stdout)
|
||||
{
|
||||
bluefs_fnode_t fnode;
|
||||
decode(fnode, p);
|
||||
fnode.recalc_allocated();
|
||||
dout(20) << __func__ << " 0x" << std::hex << pos << std::dec
|
||||
<< ": op_file_update " << " " << fnode << dendl;
|
||||
if (unlikely(to_stdout)) {
|
||||
|
@ -54,7 +54,22 @@ struct bluefs_fnode_t {
|
||||
allocated += p.length;
|
||||
}
|
||||
|
||||
DENC(bluefs_fnode_t, v, p) {
|
||||
DENC_HELPERS
|
||||
void bound_encode(size_t& p) const {
|
||||
_denc_friend(*this, p);
|
||||
}
|
||||
void encode(bufferlist::contiguous_appender& p) const {
|
||||
DENC_DUMP_PRE(bluefs_fnode_t);
|
||||
_denc_friend(*this, p);
|
||||
DENC_DUMP_POST(bluefs_fnode_t);
|
||||
}
|
||||
void decode(buffer::ptr::iterator& p) {
|
||||
_denc_friend(*this, p);
|
||||
recalc_allocated();
|
||||
}
|
||||
template<typename T, typename P>
|
||||
friend std::enable_if_t<std::is_same_v<bluefs_fnode_t, std::remove_const_t<T>>>
|
||||
_denc_friend(T& v, P& p) {
|
||||
DENC_START(1, 1, p);
|
||||
denc_varint(v.ino, p);
|
||||
denc_varint(v.size, p);
|
||||
|
Loading…
Reference in New Issue
Block a user