if (!in->is_mdsdir()) {
predirty_journal_parents(mut, &le->metablob, in, dir, PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
- le->metablob.add_primary_dentry(dn, true, in);
+ le->metablob.add_primary_dentry(dn, in, true);
} else {
predirty_journal_parents(mut, &le->metablob, in, dir, PREDIRTY_DIR, 1);
journal_dirty_inode(mut, &le->metablob, in);
CDentry *olddn = dn->dir->add_primary_dentry(dn->name, oldin, oldfirst, follows);
oldin->inode.version = olddn->pre_dirty();
dout(10) << " olddn " << *olddn << dendl;
- metablob->add_primary_dentry(olddn, true, 0);
+ metablob->add_primary_dentry(olddn, 0, true);
mut->add_cow_dentry(olddn);
} else {
assert(dnl->is_remote());
CDentry *dn = in->get_projected_parent_dn();
if (!dn->get_projected_linkage()->is_null()) // no need to cow a null dentry
journal_cow_dentry(mut, metablob, dn, follows);
- metablob->add_primary_dentry(dn, true, in);
+ metablob->add_primary_dentry(dn, in, true);
}
}
}
in->parent->first = in->first;
- le->metablob.add_primary_dentry(in->parent, true, in);
+ le->metablob.add_primary_dentry(in->parent, in, true);
mds->mdlog->submit_entry(le, new C_MDC_QueuedCow(this, in, mut));
mds->mdlog->flush();
}
EUpdate *le = new EUpdate(mds->mdlog, "truncate finish");
mds->mdlog->start_entry(le);
le->metablob.add_dir_context(in->get_parent_dir());
- le->metablob.add_primary_dentry(in->get_projected_parent_dn(), true, in);
+ le->metablob.add_primary_dentry(in->get_projected_parent_dn(), in, true);
le->metablob.add_truncate_finish(in->ino(), ls->offset);
journal_dirty_inode(mut, &le->metablob, in);
predirty_journal_parents(mut, &le->metablob, in, 0, PREDIRTY_PRIMARY);
journal_cow_inode(mut, &le->metablob, in);
- le->metablob.add_primary_dentry(in->get_projected_parent_dn(), true, in);
+ le->metablob.add_primary_dentry(in->get_projected_parent_dn(), in, true);
mds->mdlog->submit_entry(le, new C_MDC_snaprealm_create_finish(this, mdr, mut, in));
mds->mdlog->flush();
pi->version = in->pre_dirty();
le->metablob.add_dir_context(dn->dir);
- le->metablob.add_primary_dentry(dn, true, in);
+ le->metablob.add_primary_dentry(dn, in, true);
mds->mdlog->submit_entry(le, new C_MDC_PurgeStrayLoggedTruncate(this, dn, mds->mdlog->get_current_segment()));
}
le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid());
journal_allocated_inos(mdr, &le->metablob);
mdcache->predirty_journal_parents(mdr, &le->metablob, in, dn->get_dir(), PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
- le->metablob.add_primary_dentry(dn, true, in);
+ le->metablob.add_primary_dentry(dn, in, true);
// do the open
mds->locker->issue_new_caps(in, cmode, mdr->session, realm, req->is_replay());
mdcache->predirty_journal_parents(mdr, &le->metablob, newi, dn->get_dir(),
PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
- le->metablob.add_primary_dentry(dn, true, newi);
+ le->metablob.add_primary_dentry(dn, newi, true);
journal_and_reply(mdr, newi, dn, le, new C_MDS_mknod_finish(mds, mdr, dn, newi, follows));
}
le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid());
journal_allocated_inos(mdr, &le->metablob);
mdcache->predirty_journal_parents(mdr, &le->metablob, newi, dn->get_dir(), PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
- le->metablob.add_primary_dentry(dn, true, newi);
+ le->metablob.add_primary_dentry(dn, newi, true);
le->metablob.add_new_dir(newdir); // dirty AND complete AND new
// issue a cap on the directory
le->metablob.add_client_req(req->get_reqid(), req->get_oldest_client_tid());
journal_allocated_inos(mdr, &le->metablob);
mdcache->predirty_journal_parents(mdr, &le->metablob, newi, dn->get_dir(), PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
- le->metablob.add_primary_dentry(dn, true, newi);
+ le->metablob.add_primary_dentry(dn, newi, true);
journal_and_reply(mdr, newi, dn, le, new C_MDS_mknod_finish(mds, mdr, dn, newi, follows));
}
mdlog->start_entry(le);
le->commit.add_dir_context(parent);
le->commit.add_dir(parent, true);
- le->commit.add_primary_dentry(in->get_projected_parent_dn(), true, 0);
+ le->commit.add_primary_dentry(in->get_projected_parent_dn(), 0, true);
mdlog->submit_entry(le, new C_MDS_LoggedLinkRollback(this, mut, mdr));
mdlog->flush();
if (in->snaprealm || follows + 1 > dn->first)
in->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
- le->metablob.add_primary_dentry(straydn, true, in);
+ le->metablob.add_primary_dentry(straydn, in, true);
} else {
// remote link. update remote inode.
mdcache->predirty_journal_parents(mdr, &le->metablob, in, dn->get_dir(), PREDIRTY_DIR, -1);
le->rollback = mdr->more()->rollback_bl;
le->commit.add_dir_context(straydn->get_dir());
- le->commit.add_primary_dentry(straydn, true, in);
+ le->commit.add_primary_dentry(straydn, in, true);
// slave: no need to journal original dentry
dout(10) << " noting renamed (unlinked) dir ino " << in->ino() << " in metablob" << dendl;
mdlog->start_entry(le);
le->commit.add_dir_context(dn->get_dir());
- le->commit.add_primary_dentry(dn, true, in);
+ le->commit.add_primary_dentry(dn, in, true);
// slave: no need to journal straydn
dout(10) << " noting renamed (unlinked) dir ino " << in->ino() << " in metablob" << dendl;
if (oldin->snaprealm || src_realm->get_newest_seq() + 1 > srcdn->first)
oldin->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm());
straydn->first = MAX(oldin->first, next_dest_snap);
- metablob->add_primary_dentry(straydn, true, oldin);
+ metablob->add_primary_dentry(straydn, oldin, true);
} else if (force_journal_stray) {
dout(10) << " forced journaling straydn " << *straydn << dendl;
metablob->add_dir_context(straydn->get_dir());
- metablob->add_primary_dentry(straydn, true, oldin);
+ metablob->add_primary_dentry(straydn, oldin, true);
}
} else if (destdnl->is_remote()) {
if (oldin->is_auth()) {
metablob->add_dir_context(oldin->get_projected_parent_dir());
mdcache->journal_cow_dentry(mdr, metablob, oldin->get_projected_parent_dn(),
CEPH_NOSNAP, 0, destdnl);
- metablob->add_primary_dentry(oldin->get_projected_parent_dn(), true, oldin);
+ metablob->add_primary_dentry(oldin->get_projected_parent_dn(), oldin, true);
}
}
}
if (srci->get_projected_parent_dn()->is_auth()) { // it's remote
metablob->add_dir_context(srci->get_projected_parent_dir());
mdcache->journal_cow_dentry(mdr, metablob, srci->get_projected_parent_dn(), CEPH_NOSNAP, 0, srcdnl);
- metablob->add_primary_dentry(srci->get_projected_parent_dn(), true, srci);
+ metablob->add_primary_dentry(srci->get_projected_parent_dn(), srci, true);
}
} else {
if (destdn->is_auth() && !destdnl->is_null())
destdn->first = MAX(destdn->first, next_dest_snap);
if (destdn->is_auth())
- metablob->add_primary_dentry(destdn, true, destdnl->get_inode());
+ metablob->add_primary_dentry(destdn, destdnl->get_inode(), true);
}
} else if (srcdnl->is_primary()) {
// project snap parent update?
destdn->first = MAX(destdn->first, next_dest_snap);
if (destdn->is_auth())
- metablob->add_primary_dentry(destdn, true, srci);
+ metablob->add_primary_dentry(destdn, srci, true);
else if (force_journal_dest) {
dout(10) << " forced journaling destdn " << *destdn << dendl;
metablob->add_dir_context(destdn->get_dir());
- metablob->add_primary_dentry(destdn, true, srci);
+ metablob->add_primary_dentry(destdn, srci, true);
if (srcdn->is_auth() && srci->is_dir()) {
// journal new subtrees root dirfrags
list<CDir*> ls;
// both primary and NULL dentries. Because during journal replay, null dentry is
// processed after primary dentry.
if (srcdnl->is_primary() && !srci->is_dir() && !destdn->is_auth())
- metablob->add_primary_dentry(srcdn, true, srci);
+ metablob->add_primary_dentry(srcdn, srci, true);
metablob->add_null_dentry(srcdn, true);
} else
dout(10) << " NOT journaling srcdn " << *srcdn << dendl;
if (srcdn && (srcdn->authority().first == whoami || force_journal_src)) {
le->commit.add_dir_context(srcdir);
if (rollback.orig_src.ino)
- le->commit.add_primary_dentry(srcdn, true);
+ le->commit.add_primary_dentry(srcdn, 0, true);
else
le->commit.add_remote_dentry(srcdn, true);
}
if (force_journal_dest) {
assert(rollback.orig_dest.ino);
le->commit.add_dir_context(destdir);
- le->commit.add_primary_dentry(destdn, true);
+ le->commit.add_primary_dentry(destdn, 0, true);
}
// slave: no need to journal straydn
if (target && target->authority().first == whoami) {
assert(rollback.orig_dest.remote_ino);
le->commit.add_dir_context(target->get_projected_parent_dir());
- le->commit.add_primary_dentry(target->get_projected_parent_dn(), true, target);
+ le->commit.add_primary_dentry(target->get_projected_parent_dn(), target, true);
}
if (force_journal_dest) {