| 174 | {} |
| 175 | |
| 176 | bool DamageTable::notify_dentry( |
| 177 | inodeno_t ino, frag_t frag, |
| 178 | snapid_t snap_id, std::string_view dname, std::string_view path) |
| 179 | { |
| 180 | // Special cases: damage to these dirfrags is considered fatal to |
| 181 | // the MDS rank that owns them. |
| 182 | if ( |
| 183 | (MDS_INO_IS_MDSDIR(ino) && MDS_INO_MDSDIR_OWNER(ino) == rank) |
| 184 | || |
| 185 | (MDS_INO_IS_STRAY(ino) && MDS_INO_STRAY_OWNER(ino) == rank) |
| 186 | ) { |
| 187 | derr << "Damage to dentries in fragment " << frag << " of ino " << ino |
| 188 | << " is fatal because it is a system directory for this rank" << dendl; |
| 189 | return true; |
| 190 | } |
| 191 | |
| 192 | if (oversized()) { |
| 193 | derr << "Damage to dentries in fragment " << frag << " of ino " << ino |
| 194 | << " is fatal because maximum number of damage table entries " |
| 195 | << " has been reached" << dendl; |
| 196 | return true; |
| 197 | } |
| 198 | |
| 199 | auto& df_dentries = dentries[DirFragIdent(ino, frag)]; |
| 200 | if (auto [it, inserted] = df_dentries.try_emplace(DentryIdent(dname, snap_id)); inserted) { |
| 201 | auto entry = std::make_shared<DentryDamage>(ino, frag, dname, snap_id); |
| 202 | entry->path = path; |
| 203 | it->second = entry; |
| 204 | by_id[entry->id] = std::move(entry); |
| 205 | } |
| 206 | |
| 207 | return false; |
| 208 | } |
| 209 | |
| 210 | bool DamageTable::notify_dirfrag(inodeno_t ino, frag_t frag, |
| 211 | std::string_view path) |
no test coverage detected