1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2013 Inktank Storage, Inc.
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef MOSDECSUBOPWRITEREPLY_H
16 #define MOSDECSUBOPWRITEREPLY_H
18 #include "MOSDFastDispatchOp.h"
19 #include "osd/ECMsgTypes.h"
21 class MOSDECSubOpWriteReply : public MOSDFastDispatchOp {
22 static const int HEAD_VERSION = 2;
23 static const int COMPAT_VERSION = 1;
27 epoch_t map_epoch, min_epoch;
30 int get_cost() const override {
33 epoch_t get_map_epoch() const override {
36 epoch_t get_min_epoch() const override {
39 spg_t get_spg() const override {
43 MOSDECSubOpWriteReply()
44 : MOSDFastDispatchOp(MSG_OSD_EC_WRITE_REPLY, HEAD_VERSION, COMPAT_VERSION)
47 void decode_payload() override {
48 bufferlist::iterator p = payload.begin();
50 ::decode(map_epoch, p);
52 if (header.version >= 2) {
53 ::decode(min_epoch, p);
56 min_epoch = map_epoch;
60 void encode_payload(uint64_t features) override {
61 ::encode(pgid, payload);
62 ::encode(map_epoch, payload);
63 ::encode(op, payload);
64 ::encode(min_epoch, payload);
65 encode_trace(payload, features);
68 const char *get_type_name() const override { return "MOSDECSubOpWriteReply"; }
70 void print(ostream& out) const override {
71 out << "MOSDECSubOpWriteReply(" << pgid
72 << " " << map_epoch << "/" << min_epoch