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.
15 #ifndef CEPH_MBACKFILL_H
16 #define CEPH_MBACKFILL_H
18 #include "msg/Message.h"
20 class MBackfillReserve : public Message {
21 static const int HEAD_VERSION = 3;
22 static const int COMPAT_VERSION = 3;
35 : Message(MSG_OSD_BACKFILL_RESERVE, HEAD_VERSION, COMPAT_VERSION),
36 query_epoch(0), type(-1), priority(-1) {}
37 MBackfillReserve(int type,
39 epoch_t query_epoch, unsigned prio = -1)
40 : Message(MSG_OSD_BACKFILL_RESERVE, HEAD_VERSION, COMPAT_VERSION),
41 pgid(pgid), query_epoch(query_epoch),
42 type(type), priority(prio) {}
44 const char *get_type_name() const override {
45 return "MBackfillReserve";
48 void print(ostream& out) const override {
49 out << "MBackfillReserve ";
61 out << " pgid: " << pgid << ", query_epoch: " << query_epoch;
62 if (type == REQUEST) out << ", prio: " << priority;
66 void decode_payload() override {
67 bufferlist::iterator p = payload.begin();
68 ::decode(pgid.pgid, p);
69 ::decode(query_epoch, p);
71 ::decode(priority, p);
72 ::decode(pgid.shard, p);
75 void encode_payload(uint64_t features) override {
76 ::encode(pgid.pgid, payload);
77 ::encode(query_epoch, payload);
78 ::encode(type, payload);
79 ::encode(priority, payload);
80 ::encode(pgid.shard, payload);