]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
...
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 16 Sep 2006 22:10:26 +0000 (22:10 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 16 Sep 2006 22:10:26 +0000 (22:10 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@865 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/ebofs/Ebofs.cc

index a0d13e9bdd2f57297ca90ffc09291c4ab292fd02..e31e3a1e0417444844396ff2ad08a5ae5b373fac 100644 (file)
@@ -1320,19 +1320,23 @@ void Ebofs::alloc_write(Onode *on,
          on->map_extents(bh->start(), bh->length(), old);
          assert(old.size() == 1);
 
-         if (bc.bh_cancel_write(bh)) {
-               dout(10) << "alloc_write unallocated tx " << old[0] << ", canceled " << *bh << endl;
-               allocator.unallocate(old[0]);  // release (into free)
-               alloc.insert(bh->start(), bh->length());
-         } else {
-               if (bh->start() >= start && bh->end() <= start+len) {
-                 dout(10) << "alloc_write released tx " << old[0] << ", couldn't cancel " << *bh << endl;
-                 allocator.release(old[0]);     // release (into limbo)
+         if (bh->start() >= start && bh->end() <= start+len) {
+               if (bc.bh_cancel_write(bh)) {
+                 if (bh->length() == 1)
+                 dout(-10) << "alloc_write unallocated tx " << old[0] << ", canceled " << *bh << endl;
+                 allocator.unallocate(old[0]);  // release (into free)
                  alloc.insert(bh->start(), bh->length());
                } else {
-                 dout(10) << "alloc_write  skipped tx " << old[0] << ", not entirely within " 
-                                       << start << "~" << len << " and couldn't cancel " << *bh << endl;
+                 if (bh->length() == 1)
+                 dout(-10) << "alloc_write released tx " << old[0] << ", couldn't cancel " << *bh << endl;
+                 allocator.release(old[0]);     // release (into limbo)
+                 alloc.insert(bh->start(), bh->length());
                }
+         } else {
+               if (bh->length() == 1)
+               dout(-10) << "alloc_write  skipped tx " << old[0] << ", not entirely within " 
+                                << start << "~" << len 
+                                << " bh " << *bh << endl;
          }
        }