From: Sage Weil Date: Tue, 12 Jan 2016 18:36:14 +0000 (-0500) Subject: os/bluestore: persist alloc hint flags X-Git-Tag: v11.0.0~466^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=306c5e148cd2f538b3b6c8c2a1a3d5f38ef8e15a;p=ceph.git os/bluestore: persist alloc hint flags Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 8d967735bb5e..f39d34bd6028 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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; } diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 67eaf3278e3a..6628bcfbc190 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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, diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index 9d30e8407d6d..437cf605135b 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -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& o) diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index 91b86c9c17cf..604073093ef4 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -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::iterator find_extent(uint64_t offset) { map::iterator fp = block_map.lower_bound(offset);