From 66eab36c68bf44219392a1fc0e128c4b917a4ddc Mon Sep 17 00:00:00 2001 From: sage Date: Thu, 2 Mar 2006 00:04:20 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@716 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/client/Client.h | 4 ++-- ceph/mds/MDCache.cc | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ceph/client/Client.h b/ceph/client/Client.h index b8fd8cd71196f..a7710447dc9be 100644 --- a/ceph/client/Client.h +++ b/ceph/client/Client.h @@ -213,7 +213,7 @@ class Inode { } int pick_replica(MDCluster *mdcluster) { // replicas? - if (dir_contacts.size()) { + if (ino() > 1ULL && dir_contacts.size()) { //cout << "dir_contacts if " << dir_contacts << endl; set::iterator it = dir_contacts.begin(); if (dir_contacts.size() == 1) @@ -225,7 +225,7 @@ class Inode { } } - if (dir_replicated) { + if (dir_replicated || ino() == 1) { //cout << "num_mds is " << mdcluster->get_num_mds() << endl; return rand() % mdcluster->get_num_mds(); // huh.. pick a random mds! } diff --git a/ceph/mds/MDCache.cc b/ceph/mds/MDCache.cc index 477aaad04daa4..5108f4e67edd6 100644 --- a/ceph/mds/MDCache.cc +++ b/ceph/mds/MDCache.cc @@ -441,6 +441,8 @@ void MDCache::export_empty_import(CDir *dir) { dout(7) << "export_empty_import " << *dir << endl; + return; // hack fixme + if (!dir->is_import()) { dout(7) << "not import (anymore?)" << endl; return; @@ -471,7 +473,8 @@ void MDCache::export_empty_import(CDir *dir) dout(7) << "really empty, exporting to " << dest << endl; assert (dest != mds->get_nodeid()); - dout(7) << "exporting empty import " << *dir << " to " << dest << endl; + dout(-7) << "exporting to mds" << dest + << " empty import " << *dir << endl; export_dir( dir, dest ); } @@ -541,7 +544,7 @@ bool MDCache::trim(int max) { diri->dir->state_clear(CDIR_STATE_COMPLETE); // reexport? - if (diri->dir->is_import() && // import + if (false && diri->dir->is_import() && // import diri->dir->get_size() == 0 && // no children !diri->is_root()) // not root export_empty_import(diri->dir); @@ -823,7 +826,7 @@ int MDCache::open_root(Context *c) assert(root->dir == NULL); root->set_dir( new CDir(root, mds, true) ); root->dir->set_dir_auth( 0 ); // me! - root->dir->dir_rep = CDIR_REP_NONE; + root->dir->dir_rep = CDIR_REP_ALL; //NONE; // root is sort of technically an import (from a vacuum) imports.insert( root->dir ); @@ -6796,7 +6799,8 @@ void MDCache::handle_export_dir(MExportDir *m) // is it empty? - if (dir->get_size() == 0 && + if (false && + dir->get_size() == 0 && !dir->inode->is_auth()) { // reexport! export_empty_import(dir); -- 2.39.5