]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
trace playback behaving
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 11 Aug 2007 03:25:21 +0000 (03:25 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 11 Aug 2007 03:25:21 +0000 (03:25 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1620 29311d96-e01e-0410-9327-a35deaab8ce9

branches/sage/mds/client/Client.cc
branches/sage/mds/client/SyntheticClient.cc

index 5a2072540bb031c0e8d2050c7f5088cc170aee50..35c9063ba85c0d8510e811e207fe818c3bed1e1c 100644 (file)
@@ -3408,7 +3408,8 @@ int Client::ll_mknod(inodeno_t parent, const char *name, mode_t mode, dev_t rdev
     _ll_get(in);
   }
   tout << attr->st_ino << endl;
-  dout(3) << "ll_mknod " << parent << " " << name << " = " << r << endl;
+  dout(3) << "ll_mknod " << parent << " " << name
+         << " = " << r << " (" << hex << attr->st_ino << dec << ")" << endl;
   return r;
 }
 
@@ -3435,7 +3436,8 @@ int Client::ll_mkdir(inodeno_t parent, const char *name, mode_t mode, struct sta
     _ll_get(in);
   }
   tout << attr->st_ino << endl;
-  dout(3) << "ll_mkdir " << parent << " " << name << " = " << r << endl;
+  dout(3) << "ll_mkdir " << parent << " " << name
+         << " = " << r << " (" << hex << attr->st_ino << dec << ")" << endl;
   return r;
 }
 
@@ -3462,6 +3464,8 @@ int Client::ll_symlink(inodeno_t parent, const char *name, const char *value, st
     _ll_get(in);
   }
   tout << attr->st_ino << endl;
+  dout(3) << "ll_symlink " << parent << " " << name
+         << " = " << r << " (" << hex << attr->st_ino << dec << ")" << endl;
   return r;
 }
 
@@ -3628,8 +3632,8 @@ int Client::ll_create(inodeno_t parent, const char *name, mode_t mode, int flags
   }
   tout << (unsigned long)*fhp << endl;
   tout << attr->st_ino << endl;
-  dout(3) << "ll_create " << parent << " " << name << " 0" << oct << mode << dec
-         << " " << flags << " = " << r << " (" << *fhp << ")" << endl;
+  dout(3) << "ll_create " << parent << " " << name << " 0" << oct << mode << dec << " " << flags
+         << " = " << r << " (" << *fhp << " " << hex << attr->st_ino << dec << ")" << endl;
   return 0;
 }
 
index 117bc0ce0f8a9bb514a6935749b9818b40d76629..badea61b17878c077a1e987435db073a297ebdc9 100644 (file)
@@ -704,12 +704,12 @@ int SyntheticClient::play_trace(Trace& t, string& prefix)
 
   const char *p = prefix.c_str();
 
-  map<int64_t, int64_t> open_files;
-  map<int64_t, DIR*>    open_dirs;
+  hash_map<int64_t, int64_t> open_files;
+  hash_map<int64_t, DIR*>    open_dirs;
 
-  map<int64_t, Fh*> ll_files;
-  map<int64_t, void*> ll_dirs;
-  map<uint64_t, int64_t> ll_inos;
+  hash_map<int64_t, Fh*> ll_files;
+  hash_map<int64_t, void*> ll_dirs;
+  hash_map<uint64_t, int64_t> ll_inos;
 
   ll_inos[1] = 1; // root inode is known.
 
@@ -855,7 +855,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix)
       const char *name = t.get_string(buf, p);
       int64_t r = t.get_int();
       struct stat attr;
-      if (client->ll_lookup(i, name, &attr) == 0)
+      if (client->ll_lookup(ll_inos[i], name, &attr) == 0)
        ll_inos[r] = attr.st_ino;
     } else if (strcmp(op, "ll_forget") == 0) {
       int64_t i = t.get_int();
@@ -989,12 +989,30 @@ int SyntheticClient::play_trace(Trace& t, string& prefix)
   }
 
   // close open files
-  for (map<int64_t, int64_t>::iterator fi = open_files.begin();
+  for (hash_map<int64_t, int64_t>::iterator fi = open_files.begin();
        fi != open_files.end();
        fi++) {
     dout(1) << "leftover close " << fi->second << endl;
     if (fi->second > 0) client->close(fi->second);
   }
+  for (hash_map<int64_t, DIR*>::iterator fi = open_dirs.begin();
+       fi != open_dirs.end();
+       fi++) {
+    dout(1) << "leftover closedir " << fi->second << endl;
+    if (fi->second != 0) client->closedir(fi->second);
+  }
+  for (hash_map<int64_t,Fh*>::iterator fi = ll_files.begin();
+       fi != ll_files.end();
+       fi++) {
+    dout(1) << "leftover ll_release " << fi->second << endl;
+    if (fi->second > 0) client->ll_release(fi->second);
+  }
+  for (hash_map<int64_t,void*>::iterator fi = ll_dirs.begin();
+       fi != ll_dirs.end();
+       fi++) {
+    dout(1) << "leftover ll_releasedir " << fi->second << endl;
+    if (fi->second > 0) client->ll_releasedir(fi->second);
+  }
   
   return 0;
 }