DentryDamage(
inodeno_t ino_,
frag_t frag_,
- boost::string_view dname_,
+ std::string_view dname_,
snapid_t snap_id_)
: ino(ino_), frag(frag_), dname(dname_), snap_id(snap_id_)
{}
bool DamageTable::notify_dentry(
inodeno_t ino, frag_t frag,
- snapid_t snap_id, boost::string_view dname, boost::string_view path)
+ snapid_t snap_id, std::string_view dname, std::string_view path)
{
if (oversized()) {
return true;
if (dentries.count(key) == 0) {
DamageEntryRef entry = std::make_shared<DentryDamage>(
ino, frag, dname, snap_id);
- entry->path = std::string(path);
+ entry->path = path;
dentries[key][DentryIdent(dname, snap_id)] = entry;
by_id[entry->id] = std::move(entry);
}
}
bool DamageTable::notify_dirfrag(inodeno_t ino, frag_t frag,
- boost::string_view path)
+ std::string_view path)
{
// Special cases: damage to these dirfrags is considered fatal to
// the MDS rank that owns them.
- if (
- (MDS_INO_IS_STRAY(ino) && MDS_INO_STRAY_OWNER(ino) == rank)
- ||
- (ino == MDS_INO_ROOT)
- ) {
+ if ((MDS_INO_IS_STRAY(ino) && MDS_INO_STRAY_OWNER(ino) == rank)
+ || (ino == CEPH_INO_ROOT)) {
derr << "Damage to fragment " << frag << " of ino " << ino
<< " is fatal because it is a system directory for this rank" << dendl;
return true;
auto key = DirFragIdent(ino, frag);
if (dirfrags.count(key) == 0) {
DamageEntryRef entry = std::make_shared<DirFragDamage>(ino, frag);
- entry->path = std::string(path);
+ entry->path = path;
dirfrags[key] = entry;
by_id[entry->id] = std::move(entry);
}
return false;
}
-bool DamageTable::notify_remote_damaged(inodeno_t ino, boost::string_view path)
+bool DamageTable::notify_remote_damaged(inodeno_t ino, std::string_view path)
{
if (oversized()) {
return true;
if (remotes.count(ino) == 0) {
auto entry = std::make_shared<BacktraceDamage>(ino);
- entry->path = std::string(path);
+ entry->path = path;
remotes[ino] = entry;
by_id[entry->id] = std::move(entry);
}
bool DamageTable::oversized() const
{
- return by_id.size() > (size_t)(g_conf->mds_damage_table_max_entries);
+ return by_id.size() > (size_t)(g_conf()->mds_damage_table_max_entries);
}
bool DamageTable::is_dentry_damaged(
const CDir *dir_frag,
- boost::string_view dname,
+ std::string_view dname,
const snapid_t snap_id) const
{
if (dentries.count(
}
DamageEntryRef entry = by_id_entry->second;
- assert(entry->id == damage_id); // Sanity
+ ceph_assert(entry->id == damage_id); // Sanity
const auto type = entry->get_type();
if (type == DAMAGE_ENTRY_DIRFRAG) {