]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
some small discover fixes; migrator cleanup; a more serious overhaul is needed both...
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 10 Mar 2007 02:55:02 +0000 (02:55 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 10 Mar 2007 02:55:02 +0000 (02:55 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1196 29311d96-e01e-0410-9327-a35deaab8ce9

branches/sage/cephmds2/include/frag.h
branches/sage/cephmds2/mds/CDir.cc
branches/sage/cephmds2/mds/CDir.h
branches/sage/cephmds2/mds/MDCache.cc
branches/sage/cephmds2/mds/Migrator.cc
branches/sage/cephmds2/mds/Migrator.h
branches/sage/cephmds2/messages/MExportDirDiscover.h
branches/sage/cephmds2/messages/MExportDirDiscoverAck.h
branches/sage/cephmds2/messages/MExportDirFinish.h
branches/sage/cephmds2/msg/FakeMessenger.cc

index 00f424fdbdaf304ae0951773bb855e9f2f016444..a53ec733e61c6b8499bedc7bf81dbad83dcf6a6b 100644 (file)
@@ -169,6 +169,9 @@ class fragtree_t {
   }
   
   // modifiers
+  void swap(fragtree_t& other) {
+    _splits.swap(other._splits);
+  }
   void split(frag_t hb, int b) {
     assert(_splits.count(hb) == 0);
     _splits[hb] = b;
index c01aee7b7c0a172378ca5ca772f82992c6e8d3a9..e10da3b273f6666f63d554978411c52fab26b20f 100644 (file)
@@ -604,39 +604,30 @@ void CDir::_fetched(bufferlist &bl)
     return;
   }
 
-  // add to our buffer
-  size_t ondisk_size;
-  assert(bl.length() > sizeof(ondisk_size));
-  bl.copy(0, sizeof(ondisk_size), (char*)&ondisk_size);
-  off_t have = bl.length() - sizeof(ondisk_size);
-  dout(10) << "ondisk_size " << ondisk_size << ", have " << have << endl;
-  assert(have == ondisk_size);
-
   // decode.
-  int off = sizeof(ondisk_size);
-
-  __uint32_t num_dn;
+  int len = bl.length();
+  int off = 0;
   version_t  got_version;
   
-  bl.copy(off, sizeof(num_dn), (char*)&num_dn);
-  off += sizeof(num_dn);
   bl.copy(off, sizeof(got_version), (char*)&got_version);
   off += sizeof(got_version);
 
-  dout(10) << "_fetched " << num_dn << " dn, got_version " << got_version
-          << ", " << ondisk_size << " bytes"
+  dout(10) << "_fetched version " << got_version
+          << ", " << len << " bytes"
           << endl;
   
-  while (num_dn--) {
-    // dentry
+  while (off < len) {
+    // marker
+    char type = bl[off];
+    ++off;
+
+    // dname
     string dname;
     ::_decode(dname, bl, off);
-    dout(24) << "parse filename '" << dname << "'" << endl;
+    dout(24) << "_fetched parsed marker '" << type << "' dname '" << dname << "'" << endl;
     
     CDentry *dn = lookup(dname);  // existing dentry?
-    
-    char type = bl[off];
-    ++off;
+
     if (type == 'L') {
       // hard link
       inodeno_t ino;
@@ -645,9 +636,9 @@ void CDir::_fetched(bufferlist &bl)
       
       if (dn) {
         if (dn->get_inode() == 0) {
-          dout(12) << "readdir had NEG dentry " << *dn << endl;
+          dout(12) << "_fetched  had NEG dentry " << *dn << endl;
         } else {
-          dout(12) << "readdir had dentry " << *dn << endl;
+          dout(12) << "_fetched  had dentry " << *dn << endl;
         }
       } else {
        // (remote) link
@@ -657,9 +648,9 @@ void CDir::_fetched(bufferlist &bl)
        CInode *in = cache->get_inode(ino);   // we may or may not have it.
        if (in) {
          dn->link_remote(in);
-         dout(12) << "readdir got remote link " << ino << " which we have " << *in << endl;
+         dout(12) << "_fetched  got remote link " << ino << " which we have " << *in << endl;
        } else {
-         dout(12) << "readdir got remote link " << ino << " (dont' have it)" << endl;
+         dout(12) << "_fetched  got remote link " << ino << " (dont' have it)" << endl;
        }
       }
     } 
@@ -674,19 +665,22 @@ void CDir::_fetched(bufferlist &bl)
       string symlink;
       if (inode.is_symlink())
         ::_decode(symlink, bl, off);
+
+      fragtree_t fragtree;
+      fragtree._decode(bl,off);
       
       if (dn) {
         if (dn->get_inode() == 0) {
-          dout(12) << "readdir had NEG dentry " << *dn << endl;
+          dout(12) << "_fetched  had NEG dentry " << *dn << endl;
         } else {
-          dout(12) << "readdir had dentry " << *dn << endl;
+          dout(12) << "_fetched  had dentry " << *dn << endl;
         }
       } else {
        // add inode
        CInode *in = 0;
        if (cache->have_inode(inode.ino)) {
          in = cache->get_inode(inode.ino);
-         dout(12) << "readdir got (but i already had) " << *in 
+         dout(12) << "_fetched  got (but i already had) " << *in 
                   << " mode " << in->inode.mode 
                   << " mtime " << in->inode.mtime << endl;
          assert(0);  // this shouldn't happen!! 
@@ -699,12 +693,15 @@ void CDir::_fetched(bufferlist &bl)
          if (in->is_symlink()) 
            in->symlink = symlink;
          
+         // dirfragtree
+         in->dirfragtree.swap(fragtree);
+
          // add 
          cache->add_inode( in );
        
          // link
          add_dentry( dname, in );
-         dout(12) << "readdir got " << *in << " mode " << in->inode.mode << " mtime " << in->inode.mtime << endl;
+         dout(12) << "_fetched  got " << *in << " mode " << in->inode.mode << " mtime " << in->inode.mtime << endl;
        }
       }
     } else {
@@ -729,16 +726,17 @@ void CDir::_fetched(bufferlist &bl)
        dn &&
        dn->get_version() <= got_version &&
        dn->is_dirty()) {
-      dout(10) << "readdir had underwater dentry " << *dn << ", marking clean" << endl;
+      dout(10) << "_fetched  had underwater dentry " << *dn << ", marking clean" << endl;
       dn->mark_clean();
 
       if (dn->get_inode()) {
        assert(dn->get_inode()->get_version() <= got_version);
-       dout(10) << "readdir had underwater inode " << *dn->get_inode() << ", marking clean" << endl;
+       dout(10) << "_fetched  had underwater inode " << *dn->get_inode() << ", marking clean" << endl;
        dn->get_inode()->mark_clean();
       }
     }
   }
+  assert(off == len);
 
   // take the loaded version?
   // only if we are a fresh CDir* with no prior state.
@@ -861,9 +859,9 @@ void CDir::_commit(version_t want)
   if (cache->mds->logger) cache->mds->logger->inc("cdir");
 
   // encode dentries
-  bufferlist dnbl;
-  __uint32_t num_dn = 0;
-
+  bufferlist bl;
+  bl.append((char*)&version, sizeof(version));
+  
   for (CDir_map_t::iterator it = items.begin();
        it != items.end();
        it++) {
@@ -875,43 +873,34 @@ void CDir::_commit(version_t want)
     // primary or remote?
     if (dn->is_remote()) {
       inodeno_t ino = dn->get_remote_ino();
-      dout(14) << " pos " << dnbl.length() << " dn '" << it->first << "' remote ino " << ino << endl;
+      dout(14) << " pos " << bl.length() << " dn '" << it->first << "' remote ino " << ino << endl;
       
-      // name, marker, ino
-      dnbl.append( it->first.c_str(), it->first.length() + 1);
-      dnbl.append( "L", 1 );         // remote link
-      dnbl.append((char*)&ino, sizeof(ino));
+      // marker, name, ino
+      bl.append( "L", 1 );         // remote link
+      bl.append( it->first.c_str(), it->first.length() + 1);
+      bl.append((char*)&ino, sizeof(ino));
     } else {
       // primary link
       CInode *in = dn->get_inode();
       assert(in);
 
-      dout(14) << " pos " << dnbl.length() << " dn '" << it->first << "' inode " << *in << endl;
+      dout(14) << " pos " << bl.length() << " dn '" << it->first << "' inode " << *in << endl;
   
-      // name, marker, inode, [symlink string]
-      dnbl.append( it->first.c_str(), it->first.length() + 1);
-      dnbl.append( "I", 1 );         // inode
-      dnbl.append( (char*) &in->inode, sizeof(inode_t));
+      // marker, name, inode, [symlink string]
+      bl.append( "I", 1 );         // inode
+      bl.append( it->first.c_str(), it->first.length() + 1);
+      bl.append( (char*) &in->inode, sizeof(inode_t));
       
       if (in->is_symlink()) {
         // include symlink destination!
         dout(18) << "    inlcuding symlink ptr " << in->symlink << endl;
-        dnbl.append( (char*) in->symlink.c_str(), in->symlink.length() + 1);
+        bl.append( (char*) in->symlink.c_str(), in->symlink.length() + 1);
       }
+
+      in->dirfragtree._encode(bl);
     }
-    num_dn++;
   }
 
-  // wrap it up
-  bufferlist bl;
-  size_t size;
-  size = dnbl.length() + sizeof(num_dn) + sizeof(version);
-  bl.append((char*)&size, sizeof(size));
-  bl.append((char*)&num_dn, sizeof(num_dn));
-  bl.append((char*)&version, sizeof(version));
-  bl.claim_append(dnbl);
-  assert(size == bl.length() - sizeof(size));
-
   // write it.
   cache->mds->objecter->write( get_ondisk_object(),
                               0, bl.length(),
index d6065c0315691f3f24b090a7e90ed1ccd76c0507..79ce1d9d38a459e5e145aa135f1bbbd59c495a06 100644 (file)
@@ -491,7 +491,7 @@ class CDir : public MDSCacheObject {
 class CDirDiscover {
   dirfrag_t dirfrag;
   int       nonce;
-  int  dir_auth;
+  //int       dir_auth2;
   int       dir_rep;
   set<int>  rep_by;
 
@@ -500,7 +500,7 @@ class CDirDiscover {
   CDirDiscover(CDir *dir, int nonce) {
     dirfrag = dir->dirfrag();
     this->nonce = nonce;
-    //dir_auth = dir->dir_auth.first;
+    //dir_auth2 = dir->dir_auth.second;
     dir_rep = dir->dir_rep;
     rep_by = dir->dir_rep_by;
   }
@@ -521,7 +521,7 @@ class CDirDiscover {
   void _encode(bufferlist& bl) {
     bl.append((char*)&dirfrag, sizeof(dirfrag));
     bl.append((char*)&nonce, sizeof(nonce));
-    bl.append((char*)&dir_auth, sizeof(dir_auth));
+    //bl.append((char*)&dir_auth, sizeof(dir_auth));
     bl.append((char*)&dir_rep, sizeof(dir_rep));
     ::_encode(rep_by, bl);
   }
@@ -531,8 +531,8 @@ class CDirDiscover {
     off += sizeof(dirfrag);
     bl.copy(off, sizeof(nonce), (char*)&nonce);
     off += sizeof(nonce);
-    bl.copy(off, sizeof(dir_auth), (char*)&dir_auth);
-    off += sizeof(dir_auth);
+    //bl.copy(off, sizeof(dir_auth), (char*)&dir_auth);
+    //off += sizeof(dir_auth);
     bl.copy(off, sizeof(dir_rep), (char*)&dir_rep);
     off += sizeof(dir_rep);
     ::_decode(rep_by, bl, off);
index 6c23a634957913fd78b06e150cf4d74793f46d4b..8e08876bc8ed0bf169eb98017870f21a1161212e 100644 (file)
@@ -3220,17 +3220,31 @@ void MDCache::handle_discover(MDiscover *dis)
       }
       
       if (!cur->dir) cur->get_or_open_dir(this);
-      
+      assert(cur->dir);
+
+      // is dir frozen?
+      if (cur->dir->is_frozen()) {
+       dout(7) << *cur->dir << " is frozen, stopping" << endl;
+       break;
+      }
+
+      // add the dir.
       reply->add_dir( new CDirDiscover( cur->dir, 
                                         cur->dir->add_replica( dis->get_asker() ) ) );
       dout(7) << "added dir " << *cur->dir << endl;
     }
     if (dis->get_want().depth() == 0) break;
+
+    // is dir frozen?
+    if (cur->dir->is_frozen()) {
+      dout(7) << *cur->dir << " is frozen, stopping" << endl;
+      break;
+    }
     
     // lookup dentry
     int dentry_auth = cur->dir->dentry_authority( dis->get_dentry(i) ).first;
     if (dentry_auth != mds->get_nodeid()) {
-      dout(7) << *cur->dir << "dentry " << dis->get_dentry(i) << " auth " << dentry_auth << ", i'm done." << endl;
+      dout(7) << *cur->dir << " dentry " << dis->get_dentry(i) << " auth " << dentry_auth << ", i'm done." << endl;
       break;      // that's it for us!
     }
 
@@ -3293,7 +3307,7 @@ void MDCache::handle_discover(MDiscover *dis)
 
   // set dir_auth hint?
   if (cur->is_dir() && cur->dir && 
-      cur->is_auth() && !cur->dir->is_auth()) {
+      !cur->dir->is_auth()) {
     dout(7) << "setting dir_auth_hint for " << *cur->dir << endl;
     reply->set_dir_auth_hint(cur->dir->authority().first);
   }
@@ -3402,9 +3416,9 @@ void MDCache::handle_discover_reply(MDiscoverReply *m)
            bc, no flag to indicate a dir discover is underway, (as there is w/ a dentry one).
            this is actually good, since (dir aside) they're asking for different information.
         */
-        dout(7) << "had " << *cur->dir;
+        dout(7) << "had " << *cur->dir << endl;
         m->get_dir(i).update_dir(cur->dir);
-        dout2(7) << "now " << *cur->dir << endl;
+        dout2(7) << "now " << *cur->dir << endl;
       } else {
         // add it (_replica_)
        CDir *ndir = cur->add_dirfrag( new CDir(cur, frag_t(), this, false) );  // FIXME dirfrag_t
index 4b9a3517ac676b1b08b833f078dd0b8ff8d6cc5b..61dec66b704b0d2c5ffef478d70dd15b2fd431a3 100644 (file)
@@ -39,8 +39,6 @@
 #include "messages/MExportDirDiscoverAck.h"
 #include "messages/MExportDirPrep.h"
 #include "messages/MExportDirPrepAck.h"
-#include "messages/MExportDirWarning.h"
-#include "messages/MExportDirWarningAck.h"
 #include "messages/MExportDir.h"
 #include "messages/MExportDirAck.h"
 #include "messages/MExportDirNotify.h"
@@ -93,9 +91,6 @@ void Migrator::dispatch(Message *m)
   case MSG_MDS_EXPORTDIRPREPACK:
     handle_export_prep_ack((MExportDirPrepAck*)m);
     break;
-  case MSG_MDS_EXPORTDIRWARNINGACK:
-    handle_export_warning_ack((MExportDirWarningAck*)m);
-    break;
   case MSG_MDS_EXPORTDIRACK:
     handle_export_ack((MExportDirAck*)m);
     break;
@@ -104,59 +99,10 @@ void Migrator::dispatch(Message *m)
     break;    
 
     // export 3rd party (dir_auth adjustments)
-  case MSG_MDS_EXPORTDIRWARNING:
-    handle_export_warning((MExportDirWarning*)m);
-    break;
   case MSG_MDS_EXPORTDIRNOTIFY:
     handle_export_notify((MExportDirNotify*)m);
     break;
 
-
-    // hashing
-    /*
-  case MSG_MDS_HASHDIRDISCOVER:
-    handle_hash_dir_discover((MHashDirDiscover*)m);
-    break;
-  case MSG_MDS_HASHDIRDISCOVERACK:
-    handle_hash_dir_discover_ack((MHashDirDiscoverAck*)m);
-    break;
-  case MSG_MDS_HASHDIRPREP:
-    handle_hash_dir_prep((MHashDirPrep*)m);
-    break;
-  case MSG_MDS_HASHDIRPREPACK:
-    handle_hash_dir_prep_ack((MHashDirPrepAck*)m);
-    break;
-  case MSG_MDS_HASHDIR:
-    handle_hash_dir((MHashDir*)m);
-    break;
-  case MSG_MDS_HASHDIRACK:
-    handle_hash_dir_ack((MHashDirAck*)m);
-    break;
-  case MSG_MDS_HASHDIRNOTIFY:
-    handle_hash_dir_notify((MHashDirNotify*)m);
-    break;
-
-    // unhashing
-  case MSG_MDS_UNHASHDIRPREP:
-    handle_unhash_dir_prep((MUnhashDirPrep*)m);
-    break;
-  case MSG_MDS_UNHASHDIRPREPACK:
-    handle_unhash_dir_prep_ack((MUnhashDirPrepAck*)m);
-    break;
-  case MSG_MDS_UNHASHDIR:
-    handle_unhash_dir((MUnhashDir*)m);
-    break;
-  case MSG_MDS_UNHASHDIRACK:
-    handle_unhash_dir_ack((MUnhashDirAck*)m);
-    break;
-  case MSG_MDS_UNHASHDIRNOTIFY:
-    handle_unhash_dir_notify((MUnhashDirNotify*)m);
-    break;
-  case MSG_MDS_UNHASHDIRNOTIFYACK:
-    handle_unhash_dir_notify_ack((MUnhashDirNotifyAck*)m);
-    break;
-    */
-
   default:
     assert(0);
   }
@@ -485,7 +431,7 @@ void Migrator::export_dir(CDir *dir,
 
   // send ExportDirDiscover (ask target)
   mds->send_message_mds(new MExportDirDiscover(dir), dest, MDS_PORT_MIGRATOR);
-  dir->auth_pin();   // pin dir, to hang up our freeze  (unpin on prep ack)
+  dir->auth_pin();   // pin dir, to hang up our freeze  (unpin on discover ack)
 
   // take away the popularity we're sending.   FIXME: do this later?
   mds->balancer->subtract_export(dir);
@@ -592,9 +538,10 @@ void Migrator::export_frozen(CDir *dir,
       inode_trace.push_front(cur->inode);
       dout(7) << "  will add " << *cur->inode << endl;
       
-      // include dir? note: this'll include everything except the nested exports themselves, 
-      // since someone else is obviously auth.
-      if (cur->is_auth()) {
+      // include dir?
+      // note: don't replicate ambiguous auth items!  they're
+      //    frozen anyway.
+      if (cur->is_auth() && !cur->auth_is_ambiguous()) {
         prep->add_dir( new CDirDiscover(cur, cur->add_replica(dest)) );  // yay!
         dout(7) << "  added " << *cur << endl;
       }
@@ -648,8 +595,6 @@ void Migrator::handle_export_prep_ack(MExportDirPrepAck *m)
     export_warning_ack_waiting[dir].insert(p->first);
     export_notify_ack_waiting[dir].insert(p->first);  // we'll eventually get a notifyack, too!
 
-    //mds->send_message_mds(new MExportDirWarning(dir->ino(), export_peer[dir]),
-    //p->first, MDS_PORT_MIGRATOR);
     MExportDirNotify *notify = new MExportDirNotify(dir->dirfrag(), true,
                                                    pair<int,int>(mds->get_nodeid(),CDIR_AUTH_UNKNOWN),
                                                    pair<int,int>(mds->get_nodeid(),export_peer[dir]));
@@ -668,36 +613,6 @@ void Migrator::handle_export_prep_ack(MExportDirPrepAck *m)
 }
 
 
-void Migrator::handle_export_warning_ack(MExportDirWarningAck *m)
-{
-  CInode *in = cache->get_inode(m->get_ino());
-  assert(in);
-  CDir *dir = in->dir;
-  assert(dir);
-  
-  dout(7) << "export_warning_ack " << *dir << " from " << m->get_source() << endl;
-
-  if (export_state.count(dir) == 0 ||
-      export_state[dir] != EXPORT_WARNING) {
-    // export must have aborted.  
-    dout(7) << "export must have aborted" << endl;
-    delete m;
-    return;
-  }
-
-  // process the warning_ack
-  int from = m->get_source().num();
-  assert(export_warning_ack_waiting.count(dir));
-  export_warning_ack_waiting[dir].erase(from);
-  
-  if (export_warning_ack_waiting[dir].empty()) 
-    export_go(dir);     // start export.
-    
-  // done
-  delete m;
-}
-
-
 void Migrator::export_go(CDir *dir)
 {  
   assert(export_peer.count(dir));
@@ -1183,7 +1098,8 @@ void Migrator::export_finish(CDir *dir)
 
   // send finish/commit to new auth
   if (mds->mdsmap->is_active_or_stopping(export_peer[dir])) {
-    mds->send_message_mds(new MExportDirFinish(dir->ino()), export_peer[dir], MDS_PORT_MIGRATOR);
+    mds->send_message_mds(new MExportDirFinish(dir->dirfrag()), 
+                         export_peer[dir], MDS_PORT_MIGRATOR);
   } else {
     dout(7) << "not sending MExportDirFinish, dest has failed" << endl;
   }
@@ -1405,7 +1321,7 @@ void Migrator::handle_export_prep(MExportDirPrep *m)
     for (list<dirfrag_t>::iterator it = m->get_bounds().begin();
          it != m->get_bounds().end();
          it++) {
-      dout(7) << "  checking dir " << hex << *it << dec << endl;
+      dout(7) << "  checking bound " << hex << *it << dec << endl;
       CInode *in = cache->get_inode(it->ino);
       assert(in);
       
@@ -1438,7 +1354,7 @@ void Migrator::handle_export_prep(MExportDirPrep *m)
         bound->state_set(CDir::STATE_IMPORTBOUND);
        import_bounds[dir].insert(bound);
       } else {
-        dout(7) << "  already pinned import bound " << *dir << endl;
+        dout(7) << "  already pinned import bound " << *bound << endl;
       }
     } else {
       dout(7) << "  waiting for nested export dir on " << *cache->get_inode(df.ino) << endl;
@@ -1710,7 +1626,7 @@ void Migrator::import_logged_start(CDir *dir, int from)
 
 void Migrator::handle_export_finish(MExportDirFinish *m)
 {
-  CDir *dir = cache->get_dir(m->get_ino());
+  CDir *dir = cache->get_dirfrag(m->get_dirfrag());
   assert(dir);
   dout(7) << "handle_export_finish on " << *dir << endl;
   import_finish(dir);
@@ -1777,9 +1693,10 @@ void Migrator::import_finish(CDir *dir, bool now)
 
 void Migrator::decode_import_inode(CDentry *dn, bufferlist& bl, int& off, int oldauth)
 {  
+  dout(15) << "decode_import_inode on " << *dn << endl;
+
   CInodeExport istate;
   off = istate._decode(bl, off);
-  dout(15) << "got a cinodeexport " << endl;
   
   bool added = false;
   CInode *in = cache->get_inode(istate.get_ino());
@@ -1914,7 +1831,6 @@ int Migrator::decode_import_dir(bufferlist& bl,
       // dentry
       string dname;
       _decode(dname, bl, off);
-      dout(15) << "dname is " << dname << endl;
 
       CDentry *dn = dir->lookup(dname);
       if (!dn)
@@ -1922,6 +1838,7 @@ int Migrator::decode_import_dir(bufferlist& bl,
 
       // decode state
       dn->decode_import_state(bl, off, oldauth, mds->get_nodeid());
+      dout(15) << "decode_import_dir got " << *dn << endl;
 
       // points to...
       char icode;
@@ -1963,31 +1880,6 @@ int Migrator::decode_import_dir(bufferlist& bl,
 
 // authority bystander
 
-void Migrator::handle_export_warning(MExportDirWarning *m)
-{
-  CDir *dir = cache->get_dir(m->get_ino());
-
-  int oldauth = m->get_source().num();
-  int newauth = m->get_new_dir_auth();
-  if (dir) {
-    dout(7) << "handle_export_warning mds" << oldauth
-           << " -> mds" << newauth
-           << " on " << *dir << endl;
-    cache->adjust_subtree_auth(dir, oldauth, newauth);
-    // verify?
-  } else {
-    dout(7) << "handle_export_warning on dir " << m->get_ino() << ", acking" << endl;
-  }
-  
-  // send the ack
-  mds->send_message_mds(new MExportDirWarningAck(m->get_ino()),
-                       m->get_source().num(), MDS_PORT_MIGRATOR);
-
-  delete m;
-
-}
-
-
 void Migrator::handle_export_notify(MExportDirNotify *m)
 {
   CDir *dir = cache->get_dirfrag(m->get_dirfrag());
index 1caa8bb0f32f2d993ccb23d83454a33d92869236..5ddef2517b38a46d0ae761d7b49d1f47731b600d 100644 (file)
@@ -33,8 +33,6 @@ class MExportDirDiscover;
 class MExportDirDiscoverAck;
 class MExportDirPrep;
 class MExportDirPrepAck;
-class MExportDirWarning;
-class MExportDirWarningAck;
 class MExportDir;
 class MExportDirAck;
 class MExportDirNotify;
@@ -175,9 +173,7 @@ public:
  protected:
   void handle_export_discover_ack(MExportDirDiscoverAck *m);
   void export_frozen(CDir *dir, int dest);
-  //void export_start_logged(CDir *dir, MExportDirPrep *prep, int dest);
   void handle_export_prep_ack(MExportDirPrepAck *m);
-  void handle_export_warning_ack(MExportDirWarningAck *m);
   void export_go(CDir *dir);
   int encode_export_dir(list<bufferlist>& dirstatelist,
                       class C_Contexts *fin,
@@ -192,7 +188,6 @@ public:
   void export_finish(CDir *dir);
 
   friend class C_MDC_ExportFreeze;
-  friend class C_MDC_ExportStartLogged;
   friend class C_MDS_ExportFinishLogged;
   // importer
   void handle_export_discover(MExportDirDiscover *m);
@@ -203,11 +198,6 @@ public:
                        int oldauth,
                        CDir *import_root,
                        EImportStart *le);
-  /*
-  void got_hashed_replica(CDir *import,
-                          inodeno_t dir_ino,
-                          inodeno_t replica_ino);
-  */
 public:
   void import_reverse(CDir *dir, bool fix_dir_auth=true);
 protected:
@@ -225,7 +215,6 @@ protected:
   friend class C_MDS_ImportDirLoggedFinish;
 
   // bystander
-  void handle_export_warning(MExportDirWarning *m);
   void handle_export_notify(MExportDirNotify *m);
 
 
index 5a2a5035249863e44cee7a1d5b6c4f8310104f9f..5f21f8ebf0ac1fc0a73363811c59cd74a2387ae1 100644 (file)
@@ -35,7 +35,7 @@ class MExportDirDiscover : public Message {
   }
   virtual char *get_type_name() { return "ExDis"; }
   void print(ostream& o) {
-    o << "export_discover " << dirfrag << " " << path;
+    o << "export_discover(" << dirfrag << " " << path << ")";
   }
 
   virtual void decode_payload() {
index 2d962a4269195671605ce03e0159ef49c43a57b2..44fa0872cf5dec714c3f8e9452faa7a2ffab71ac 100644 (file)
@@ -35,11 +35,11 @@ class MExportDirDiscoverAck : public Message {
 
   virtual char *get_type_name() { return "ExDisA"; }
   void print(ostream& o) {
-    o << "export_discover_ack " << dirfrag;
+    o << "export_discover_ack(" << dirfrag;
     if (success) 
-      o << " success";
+      o << " success)";
     else
-      o << " failure";
+      o << " failure)";
   }
 
   virtual void decode_payload() {
index 3e8b695e443f448a1bf9f9dd834ec595ac083116..3ebe2ae759a3bafd701491bffaa411d2fb30a7ec 100644 (file)
 #include "msg/Message.h"
 
 class MExportDirFinish : public Message {
-  inodeno_t ino;
+  dirfrag_t dirfrag;
 
  public:
-  inodeno_t get_ino() { return ino; }
+  dirfrag_t get_dirfrag() { return dirfrag; }
   
   MExportDirFinish() {}
-  MExportDirFinish(inodeno_t ino) :
+  MExportDirFinish(dirfrag_t dirfrag) :
     Message(MSG_MDS_EXPORTDIRFINISH) {
-    this->ino = ino;
+    this->dirfrag = dirfrag;
   }  
   virtual char *get_type_name() { return "ExFin"; }
   void print(ostream& o) {
-    o << "export_finish(" << ino << ")";
+    o << "export_finish(" << dirfrag << ")";
   }
   virtual void decode_payload() {
     int off = 0;
-    payload.copy(off, sizeof(ino), (char*)&ino);
-    off += sizeof(ino);
+    payload.copy(off, sizeof(dirfrag), (char*)&dirfrag);
+    off += sizeof(dirfrag);
   }
   virtual void encode_payload() {
-    payload.append((char*)&ino, sizeof(ino));
+    payload.append((char*)&dirfrag, sizeof(dirfrag));
   }
 
 };
index d2db8c8f7e11c55c063570169ac767a7b0c7c909..5a3aa3a78cc03b5ac87596274fcf7e8fac5f44ae 100644 (file)
@@ -158,6 +158,7 @@ int fakemessenger_do_loop_2()
         dout(1) << "---- " << m->get_dest() 
                << " <- " << m->get_source()
                 << " ---- " << *m 
+               << " (" << m << ")"
                 << endl;
         
         if (g_conf.fakemessenger_serialize) {
@@ -329,7 +330,10 @@ int FakeMessenger::send_message(Message *m, entity_inst_t inst, int port, int fr
     }
     dm->queue_incoming(m);
 
-    dout(1) << "--> " << get_myname() << " -> " << inst.name << " " << *m << endl;
+    dout(1) << "--> " << get_myname() << " -> " << inst.name 
+           << " " << *m 
+           << " (" << m << ")"
+           << endl;
     
   }
   catch (...) {