Pass these through to the ObjectStore.
Signed-off-by: Sage Weil <sage@redhat.com>
__le32 dest_cid;
__le32 dest_oid; //OP_CLONE, OP_CLONERANGE
__le64 dest_off; //OP_CLONERANGE
- __le32 hint_type; //OP_COLL_HINT
+ union {
+ struct {
+ __le32 hint_type; //OP_COLL_HINT
+ };
+ struct {
+ __le32 alloc_hint_flags; //OP_SETALLOCHINT
+ };
+ };
__le64 expected_object_size; //OP_SETALLOCHINT
__le64 expected_write_size; //OP_SETALLOCHINT
__le32 split_bits; //OP_SPLIT_COLLECTION2
coll_t cid,
const ghobject_t &oid,
uint64_t expected_object_size,
- uint64_t expected_write_size
+ uint64_t expected_write_size,
+ uint32_t flags
) {
if (use_tbl) {
__u32 op = OP_SETALLOCHINT;
_op->oid = _get_object_id(oid);
_op->expected_object_size = expected_object_size;
_op->expected_write_size = expected_write_size;
+ _op->alloc_hint_flags = flags;
}
data.ops++;
}
::decode(expected_object_size, p);
::decode(expected_write_size, p);
- set_alloc_hint(cid, oid, expected_object_size, expected_write_size);
+ set_alloc_hint(cid, oid, expected_object_size, expected_write_size, 0);
}
break;
i->second.set_alloc_hint(
get_coll_ct(i->first, op.oid),
ghobject_t(op.oid, ghobject_t::NO_GEN, i->first),
- object_size, write_size);
+ object_size, write_size, op.flags);
}
}
void operator()(const ECTransaction::NoOp &op) {}
hobject_t oid;
uint64_t expected_object_size;
uint64_t expected_write_size;
+ uint32_t flags;
AllocHintOp(const hobject_t &oid,
uint64_t expected_object_size,
- uint64_t expected_write_size)
- : oid(oid), expected_object_size(expected_object_size),
- expected_write_size(expected_write_size) {}
+ uint64_t expected_write_size,
+ uint32_t flags)
+ : oid(oid),
+ expected_object_size(expected_object_size),
+ expected_write_size(expected_write_size),
+ flags(flags) {}
};
struct NoOp {};
typedef boost::variant<
void set_alloc_hint(
const hobject_t &hoid,
uint64_t expected_object_size,
- uint64_t expected_write_size) {
- ops.push_back(AllocHintOp(hoid, expected_object_size, expected_write_size));
+ uint64_t expected_write_size,
+ uint32_t flags) {
+ ops.push_back(AllocHintOp(hoid, expected_object_size, expected_write_size,
+ flags));
}
void append(PGTransaction *_to_append) {
virtual void set_alloc_hint(
const hobject_t &hoid,
uint64_t expected_object_size,
- uint64_t expected_write_size
+ uint64_t expected_write_size,
+ uint32_t flags
) = 0;
/// Optional, not supported on ec-pool
void set_alloc_hint(
const hobject_t &hoid,
uint64_t expected_object_size,
- uint64_t expected_write_size
+ uint64_t expected_write_size,
+ uint32_t flags
) {
t.set_alloc_hint(get_coll(hoid), ghobject_t(hoid), expected_object_size,
- expected_write_size);
+ expected_write_size, flags);
}
using PGBackend::PGTransaction::append;
t->touch(soid);
}
t->set_alloc_hint(soid, op.alloc_hint.expected_object_size,
- op.alloc_hint.expected_write_size);
+ op.alloc_hint.expected_write_size,
+ op.alloc_hint.flags);
ctx->delta_stats.num_wr++;
result = 0;
}
}
{
ObjectStore::Transaction t;
- t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*4);
+ t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*4, 0);
r = apply_transaction(store, &osr, std::move(t));
ASSERT_EQ(r, 0);
}
}
{
ObjectStore::Transaction t;
- t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*4);
+ t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*4, 0);
r = apply_transaction(store, &osr, std::move(t));
ASSERT_EQ(r, 0);
}