]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MMDSSnapUpdate.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.
15 #ifndef CEPH_MMDSSNAPUPDATE_H
16 #define CEPH_MMDSSNAPUPDATE_H
18 #include "messages/MMDSOp.h"
20 class MMDSSnapUpdate final
: public MMDSOp
{
26 inodeno_t
get_ino() const { return ino
; }
27 int get_snap_op() const { return snap_op
; }
29 ceph::buffer::list snap_blob
;
32 MMDSSnapUpdate() : MMDSOp
{MSG_MDS_SNAPUPDATE
} {}
33 MMDSSnapUpdate(inodeno_t i
, version_t tid
, int op
) :
34 MMDSOp
{MSG_MDS_SNAPUPDATE
}, ino(i
), snap_op(op
) {
37 ~MMDSSnapUpdate() final
{}
40 std::string_view
get_type_name() const override
{ return "snap_update"; }
41 void print(std::ostream
& o
) const override
{
42 o
<< "snap_update(" << ino
<< " table_tid " << get_tid() << ")";
45 void encode_payload(uint64_t features
) override
{
48 encode(snap_op
, payload
);
49 encode(snap_blob
, payload
);
51 void decode_payload() override
{
53 auto p
= payload
.cbegin();
59 template<class T
, typename
... Args
>
60 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);
61 template<class T
, typename
... Args
>
62 friend MURef
<T
> crimson::make_message(Args
&&... args
);