MCPcopy Create free account
hub / github.com/ceph/ceph / notify_dentry

Method notify_dentry

src/mds/DamageTable.cc:176–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174{}
175
176bool 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
210bool DamageTable::notify_dirfrag(inodeno_t ino, frag_t frag,
211 std::string_view path)

Callers 2

go_bad_dentryMethod · 0.80
_validate_inode_doneMethod · 0.80

Calls 3

DirFragIdentClass · 0.85
DentryIdentClass · 0.85
try_emplaceMethod · 0.45

Tested by

no test coverage detected