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) 2004-2006 Sage Weil <sage@newdream.net>
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.
16 #ifndef CEPH_MOSDPGUPDATELOGMISSINGREPLY_H
17 #define CEPH_MOSDPGUPDATELOGMISSINGREPLY_H
19 #include "MOSDFastDispatchOp.h"
21 class MOSDPGUpdateLogMissingReply : public MOSDFastDispatchOp {
23 static const int HEAD_VERSION = 2;
24 static const int COMPAT_VERSION = 1;
28 epoch_t map_epoch, min_epoch;
33 epoch_t get_epoch() const { return map_epoch; }
34 spg_t get_pgid() const { return pgid; }
35 epoch_t get_query_epoch() const { return map_epoch; }
36 ceph_tid_t get_tid() const { return rep_tid; }
37 pg_shard_t get_from() const {
38 return pg_shard_t(get_source().num(), from);
40 epoch_t get_map_epoch() const override {
43 epoch_t get_min_epoch() const override {
46 spg_t get_spg() const override {
50 MOSDPGUpdateLogMissingReply()
52 MSG_OSD_PG_UPDATE_LOG_MISSING_REPLY,
56 MOSDPGUpdateLogMissingReply(
63 MSG_OSD_PG_UPDATE_LOG_MISSING_REPLY,
74 ~MOSDPGUpdateLogMissingReply() override {}
77 const char *get_type_name() const override { return "PGUpdateLogMissingReply"; }
78 void print(ostream& out) const override {
79 out << "pg_update_log_missing_reply(" << pgid << " epoch " << map_epoch
81 << " rep_tid " << rep_tid << ")";
84 void encode_payload(uint64_t features) override {
85 ::encode(map_epoch, payload);
86 ::encode(pgid, payload);
87 ::encode(from, payload);
88 ::encode(rep_tid, payload);
89 ::encode(min_epoch, payload);
91 void decode_payload() override {
92 bufferlist::iterator p = payload.begin();
93 ::decode(map_epoch, p);
97 if (header.version >= 2) {
98 ::decode(min_epoch, p);
100 min_epoch = map_epoch;