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_MCLIENTRECONNECT_H
16
#define CEPH_MCLIENTRECONNECT_H
18
#include "msg/Message.h"
19
#include "mds/mdstypes.h"
21
class MClientReconnect : public Message {
23
map<inodeno_t, cap_reconnect_t> caps; // only head inodes
24
vector<ceph_mds_snaprealm_reconnect> realms;
26
MClientReconnect() : Message(CEPH_MSG_CLIENT_RECONNECT) {}
28
~MClientReconnect() {}
31
const char *get_type_name() { return "client_reconnect"; }
32
void print(ostream& out) {
33
out << "client_reconnect("
34
<< caps.size() << " caps)";
37
void add_cap(inodeno_t ino, uint64_t cap_id, inodeno_t pathbase, const string& path,
38
int wanted, int issued,
39
loff_t sz, utime_t mt, utime_t at,
41
caps[ino] = cap_reconnect_t(cap_id, pathbase, path, wanted, issued, sz, mt, at, sr);
43
void add_snaprealm(inodeno_t ino, snapid_t seq, inodeno_t parent) {
44
ceph_mds_snaprealm_reconnect r;
51
void encode_payload() {
53
::encode_nohead(realms, data);
55
void decode_payload() {
56
bufferlist::iterator p = data.begin();
59
realms.push_back(ceph_mds_snaprealm_reconnect());
60
::decode(realms.back(), p);