]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: release partial extents
authorSage Weil <sage@redhat.com>
Thu, 19 May 2016 16:00:08 +0000 (12:00 -0400)
committerSage Weil <sage@redhat.com>
Wed, 1 Jun 2016 15:38:52 +0000 (11:38 -0400)
Use the blob put_ref helper so that we can deallocate blobs partially
(instead of always waiting until they are completely unused).

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 1fe1970e462ff52e38db5a2edcee9f4c7b0a5f91..d7b673e8ab39a6352d381853ff30e191a88d591c 100644 (file)
@@ -5656,13 +5656,14 @@ void BlueStore::_wctx_finish(
   dout(10) << __func__ << " lex_old " << wctx->lex_old << dendl;
   for (auto &l : wctx->lex_old) {
     bluestore_blob_t *b = c->get_blob_ptr(o, l.blob);
-    // fixme: handle partial deallocation
-    b->ref_map.put(l.offset, l.length, NULL);
+    vector<bluestore_pextent_t> r;
+    b->put_ref(l.offset, l.length, min_alloc_size, &r);
+    for (auto e : r) {
+      dout(20) << __func__ << " release " << e << dendl;
+      txc->released.insert(e.offset, e.length);
+    }
     if (b->ref_map.empty()) {
       dout(20) << __func__ << " rm blob " << *b << dendl;
-      for (auto p : b->extents) {
-       txc->released.insert(p.offset, p.length);
-      }
       if (l.blob >= 0) {
        o->onode.blob_map.erase(l.blob);
       } else {