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_MEXPORTDIRPREP_H
17 #define CEPH_MEXPORTDIRPREP_H
19 #include "msg/Message.h"
20 #include "include/types.h"
22 class MExportDirPrep : public Message {
26 list<dirfrag_t> bounds;
27 list<bufferlist> traces;
29 set<mds_rank_t> bystanders;
33 dirfrag_t get_dirfrag() { return dirfrag; }
34 list<dirfrag_t>& get_bounds() { return bounds; }
35 set<mds_rank_t> &get_bystanders() { return bystanders; }
37 bool did_assim() { return b_did_assim; }
38 void mark_assim() { b_did_assim = true; }
43 MExportDirPrep(dirfrag_t df, uint64_t tid) :
44 Message(MSG_MDS_EXPORTDIRPREP),
45 dirfrag(df), b_did_assim(false) {
49 ~MExportDirPrep() override {}
52 const char *get_type_name() const override { return "ExP"; }
53 void print(ostream& o) const override {
54 o << "export_prep(" << dirfrag << ")";
57 void add_bound(dirfrag_t df) {
58 bounds.push_back( df );
60 void add_trace(bufferlist& bl) {
63 void add_bystander(mds_rank_t who) {
64 bystanders.insert(who);
67 void decode_payload() override {
68 bufferlist::iterator p = payload.begin();
73 ::decode(bystanders, p);
76 void encode_payload(uint64_t features) override {
77 ::encode(dirfrag, payload);
78 ::encode(basedir, payload);
79 ::encode(bounds, payload);
80 ::encode(traces, payload);
81 ::encode(bystanders, payload);