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) 2017 Sage Weil <sage@redhat.com>
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_MOSDPGBACKFILLREMOVE_H
16 #define CEPH_MOSDPGBACKFILLREMOVE_H
18 #include "MOSDFastDispatchOp.h"
21 * instruct non-primary to remove some objects during backfill
24 struct MOSDPGBackfillRemove : public MOSDFastDispatchOp {
26 static const int HEAD_VERSION = 1;
27 static const int COMPAT_VERSION = 1;
29 spg_t pgid; ///< target spg_t
30 epoch_t map_epoch = 0;
31 list<pair<hobject_t,eversion_t>> ls; ///< objects to remove
33 epoch_t get_map_epoch() const override {
36 spg_t get_spg() const override {
40 MOSDPGBackfillRemove()
41 : MOSDFastDispatchOp(MSG_OSD_PG_BACKFILL_REMOVE, HEAD_VERSION,
44 MOSDPGBackfillRemove(spg_t pgid, epoch_t map_epoch)
45 : MOSDFastDispatchOp(MSG_OSD_PG_BACKFILL_REMOVE, HEAD_VERSION,
48 map_epoch(map_epoch) {}
51 ~MOSDPGBackfillRemove() {}
54 const char *get_type_name() const { return "backfill_remove"; }
55 void print(ostream& out) const {
56 out << "backfill_remove(" << pgid << " e" << map_epoch
60 void encode_payload(uint64_t features) {
61 ::encode(pgid, payload);
62 ::encode(map_epoch, payload);
63 ::encode(ls, payload);
65 void decode_payload() {
66 bufferlist::iterator p = payload.begin();
68 ::decode(map_epoch, p);