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_MCLIENTSNAP_H
16 #define CEPH_MCLIENTSNAP_H
18 #include "msg/Message.h"
20 struct MClientSnap : public Message {
21 ceph_mds_snap_head head;
25 vector<inodeno_t> split_inos;
26 vector<inodeno_t> split_realms;
28 MClientSnap(int o=0) :
29 Message(CEPH_MSG_CLIENT_SNAP) {
30 memset(&head, 0, sizeof(head));
34 ~MClientSnap() override {}
37 const char *get_type_name() const override { return "client_snap"; }
38 void print(ostream& out) const override {
39 out << "client_snap(" << ceph_snap_op_name(head.op);
41 out << " split=" << inodeno_t(head.split);
42 out << " tracelen=" << bl.length();
46 void encode_payload(uint64_t features) override {
47 head.num_split_inos = split_inos.size();
48 head.num_split_realms = split_realms.size();
49 head.trace_len = bl.length();
50 ::encode(head, payload);
51 ::encode_nohead(split_inos, payload);
52 ::encode_nohead(split_realms, payload);
53 ::encode_nohead(bl, payload);
55 void decode_payload() override {
56 bufferlist::iterator p = payload.begin();
58 ::decode_nohead(head.num_split_inos, split_inos, p);
59 ::decode_nohead(head.num_split_realms, split_realms, p);
60 ::decode_nohead(head.trace_len, bl, p);