]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/kstore: persist alloc hint flags
authorSage Weil <sage@redhat.com>
Tue, 12 Jan 2016 18:36:20 +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/kstore/KStore.cc
src/os/kstore/KStore.h
src/os/kstore/kstore_types.cc
src/os/kstore/kstore_types.h

index a98396f492c4630604d613ff9c5e883116740fa4..972ee8e910bd29109d995a2bd4089fba466da31b 100644 (file)
@@ -2741,9 +2741,11 @@ void KStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       {
         uint64_t expected_object_size = op->expected_object_size;
         uint64_t expected_write_size = op->expected_write_size;
+       uint32_t flags = op->alloc_hint_flags;
        r = _setallochint(txc, c, o,
                          expected_object_size,
-                         expected_write_size);
+                         expected_write_size,
+                         flags);
       }
       break;
 
@@ -3346,15 +3348,19 @@ int KStore::_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
index 87d8da2d9827d6e2cb3e4ac6b3700595da0b40fd..ffdecf47aa1cc5717e6493334802073ad7af3b86 100644 (file)
@@ -614,7 +614,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 b8bbb05d5dbc0552429ad4dcb8cf033266f2856b..0489db02ca69a5704d1d9832e10e7755f74a10b7 100644 (file)
@@ -57,6 +57,7 @@ void kstore_onode_t::encode(bufferlist& bl) const
   ::encode(stripe_size, bl);
   ::encode(expected_object_size, bl);
   ::encode(expected_write_size, bl);
+  ::encode(alloc_hint_flags, bl);
   ENCODE_FINISH(bl);
 }
 
@@ -70,6 +71,7 @@ void kstore_onode_t::decode(bufferlist::iterator& p)
   ::decode(stripe_size, p);
   ::decode(expected_object_size, p);
   ::decode(expected_write_size, p);
+  ::decode(alloc_hint_flags, p);
   DECODE_FINISH(p);
 }
 
@@ -90,6 +92,7 @@ void kstore_onode_t::dump(Formatter *f) const
   f->dump_unsigned("stripe_size", stripe_size);
   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 kstore_onode_t::generate_test_instances(list<kstore_onode_t*>& o)
index 8a880742dd4aa7068470a2a6edf0277b240ca27f..7cfb2475d1f2ff5ebc28ffa6c3f9f3375013ed2b 100644 (file)
@@ -47,6 +47,7 @@ struct kstore_onode_t {
 
   uint32_t expected_object_size;
   uint32_t expected_write_size;
+  uint32_t alloc_hint_flags;
 
   kstore_onode_t()
     : nid(0),
@@ -54,7 +55,8 @@ struct kstore_onode_t {
       omap_head(0),
       stripe_size(0),
       expected_object_size(0),
-      expected_write_size(0) {}
+      expected_write_size(0),
+      alloc_hint_flags(0) {}
 
   void encode(bufferlist& bl) const;
   void decode(bufferlist::iterator& p);