]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix --undump-journal 2734/head
authorJohn Spray <john.spray@redhat.com>
Thu, 16 Oct 2014 10:17:40 +0000 (11:17 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 16 Oct 2014 10:17:40 +0000 (11:17 +0100)
This hadn't worked for a long time.  This is a fix
for firefly only, as this code was refactored in giant.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/Dumper.cc

index f7f18c9bf3d9574a49edc02a754a55b09326cce0..4e5f28e47198e837f22e9e3d47e9e56cc7d5ec63 100644 (file)
@@ -175,18 +175,14 @@ void Dumper::undump(const char *dump_file)
   object_locator_t oloc(mdsmap->get_metadata_pool());
   SnapContext snapc;
 
-  bool done = false;
-  Cond cond;
-  
   cout << "writing header " << oid << std::endl;
+  C_SaferCond header_cond;
+  lock.Lock();
   objecter->write_full(oid, oloc, snapc, hbl, ceph_clock_now(g_ceph_context), 0, 
                       NULL, 
-                      new C_SafeCond(&lock, &cond, &done));
-
-  lock.Lock();
-  while (!done)
-    cond.Wait(lock);
+                      &header_cond);
   lock.Unlock();
+  header_cond.wait();
   
   // read
   Filer filer(objecter);
@@ -198,13 +194,12 @@ void Dumper::undump(const char *dump_file)
     uint64_t l = MIN(left, 1024*1024);
     j.read_fd(fd, l);
     cout << " writing " << pos << "~" << l << std::endl;
-    filer.write(ino, &h.layout, snapc, pos, l, j, ceph_clock_now(g_ceph_context), 0, NULL, new C_SafeCond(&lock, &cond, &done));
-
+    C_SaferCond body_cond;
     lock.Lock();
-    while (!done)
-      cond.Wait(lock);
+    filer.write(ino, &h.layout, snapc, pos, l, j, ceph_clock_now(g_ceph_context), 0, NULL, &body_cond);
     lock.Unlock();
-    
+    body_cond.wait();
+
     pos += l;
     left -= l;
   }