MOSDECSubOpWrite()
: Message(MSG_OSD_EC_WRITE, HEAD_VERSION, COMPAT_VERSION)
{}
- MOSDECSubOpWrite(ECSubWrite &op)
- : Message(MSG_OSD_EC_WRITE, HEAD_VERSION, COMPAT_VERSION),
- op(op) {}
+ MOSDECSubOpWrite(ECSubWrite &in_op)
+ : Message(MSG_OSD_EC_WRITE, HEAD_VERSION, COMPAT_VERSION) {
+ op.claim(in_op);
+ }
virtual void decode_payload() {
bufferlist::iterator p = payload.begin();
get_parent()->whoami_shard().shard >= ec_impl->get_data_chunk_count())
op.t.set_fadvise_flag(CEPH_OSD_OP_FLAG_FADVISE_DONTNEED);
- localt->append(op.t);
if (on_local_applied_sync) {
dout(10) << "Queueing onreadable_sync: " << on_local_applied_sync << dendl;
localt->register_on_applied_sync(on_local_applied_sync);
new SubWriteApplied(this, msg, op.tid, op.at_version)));
localt->register_on_applied(
new ObjectStore::C_DeleteTransaction(localt));
- get_parent()->queue_transaction(localt, msg);
+ list<ObjectStore::Transaction*> tls;
+ tls.push_back(localt);
+ tls.push_back(new ObjectStore::Transaction);
+ tls.back()->swap(op.t);
+ tls.back()->register_on_complete(
+ new ObjectStore::C_DeleteTransaction(tls.back()));
+ get_parent()->queue_transactions(tls, msg);
}
void ECBackend::handle_sub_read(
temp_added(temp_added),
temp_removed(temp_removed),
updated_hit_set_history(updated_hit_set_history) {}
+ void claim(ECSubWrite &other) {
+ from = other.from;
+ tid = other.tid;
+ reqid = other.reqid;
+ soid = other.soid;
+ stats = other.stats;
+ t.swap(other.t);
+ at_version = other.at_version;
+ trim_to = other.trim_to;
+ trim_rollback_to = other.trim_rollback_to;
+ log_entries.swap(other.log_entries);
+ temp_added.swap(other.temp_added);
+ temp_removed.swap(other.temp_removed);
+ updated_hit_set_history = other.updated_hit_set_history;
+ }
void encode(bufferlist &bl) const;
void decode(bufferlist::iterator &bl);
void dump(Formatter *f) const;
static void generate_test_instances(list<ECSubWrite*>& o);
+private:
+ // no outside copying -- slow
+ ECSubWrite(ECSubWrite& other);
+ const ECSubWrite& operator=(const ECSubWrite& other);
};
WRITE_CLASS_ENCODER(ECSubWrite)
TYPE(ECUtil::HashInfo)
#include "osd/ECMsgTypes.h"
-TYPE(ECSubWrite)
+TYPE_NOCOPY(ECSubWrite)
TYPE(ECSubWriteReply)
TYPE_FEATUREFUL(ECSubRead)
TYPE(ECSubReadReply)