mds->queue_waiters(waiting_for_open);
}
-void MDCache::open_foreign_stray(int who, Context *c)
+void MDCache::open_foreign_mdsdir(inodeno_t ino, Context *fin)
{
- inodeno_t ino = MDS_INO_STRAY(who);
- dout(10) << "open_foreign_stray mds" << who << " " << ino << dendl;
- assert(!have_inode(ino));
-
- discover_base_ino(ino, c, who);
+ discover_base_ino(ino, fin, ino & (MAX_MDS-1));
}
-
CDentry *MDCache::get_or_create_stray_dentry(CInode *in)
{
string straydname;
dout(7) << "traverse: opening base ino " << path.get_ino() << " snap " << snapid << dendl;
CInode *cur = get_inode(path.get_ino());
if (cur == NULL) {
- if (MDS_INO_IS_STRAY(path.get_ino()))
- open_foreign_stray(path.get_ino() - MDS_INO_STRAY_OFFSET, _get_waiter(mdr, req));
+ if (MDS_INO_IS_MDSDIR(path.get_ino()))
+ open_foreign_mdsdir(path.get_ino(), _get_waiter(mdr, req));
else {
//assert(0); // hrm.. broken
return -ESTALE;
in = get_inode(anchortrace[i].dirino);
if (!in) {
dout(0) << "open_remote_ino_2 don't have dir inode " << anchortrace[i].dirino << dendl;
- if (MDS_INO_IS_STRAY(anchortrace[i].dirino)) {
- int mds = anchortrace[i].dirino % MAX_MDS;
- open_foreign_stray(mds, onfinish);
+ if (MDS_INO_IS_MDSDIR(anchortrace[i].dirino)) {
+ open_foreign_mdsdir(anchortrace[i].dirino, onfinish);
return;
}
assert(in); // hrm!
void _create_system_file(CDir *dir, const char *name, CInode *in, Context *fin);
void _create_system_file_finish(Mutation *mut, CDentry *dn, Context *fin);
- void open_foreign_stray(int who, Context *c);
+ void open_foreign_mdsdir(inodeno_t ino, Context *c);
CDentry *get_or_create_stray_dentry(CInode *in);
Context *_get_waiter(MDRequest *mdr, Message *req);