From 791ca282954625ee2628ff17dea25e52d34403e2 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 3 Jun 2010 16:09:23 -0700 Subject: [PATCH] mds: kill open_foreign_stray; but open remote mdsdirs instead Signed-off-by: Sage Weil --- src/mds/MDCache.cc | 18 ++++++------------ src/mds/MDCache.h | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 71e5d710b0e..00722da097f 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -560,16 +560,11 @@ void MDCache::populate_mydir() 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; @@ -5788,8 +5783,8 @@ int MDCache::path_traverse(MDRequest *mdr, Message *req, // who 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; @@ -6271,9 +6266,8 @@ void MDCache::open_remote_ino_2(inodeno_t ino, 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! diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index a6bf8c53f45..85d0902653d 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -944,7 +944,7 @@ public: 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);