// LINK
-void MDCache::send_dentry_link(CDentry *dn)
+void MDCache::send_dentry_link(CDentry *dn, MDRequestRef& mdr)
{
dout(7) << "send_dentry_link " << *dn << dendl;
for (map<int,unsigned>::iterator p = dn->replicas_begin();
p != dn->replicas_end();
++p) {
+ // don't tell (rename) witnesses; they already know
+ if (mdr.get() && mdr->more()->witnessed.count(p->first))
+ continue;
if (mds->mdsmap->get_state(p->first) < MDSMap::STATE_REJOIN ||
(mds->mdsmap->get_state(p->first) == MDSMap::STATE_REJOIN &&
rejoin_gather.count(p->first)))
it != dn->replicas_end();
++it) {
// don't tell (rmdir) witnesses; they already know
- if (mdr && mdr->more()->witnessed.count(it->first))
+ if (mdr.get() && mdr->more()->witnessed.count(it->first))
continue;
if (mds->mdsmap->get_state(it->first) < MDSMap::STATE_REJOIN ||
mds->locker->share_inode_max_size(newi);
- mds->mdcache->send_dentry_link(dn);
+ MDRequestRef null_ref;
+ mds->mdcache->send_dentry_link(dn, null_ref);
mds->balancer->hit_inode(mdr->now, newi, META_POP_IWR);
mdr->apply();
- mds->mdcache->send_dentry_link(dn);
+ MDRequestRef null_ref;
+ mds->mdcache->send_dentry_link(dn, null_ref);
if (newi->inode.is_file())
mds->locker->share_inode_max_size(newi);
targeti->pop_and_dirty_projected_inode(mdr->ls);
mdr->apply();
-
- mds->mdcache->send_dentry_link(dn);
+
+ MDRequestRef null_ref;
+ mds->mdcache->send_dentry_link(dn, null_ref);
// bump target popularity
mds->balancer->hit_inode(mdr->now, targeti, META_POP_IWR);
mdr->apply();
+ MDRequestRef null_ref;
if (inc)
- mds->mdcache->send_dentry_link(dn);
- else {
- MDRequestRef null_ref;
+ mds->mdcache->send_dentry_link(dn, null_ref);
+ else
mds->mdcache->send_dentry_unlink(dn, NULL, null_ref);
- }
// commit anchor update?
if (mdr->more()->dst_reanchor_atid)
witnesses.insert(srcdn->authority().first);
if (srcdnl->is_remote() && !srci->is_auth())
witnesses.insert(srci->authority().first);
- destdn->list_replicas(witnesses);
- if (destdnl->is_remote() && !oldin->is_auth())
- witnesses.insert(oldin->authority().first);
+ if (!destdnl->is_null()) {
+ destdn->list_replicas(witnesses);
+ if (destdnl->is_remote() && !oldin->is_auth())
+ witnesses.insert(oldin->authority().first);
+ }
dout(10) << " witnesses " << witnesses << ", have " << mdr->more()->witnessed << dendl;
// apply
_rename_apply(mdr, srcdn, destdn, straydn);
+ mds->mdcache->send_dentry_link(destdn, mdr);
+
CDentry::linkage_t *destdnl = destdn->get_linkage();
CInode *in = destdnl->get_inode();
bool need_eval = mdr->more()->cap_imports.count(in);