]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MExportDirPrep.h
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 SafeMessage
{
24 static const int HEAD_VERSION
= 1;
25 static const int COMPAT_VERSION
= 1;
30 list
<dirfrag_t
> bounds
;
31 list
<bufferlist
> traces
;
33 set
<mds_rank_t
> bystanders
;
34 bool b_did_assim
= false;
37 dirfrag_t
get_dirfrag() const { return dirfrag
; }
38 const list
<dirfrag_t
>& get_bounds() const { return bounds
; }
39 const set
<mds_rank_t
> &get_bystanders() const { return bystanders
; }
41 bool did_assim() const { return b_did_assim
; }
42 void mark_assim() { b_did_assim
= true; }
45 MExportDirPrep() = default;
46 MExportDirPrep(dirfrag_t df
, uint64_t tid
) :
47 SafeMessage
{MSG_MDS_EXPORTDIRPREP
, HEAD_VERSION
, COMPAT_VERSION
},
52 ~MExportDirPrep() override
{}
55 std::string_view
get_type_name() const override
{ return "ExP"; }
56 void print(ostream
& o
) const override
{
57 o
<< "export_prep(" << dirfrag
<< ")";
60 void add_bound(dirfrag_t df
) {
61 bounds
.push_back( df
);
63 void add_trace(bufferlist
& bl
) {
66 void add_bystander(mds_rank_t who
) {
67 bystanders
.insert(who
);
70 void decode_payload() override
{
72 auto p
= payload
.cbegin();
77 decode(bystanders
, p
);
80 void encode_payload(uint64_t features
) override
{
82 encode(dirfrag
, payload
);
83 encode(basedir
, payload
);
84 encode(bounds
, payload
);
85 encode(traces
, payload
);
86 encode(bystanders
, payload
);
89 template<class T
, typename
... Args
>
90 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);