]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: persist alloc hint flags 6208/head
authorSage Weil <sage@redhat.com>
Tue, 12 Jan 2016 18:36:14 +0000 (13:36 -0500)
committerSage Weil <sage@redhat.com>
Sat, 14 May 2016 13:39:23 +0000 (09:39 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h
src/os/bluestore/bluestore_types.cc
src/os/bluestore/bluestore_types.h

index 8d967735bb5e251c805dcda21c8d7a18bfe2e6dc..f39d34bd6028f3d494c6d6969f29302af7c7af55 100644 (file)
@@ -4691,11 +4691,10 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
 
     case Transaction::OP_SETALLOCHINT:
       {
-        uint64_t expected_object_size = op->expected_object_size;
-        uint64_t expected_write_size = op->expected_write_size;
        r = _setallochint(txc, c, o,
-                         expected_object_size,
-                         expected_write_size);
+                         op->expected_object_size,
+                         op->expected_write_size,
+                         op->alloc_hint_flags);
       }
       break;
 
@@ -6292,19 +6291,23 @@ int BlueStore::_setallochint(TransContext *txc,
                             CollectionRef& c,
                             OnodeRef& o,
                             uint64_t expected_object_size,
-                            uint64_t expected_write_size)
+                            uint64_t expected_write_size,
+                            uint32_t flags)
 {
   dout(15) << __func__ << " " << c->cid << " " << o->oid
           << " object_size " << expected_object_size
           << " write_size " << expected_write_size
+          << " flags " << flags
           << dendl;
   int r = 0;
   o->onode.expected_object_size = expected_object_size;
   o->onode.expected_write_size = expected_write_size;
+  o->onode.alloc_hint_flags = flags;
   txc->write_onode(o);
   dout(10) << __func__ << " " << c->cid << " " << o->oid
           << " object_size " << expected_object_size
           << " write_size " << expected_write_size
+          << " flags " << flags
           << " = " << r << dendl;
   return r;
 }
index 67eaf3278e3a11b553b699b1db55b8e941f3c4cb..6628bcfbc190ef2eab3781dabfcaa7d05152d57c 100644 (file)
@@ -976,7 +976,8 @@ private:
                    CollectionRef& c,
                    OnodeRef& o,
                    uint64_t expected_object_size,
-                   uint64_t expected_write_size);
+                   uint64_t expected_write_size,
+                   uint32_t flags);
   int _clone(TransContext *txc,
             CollectionRef& c,
             OnodeRef& oldo,
index 9d30e8407d6d1cd523b4de6532fed251a32564f8..437cf605135bdb56815a2ecfa75e6d551cefd591 100644 (file)
@@ -394,6 +394,7 @@ void bluestore_onode_t::encode(bufferlist& bl) const
   ::encode(omap_head, bl);
   ::encode(expected_object_size, bl);
   ::encode(expected_write_size, bl);
+  ::encode(alloc_hint_flags, bl);
   ENCODE_FINISH(bl);
 }
 
@@ -410,6 +411,7 @@ void bluestore_onode_t::decode(bufferlist::iterator& p)
   ::decode(omap_head, p);
   ::decode(expected_object_size, p);
   ::decode(expected_write_size, p);
+  ::decode(alloc_hint_flags, p);
   DECODE_FINISH(p);
 }
 
@@ -457,6 +459,7 @@ void bluestore_onode_t::dump(Formatter *f) const
   f->dump_unsigned("omap_head", omap_head);
   f->dump_unsigned("expected_object_size", expected_object_size);
   f->dump_unsigned("expected_write_size", expected_write_size);
+  f->dump_unsigned("alloc_hint_flags", alloc_hint_flags);
 }
 
 void bluestore_onode_t::generate_test_instances(list<bluestore_onode_t*>& o)
index 91b86c9c17cf9d8626a05aadd66369bdfad12df0..604073093ef45c8a5a6a761c212e9f0d813f3741 100644 (file)
@@ -189,6 +189,7 @@ struct bluestore_onode_t {
 
   uint32_t expected_object_size;
   uint32_t expected_write_size;
+  uint32_t alloc_hint_flags;
 
   bluestore_onode_t()
     : nid(0),
@@ -196,7 +197,8 @@ struct bluestore_onode_t {
       last_overlay_key(0),
       omap_head(0),
       expected_object_size(0),
-      expected_write_size(0) {}
+      expected_write_size(0),
+      alloc_hint_flags(0) {}
 
   map<uint64_t,bluestore_extent_t>::iterator find_extent(uint64_t offset) {
     map<uint64_t,bluestore_extent_t>::iterator fp = block_map.lower_bound(offset);