mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
Merge pull request #11450 from stiopaa1/mds_damagetable_moveClassesToCCfile
mds/DamageTable: move classes to .cc file Reviewed-by: Greg Farnum <gfarnum@redhat.com> Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
commit
f95894361f
@ -22,6 +22,103 @@
|
||||
#undef dout_prefix
|
||||
#define dout_prefix *_dout << "mds." << rank << ".damage " << __func__ << " "
|
||||
|
||||
namespace {
|
||||
/**
|
||||
* Record damage to a particular dirfrag, implicitly affecting
|
||||
* any dentries within it.
|
||||
*/
|
||||
class DirFragDamage : public DamageEntry
|
||||
{
|
||||
public:
|
||||
inodeno_t ino;
|
||||
frag_t frag;
|
||||
|
||||
DirFragDamage(inodeno_t ino_, frag_t frag_)
|
||||
: ino(ino_), frag(frag_)
|
||||
{}
|
||||
|
||||
virtual damage_entry_type_t get_type() const
|
||||
{
|
||||
return DAMAGE_ENTRY_DIRFRAG;
|
||||
}
|
||||
|
||||
void dump(Formatter *f) const
|
||||
{
|
||||
f->open_object_section("dir_frag_damage");
|
||||
f->dump_string("damage_type", "dir_frag");
|
||||
f->dump_int("id", id);
|
||||
f->dump_int("ino", ino);
|
||||
f->dump_stream("frag") << frag;
|
||||
f->close_section();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Record damage to a particular dname within a particular dirfrag
|
||||
*/
|
||||
class DentryDamage : public DamageEntry
|
||||
{
|
||||
public:
|
||||
inodeno_t ino;
|
||||
frag_t frag;
|
||||
std::string dname;
|
||||
snapid_t snap_id;
|
||||
|
||||
DentryDamage(
|
||||
inodeno_t ino_,
|
||||
frag_t frag_,
|
||||
std::string dname_,
|
||||
snapid_t snap_id_)
|
||||
: ino(ino_), frag(frag_), dname(dname_), snap_id(snap_id_)
|
||||
{}
|
||||
|
||||
virtual damage_entry_type_t get_type() const
|
||||
{
|
||||
return DAMAGE_ENTRY_DENTRY;
|
||||
}
|
||||
|
||||
void dump(Formatter *f) const
|
||||
{
|
||||
f->open_object_section("dentry_damage");
|
||||
f->dump_string("damage_type", "dentry");
|
||||
f->dump_int("id", id);
|
||||
f->dump_int("ino", ino);
|
||||
f->dump_stream("frag") << frag;
|
||||
f->dump_string("dname", dname);
|
||||
f->dump_stream("snap_id") << snap_id;
|
||||
f->close_section();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Record damage to our ability to look up an ino by number
|
||||
*/
|
||||
class BacktraceDamage : public DamageEntry
|
||||
{
|
||||
public:
|
||||
inodeno_t ino;
|
||||
|
||||
BacktraceDamage(inodeno_t ino_)
|
||||
: ino(ino_)
|
||||
{}
|
||||
|
||||
virtual damage_entry_type_t get_type() const
|
||||
{
|
||||
return DAMAGE_ENTRY_BACKTRACE;
|
||||
}
|
||||
|
||||
void dump(Formatter *f) const
|
||||
{
|
||||
f->open_object_section("backtrace_damage");
|
||||
f->dump_string("damage_type", "backtrace");
|
||||
f->dump_int("id", id);
|
||||
f->dump_int("ino", ino);
|
||||
f->close_section();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
DamageEntry::~DamageEntry()
|
||||
{}
|
||||
|
@ -53,101 +53,6 @@ class DamageEntry
|
||||
|
||||
typedef ceph::shared_ptr<DamageEntry> DamageEntryRef;
|
||||
|
||||
/**
|
||||
* Record damage to a particular dirfrag, implicitly affecting
|
||||
* any dentries within it.
|
||||
*/
|
||||
class DirFragDamage : public DamageEntry
|
||||
{
|
||||
public:
|
||||
inodeno_t ino;
|
||||
frag_t frag;
|
||||
|
||||
DirFragDamage(inodeno_t ino_, frag_t frag_)
|
||||
: ino(ino_), frag(frag_)
|
||||
{}
|
||||
|
||||
virtual damage_entry_type_t get_type() const
|
||||
{
|
||||
return DAMAGE_ENTRY_DIRFRAG;
|
||||
}
|
||||
|
||||
void dump(Formatter *f) const
|
||||
{
|
||||
f->open_object_section("dir_frag_damage");
|
||||
f->dump_string("damage_type", "dir_frag");
|
||||
f->dump_int("id", id);
|
||||
f->dump_int("ino", ino);
|
||||
f->dump_stream("frag") << frag;
|
||||
f->close_section();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Record damage to a particular dname within a particular dirfrag
|
||||
*/
|
||||
class DentryDamage : public DamageEntry
|
||||
{
|
||||
public:
|
||||
inodeno_t ino;
|
||||
frag_t frag;
|
||||
std::string dname;
|
||||
snapid_t snap_id;
|
||||
|
||||
DentryDamage(
|
||||
inodeno_t ino_,
|
||||
frag_t frag_,
|
||||
std::string dname_,
|
||||
snapid_t snap_id_)
|
||||
: ino(ino_), frag(frag_), dname(dname_), snap_id(snap_id_)
|
||||
{}
|
||||
|
||||
virtual damage_entry_type_t get_type() const
|
||||
{
|
||||
return DAMAGE_ENTRY_DENTRY;
|
||||
}
|
||||
|
||||
void dump(Formatter *f) const
|
||||
{
|
||||
f->open_object_section("dentry_damage");
|
||||
f->dump_string("damage_type", "dentry");
|
||||
f->dump_int("id", id);
|
||||
f->dump_int("ino", ino);
|
||||
f->dump_stream("frag") << frag;
|
||||
f->dump_string("dname", dname);
|
||||
f->dump_stream("snap_id") << snap_id;
|
||||
f->close_section();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Record damage to our ability to look up an ino by number
|
||||
*/
|
||||
class BacktraceDamage : public DamageEntry
|
||||
{
|
||||
public:
|
||||
inodeno_t ino;
|
||||
|
||||
BacktraceDamage(inodeno_t ino_)
|
||||
: ino(ino_)
|
||||
{}
|
||||
|
||||
virtual damage_entry_type_t get_type() const
|
||||
{
|
||||
return DAMAGE_ENTRY_BACKTRACE;
|
||||
}
|
||||
|
||||
void dump(Formatter *f) const
|
||||
{
|
||||
f->open_object_section("backtrace_damage");
|
||||
f->dump_string("damage_type", "backtrace");
|
||||
f->dump_int("id", id);
|
||||
f->dump_int("ino", ino);
|
||||
f->close_section();
|
||||
}
|
||||
};
|
||||
|
||||
class DirFragIdent
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user