summaryrefslogtreecommitdiffstats
path: root/src/mds/DamageTable.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds/DamageTable.cc')
-rw-r--r--src/mds/DamageTable.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mds/DamageTable.cc b/src/mds/DamageTable.cc
index 22802079d..2079d2333 100644
--- a/src/mds/DamageTable.cc
+++ b/src/mds/DamageTable.cc
@@ -15,6 +15,7 @@
#include "common/debug.h"
#include "mds/CDir.h"
+#include "mds/CInode.h"
#include "DamageTable.h"
@@ -200,6 +201,33 @@ bool DamageTable::notify_remote_damaged(inodeno_t ino, std::string_view path)
return false;
}
+void DamageTable::remove_dentry_damage_entry(CDir *dir)
+{
+ if (dentries.count(
+ DirFragIdent(dir->inode->ino(), dir->frag)
+ ) > 0){
+ const auto frag_dentries =
+ dentries.at(DirFragIdent(dir->inode->ino(), dir->frag));
+ for(const auto &i : frag_dentries) {
+ erase(i.second->id);
+ }
+ }
+}
+
+void DamageTable::remove_dirfrag_damage_entry(CDir *dir)
+{
+ if (is_dirfrag_damaged(dir)){
+ erase(dirfrags.find(DirFragIdent(dir->inode->ino(), dir->frag))->second->id);
+ }
+}
+
+void DamageTable::remove_backtrace_damage_entry(inodeno_t ino)
+{
+ if (is_remote_damaged(ino)){
+ erase(remotes.find(ino)->second->id);
+ }
+}
+
bool DamageTable::oversized() const
{
return by_id.size() > (size_t)(g_conf()->mds_damage_table_max_entries);