From: Sage Weil Date: Tue, 12 Jan 2016 18:36:20 +0000 (-0500) Subject: os/kstore: persist alloc hint flags X-Git-Tag: v11.0.0~466^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5a233e5a9f4cba6a086478c9699043e344e547b9;p=ceph.git os/kstore: persist alloc hint flags Signed-off-by: Sage Weil --- diff --git a/src/os/kstore/KStore.cc b/src/os/kstore/KStore.cc index a98396f492c4..972ee8e910bd 100644 --- a/src/os/kstore/KStore.cc +++ b/src/os/kstore/KStore.cc @@ -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 diff --git a/src/os/kstore/KStore.h b/src/os/kstore/KStore.h index 87d8da2d9827..ffdecf47aa1c 100644 --- a/src/os/kstore/KStore.h +++ b/src/os/kstore/KStore.h @@ -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, diff --git a/src/os/kstore/kstore_types.cc b/src/os/kstore/kstore_types.cc index b8bbb05d5dbc..0489db02ca69 100644 --- a/src/os/kstore/kstore_types.cc +++ b/src/os/kstore/kstore_types.cc @@ -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& o) diff --git a/src/os/kstore/kstore_types.h b/src/os/kstore/kstore_types.h index 8a880742dd4a..7cfb2475d1f2 100644 --- a/src/os/kstore/kstore_types.h +++ b/src/os/kstore/kstore_types.h @@ -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);