include/statlite.h\
include/triple.h\
include/uofs.h\
- include/encodable.h\
include/byteorder.h\
include/inttypes.h\
include/utime.h\
}
__u16 numi, numd;
- ::_decode_simple(numi, p);
- ::_decode_simple(numd, p);
+ ::decode(numi, p);
+ ::decode(numd, p);
dout(10) << "insert_trace got " << numi << " inodes, " << numd << " dentries" << dendl;
// decode
inode:
if (!ileft) goto done;
ileft--;
- ist[ileft]._decode(p);
- ::_decode_simple(ilease[ileft], p);
+ ist[ileft].decode(p);
+ ::decode(ilease[ileft], p);
dentry:
if (!dleft) goto done;
dleft--;
- ::_decode_simple(dname[dleft], p);
- ::_decode_simple(dlease[dleft], p);
- dst[dleft]._decode(p);
+ ::decode(dname[dleft], p);
+ ::decode(dlease[dleft], p);
+ dst[dleft].decode(p);
goto inode;
done:
// dirstat
DirStat dst(p);
__u32 numdn;
- ::_decode_simple(numdn, p);
+ ::decode(numdn, p);
string dname;
LeaseStat dlease, ilease;
while (numdn) {
- ::_decode_simple(dname, p);
- ::_decode_simple(dlease, p);
+ ::decode(dname, p);
+ ::decode(dlease, p);
InodeStat ist(p);
- ::_decode_simple(ilease, p);
+ ::decode(ilease, p);
// cache
Inode *in = this->insert_dentry_inode(dir, dname, &dlease, &ist, &ilease, from);
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation. See file COPYING.
- *
- */
-
-#ifndef __ENCODABLE_H
-#define __ENCODABLE_H
-
-//#warning "deprecated"
-
-#include "buffer.h"
-
-#include <set>
-#include <map>
-#include <deque>
-#include <vector>
-#include <string>
-#include <ext/hash_map>
-
-
-// ==================================================================
-// simple
-
-
-// raw
-template<class T>
-inline void _encode_raw(const T& t, bufferlist& bl)
-{
- bl.append((char*)&t, sizeof(t));
-}
-template<class T>
-inline void _decode_raw(T& t, bufferlist::iterator &p)
-{
- p.copy(sizeof(t), (char*)&t);
-}
-
-#include <set>
-#include <map>
-#include <deque>
-#include <vector>
-#include <string>
-#include <ext/hash_map>
-
-// list
-template<class T>
-inline void _encode_simple(const std::list<T>& ls, bufferlist& bl)
-{
- // should i pre- or post- count?
- if (!ls.empty()) {
- unsigned pos = bl.length();
- uint32_t n = 0;
- _encode_raw(n, bl);
- for (typename std::list<T>::const_iterator p = ls.begin(); p != ls.end(); ++p) {
- n++;
- _encode_simple(*p, bl);
- }
- bl.copy_in(pos, sizeof(n), (char*)&n);
- } else {
- uint32_t n = ls.size(); // FIXME: this is slow on a list.
- _encode_raw(n, bl);
- for (typename std::list<T>::const_iterator p = ls.begin(); p != ls.end(); ++p)
- _encode_simple(*p, bl);
- }
-}
-template<class T>
-inline void _decode_simple(std::list<T>& ls, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- ls.clear();
- while (n--) {
- T v;
- _decode_simple(v, p);
- ls.push_back(v);
- }
-}
-
-// deque
-template<class T>
-inline void _encode_simple(const std::deque<T>& ls, bufferlist& bl)
-{
- uint32_t n = ls.size();
- _encode_raw(n, bl);
- for (typename std::deque<T>::const_iterator p = ls.begin(); p != ls.end(); ++p)
- _encode_simple(*p, bl);
-}
-template<class T>
-inline void _decode_simple(std::deque<T>& ls, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- ls.clear();
- while (n--) {
- T v;
- _decode_simple(v, p);
- ls.push_back(v);
- }
-}
-
-// set
-template<class T>
-inline void _encode_simple(const std::set<T>& s, bufferlist& bl)
-{
- uint32_t n = s.size();
- _encode_raw(n, bl);
- for (typename std::set<T>::const_iterator p = s.begin(); p != s.end(); ++p)
- _encode_simple(*p, bl);
-}
-template<class T>
-inline void _decode_simple(std::set<T>& s, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- s.clear();
- while (n--) {
- T v;
- _decode_simple(v, p);
- s.insert(v);
- }
-}
-
-// vector
-template<class T>
-inline void _encode_simple(const std::vector<T>& v, bufferlist& bl)
-{
- uint32_t n = v.size();
- _encode_raw(n, bl);
- for (typename std::vector<T>::const_iterator p = v.begin(); p != v.end(); ++p)
- _encode_simple(*p, bl);
-}
-template<class T>
-inline void _decode_simple(std::vector<T>& v, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- v.resize(n);
- for (uint32_t i=0; i<n; i++)
- _decode_simple(v[i], p);
-}
-
-// map
-template<class T, class U>
-inline void _encode_simple(const std::map<T,U>& m, bufferlist& bl)
-{
- uint32_t n = m.size();
- _encode_raw(n, bl);
- for (typename std::map<T,U>::const_iterator p = m.begin(); p != m.end(); ++p) {
- _encode_simple(p->first, bl);
- _encode_simple(p->second, bl);
- }
-}
-template<class T, class U>
-inline void _decode_simple(std::map<T,U>& m, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- m.clear();
- while (n--) {
- T k;
- _decode_simple(k, p);
- _decode_simple(m[k], p);
- }
-}
-
-// hash_map
-template<class T, class U>
-inline void _encode_simple(const __gnu_cxx::hash_map<T,U>& m, bufferlist& bl)
-{
- uint32_t n = m.size();
- _encode_raw(n, bl);
- for (typename __gnu_cxx::hash_map<T,U>::const_iterator p = m.begin(); p != m.end(); ++p) {
- _encode_simple(p->first, bl);
- _encode_simple(p->second, bl);
- }
-}
-template<class T, class U>
-inline void _decode_simple(__gnu_cxx::hash_map<T,U>& m, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- m.clear();
- while (n--) {
- T k;
- _decode_simple(k, p);
- _decode_simple(m[k], p);
- }
-}
-
-// string
-inline void _encode_simple(const std::string& s, bufferlist& bl)
-{
- uint32_t len = s.length();
- _encode_raw(len, bl);
- bl.append(s.data(), len);
-}
-inline void _decode_simple(std::string& s, bufferlist::iterator& p)
-{
- uint32_t len;
- _decode_raw(len, p);
- s.clear();
- p.copy(len, s);
-}
-
-// const char* (encode only, string compatible)
-inline void _encode_simple(const char *s, bufferlist& bl)
-{
- uint32_t len = strlen(s);
- _encode_raw(len, bl);
- bl.append(s, len);
-}
-
-// bufferptr (encapsulated)
-inline void _encode_simple(const buffer::ptr& bp, bufferlist& bl)
-{
- uint32_t len = bp.length();
- _encode_raw(len, bl);
- bl.append(bp);
-}
-inline void _decode_simple(buffer::ptr& bp, bufferlist::iterator& p)
-{
- uint32_t len;
- _decode_raw(len, p);
-
- bufferlist s;
- p.copy(len, s);
-
- if (s.buffers().size() == 1)
- bp = s.buffers().front();
- else
- bp = buffer::copy(s.c_str(), s.length());
-}
-
-// bufferlist (encapsulated)
-inline void _encode_simple(const bufferlist& s, bufferlist& bl)
-{
- uint32_t len = s.length();
- _encode_raw(len, bl);
- bl.append(s);
-}
-inline void _encode_simple_destructively(bufferlist& s, bufferlist& bl)
-{
- uint32_t len = s.length();
- _encode_raw(len, bl);
- bl.claim_append(s);
-}
-inline void _decode_simple(bufferlist& s, bufferlist::iterator& p)
-{
- uint32_t len;
- _decode_raw(len, p);
- s.clear();
- p.copy(len, s);
-}
-
-// base
-template<class T>
-inline void _encode_simple(const T& t, bufferlist& bl)
-{
- _encode_raw(t, bl);
-}
-template<class T>
-inline void _decode_simple(T& t, bufferlist::iterator& p)
-{
- _decode_raw(t, p);
-}
-
-
-
-
-// ==================================================================
-// complex
-
-// list
-template<class T>
-inline void _encode_complex(const std::list<T>& ls, bufferlist& bl)
-{
- uint32_t n = ls.size();
- _encode_raw(n, bl);
- for (typename std::list<T>::const_iterator p = ls.begin(); p != ls.end(); ++p)
- _encode_complex(*p, bl);
-}
-template<class T>
-inline void _decode_complex(std::list<T>& ls, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- ls.clear();
- while (n--) {
- T v;
- _decode_complex(v, p);
- ls.push_back(v);
- }
-}
-
-// deque
-template<class T>
-inline void _encode_complex(const std::deque<T>& ls, bufferlist& bl)
-{
- uint32_t n = ls.size();
- _encode_raw(n, bl);
- for (typename std::deque<T>::const_iterator p = ls.begin(); p != ls.end(); ++p)
- _encode_complex(*p, bl);
-}
-template<class T>
-inline void _decode_complex(std::deque<T>& ls, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- ls.clear();
- while (n--) {
- T v;
- _decode_complex(v, p);
- ls.push_back(v);
- }
-}
-
-// set
-template<class T>
-inline void _encode_complex(const std::set<T>& s, bufferlist& bl)
-{
- uint32_t n = s.size();
- _encode_raw(n, bl);
- for (typename std::set<T>::const_iterator p = s.begin(); p != s.end(); ++p)
- _encode_complex(*p, bl);
-}
-template<class T>
-inline void _decode_complex(std::set<T>& s, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- s.clear();
- while (n--) {
- T v;
- _decode_complex(v, p);
- s.insert(v);
- }
-}
-
-// vector
-template<class T>
-inline void _encode_complex(const std::vector<T>& v, bufferlist& bl)
-{
- uint32_t n = v.size();
- _encode_raw(n, bl);
- for (typename std::vector<T>::const_iterator p = v.begin(); p != v.end(); ++p)
- _encode_complex(*p, bl);
-}
-template<class T>
-inline void _decode_complex(std::vector<T>& v, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- v.resize(n);
- for (uint32_t i=0; i<n; i++)
- _decode_complex(v[i], p);
-}
-
-// map
-template<class T, class U>
-inline void _encode_complex(const std::map<T,U>& m, bufferlist& bl)
-{
- uint32_t n = m.size();
- _encode_raw(n, bl);
- for (typename std::map<T,U>::const_iterator p = m.begin(); p != m.end(); ++p) {
- _encode_simple(p->first, bl);
- _encode_complex(p->second, bl);
- }
-}
-template<class T, class U>
-inline void _decode_complex(std::map<T,U>& m, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- m.clear();
- while (n--) {
- T k;
- _decode_simple(k, p);
- _decode_complex(m[k], p);
- }
-}
-
-// hash_map
-template<class T, class U>
-inline void _encode_complex(const __gnu_cxx::hash_map<T,U>& m, bufferlist& bl)
-{
- uint32_t n = m.size();
- _encode_raw(n, bl);
- for (typename __gnu_cxx::hash_map<T,U>::const_iterator p = m.begin(); p != m.end(); ++p) {
- _encode_simple(p->first, bl);
- _encode_complex(p->second, bl);
- }
-}
-template<class T, class U>
-inline void _decode_complex(__gnu_cxx::hash_map<T,U>& m, bufferlist::iterator& p)
-{
- uint32_t n;
- _decode_raw(n, p);
- m.clear();
- while (n--) {
- T k;
- _decode_simple(k, p);
- _decode_complex(m[k], p);
- }
-}
-
-// base case
-template<class T>
-inline void _encode_complex(const T& t, bufferlist& bl)
-{
- t._encode(bl);
-}
-template<class T>
-inline void _decode_complex(T& t, bufferlist::iterator& p)
-{
- t._decode(p);
-}
-
-#endif
WRITE_RAW_ENCODER(ceph_mds_request_head);
WRITE_RAW_ENCODER(ceph_mds_file_caps);
WRITE_RAW_ENCODER(ceph_mds_lease);
+WRITE_RAW_ENCODER(ceph_mds_reply_head);
+WRITE_RAW_ENCODER(ceph_mds_reply_inode);
WRITE_RAW_ENCODER(ceph_osd_request_head);
// ----------------------
LeaseStat e;
e.mask = mask;
e.duration_ms = (int)(1000 * mdcache->client_lease_durations[pool]);
- ::_encode_simple(e, bl);
+ ::encode(e, bl);
}
goto done;
dentry:
- ::_encode_simple(dn->get_name(), bl);
+ ::encode(dn->get_name(), bl);
lmask = mds->locker->issue_client_lease(dn, client, bl, now, session);
numdn++;
dout(20) << " trace added " << lmask << " " << *dn << dendl;
// touch dn
mdcache->lru.lru_touch(dn);
}
- ::_encode_simple(numfiles, dirbl);
+ ::encode(numfiles, dirbl);
dirbl.claim_append(dnbl);
// yay, reply
bufferlist::iterator blp = mdr->more()->inode_import.begin();
// imported caps
- ::_decode_simple(mdr->more()->imported_client_map, blp);
- ::_encode_simple(mdr->more()->imported_client_map, *client_map_bl);
+ ::decode(mdr->more()->imported_client_map, blp);
+ ::encode(mdr->more()->imported_client_map, *client_map_bl);
prepare_force_open_sessions(mdr->more()->imported_client_map);
list<ScatterLock*> updated_scatterlocks; // we clear_updated explicitly below
metareqid_t(entity_name_t n, tid_t t) : name(n), tid(t) {}
};
+static inline void encode(const metareqid_t &r, bufferlist &bl)
+{
+ ::encode(r.name, bl);
+ ::encode(r.tid, bl);
+}
+static inline void decode( metareqid_t &r, bufferlist::iterator &p)
+{
+ ::decode(r.name, p);
+ ::decode(r.tid, p);
+}
+
inline ostream& operator<<(ostream& out, const metareqid_t& r) {
return out << r.name << ":" << r.tid;
}
MDSCacheObjectInfo() : ino(0) {}
- void _encode(bufferlist& bl) const {
+ void encode(bufferlist& bl) const {
::encode(ino, bl);
::encode(dirfrag, bl);
::encode(dname, bl);
}
- void _decode(bufferlist& bl, int& off) {
- ::_decode(ino, bl, off);
- ::_decode(dirfrag, bl, off);
- ::_decode(dname, bl, off);
- }
- void _decode(bufferlist::iterator& p) {
+ void decode(bufferlist::iterator& p) {
::decode(ino, p);
::decode(dirfrag, p);
::decode(dname, p);
}
};
+WRITE_CLASS_ENCODERS(MDSCacheObjectInfo)
+
class MDSCacheObject {
public:
#define __MCLIENTREPLY_H
#include "include/types.h"
-#include "include/encodable.h"
#include "MClientRequest.h"
#include "msg/Message.h"
// this matches ceph_mds_reply_lease
__u16 mask;
__u32 duration_ms;
-} __attribute__ ((packed));
+ void encode(bufferlist &bl) const {
+ ::encode(mask, bl);
+ ::encode(duration_ms, bl);
+ }
+ void decode(bufferlist::iterator &bl) {
+ ::decode(mask, bl);
+ ::decode(duration_ms, bl);
+ }
+};
+WRITE_CLASS_ENCODERS(LeaseStat)
+
+
struct DirStat {
// mds distribution hints
DirStat() {}
DirStat(bufferlist::iterator& p) {
- _decode(p);
+ decode(p);
}
- void _decode(bufferlist::iterator& p) {
- ::_decode_simple(frag, p);
- ::_decode_simple(auth, p);
- ::_decode_simple(is_rep, p);
- ::_decode_simple(dist, p);
+ void decode(bufferlist::iterator& p) {
+ ::decode(frag, p);
+ ::decode(auth, p);
+ ::decode(is_rep, p);
+ ::decode(dist, p);
}
static void _encode(bufferlist& bl, CDir *dir, int whoami) {
dir->get_dist_spec(dist, whoami);
is_rep = dir->is_rep();
- ::_encode_simple(frag, bl);
- ::_encode_simple(auth, bl);
- ::_encode_simple(is_rep, bl);
- ::_encode_simple(dist, bl);
+ ::encode(frag, bl);
+ ::encode(auth, bl);
+ ::encode(is_rep, bl);
+ ::encode(dist, bl);
}
};
public:
InodeStat() {}
InodeStat(bufferlist::iterator& p) {
- _decode(p);
+ decode(p);
}
- void _decode(bufferlist::iterator &p) {
+ void decode(bufferlist::iterator &p) {
struct ceph_mds_reply_inode e;
- ::_decode_simple(e, p);
+ ::decode(e, p);
ino = inodeno_t(e.ino);
version = e.version;
layout = e.layout;
int n = e.fragtree.nsplits;
while (n) {
__u32 s, by;
- ::_decode_simple(s, p);
- ::_decode_simple(by, p);
+ ::decode(s, p);
+ ::decode(by, p);
dirfragtree._splits[s] = by;
n--;
}
- ::_decode_simple(symlink, p);
+ ::decode(symlink, p);
}
static void _encode(bufferlist &bl, CInode *in) {
e.max_size = in->inode.max_size;
e.rdev = in->inode.rdev;
e.fragtree.nsplits = in->dirfragtree._splits.size();
- ::_encode_simple(e, bl);
+ ::encode(e, bl);
for (map<frag_t,int32_t>::iterator p = in->dirfragtree._splits.begin();
p != in->dirfragtree._splits.end();
p++) {
- ::_encode_simple(p->first, bl);
- ::_encode_simple(p->second, bl);
+ ::encode(p->first, bl);
+ ::encode(p->second, bl);
}
- ::_encode_simple(in->symlink, bl);
+ ::encode(in->symlink, bl);
}
};
// serialization
virtual void decode_payload() {
bufferlist::iterator p = payload.begin();
- ::_decode_simple(st, p);
- ::_decode_simple(trace_bl, p);
- ::_decode_simple(dir_bl, p);
+ ::decode(st, p);
+ ::decode(trace_bl, p);
+ ::decode(dir_bl, p);
assert(p.end());
}
virtual void encode_payload() {
- ::_encode_simple(st, payload);
- ::_encode_simple(trace_bl, payload);
- ::_encode_simple(dir_bl, payload);
+ ::encode(st, payload);
+ ::encode(trace_bl, payload);
+ ::encode(dir_bl, payload);
}
}
void decode_payload() {
- int off = 0;
- ::_decode(asker, payload, off);
- ::_decode(action, payload, off);
- ::_decode(reqid, payload, off);
- ::_decode(lock_type, payload, off);
- object_info._decode(payload, off);
- ::_decode(lockdata, payload, off);
+ bufferlist::iterator p = payload.begin();
+ ::decode(asker, p);
+ ::decode(action, p);
+ ::decode(reqid, p);
+ ::decode(lock_type, p);
+ ::decode(object_info, p);
+ ::decode(lockdata, p);
}
virtual void encode_payload() {
- ::_encode(asker, payload);
- ::_encode(action, payload);
- ::_encode(reqid, payload);
- ::_encode(lock_type, payload);
- object_info._encode(payload);
- ::_encode(lockdata, payload);
+ ::encode(asker, payload);
+ ::encode(action, payload);
+ ::encode(reqid, payload);
+ ::encode(lock_type, payload);
+ ::encode(object_info, payload);
+ ::encode(lockdata, payload);
}
};
#include "msg/Message.h"
#include "include/types.h"
-#include "include/encodable.h"
// sent from replica to auth
int32_t linklock;
int32_t dirfragtreelock;
int32_t filelock;
- __int32_t dirlock;
+ int32_t dirlock;
inode_strong() {}
inode_strong(int n, int cw=0, int a=0, int l=0, int dft=0, int f=0, int dl=0) :
caps_wanted(cw),
nonce(n),
authlock(a), linklock(l), dirfragtreelock(dft), filelock(f), dirlock(dl) { }
+ void encode(bufferlist &bl) const {
+ ::encode(caps_wanted, bl);
+ ::encode(nonce, bl);
+ ::encode(authlock, bl);
+ ::encode(linklock, bl);
+ ::encode(dirfragtreelock, bl);
+ ::encode(filelock, bl);
+ ::encode(dirlock, bl);
+ }
+ void decode(bufferlist::iterator &bl) {
+ ::decode(caps_wanted, bl);
+ ::decode(nonce, bl);
+ ::decode(authlock, bl);
+ ::decode(linklock, bl);
+ ::decode(dirfragtreelock, bl);
+ ::decode(filelock, bl);
+ ::decode(dirlock, bl);
+ }
};
+ WRITE_CLASS_ENCODERS(inode_strong)
+
struct inode_full {
inode_t inode;
string symlink;
inode_full(const inode_t& i, const string& s, const fragtree_t& f) :
inode(i), symlink(s), dirfragtree(f) {}
- void _decode(bufferlist::iterator& p) {
- ::_decode_simple(inode, p);
- ::_decode_simple(symlink, p);
+ void decode(bufferlist::iterator& p) {
+ ::decode(inode, p);
+ ::decode(symlink, p);
dirfragtree._decode(p);
}
- void _encode(bufferlist& bl) const {
- ::_encode(inode, bl);
- ::_encode(symlink, bl);
+ void encode(bufferlist& bl) const {
+ ::encode(inode, bl);
+ ::encode(symlink, bl);
dirfragtree._encode(bl);
}
};
+ WRITE_CLASS_ENCODERS(inode_full)
struct dirfrag_strong {
int32_t nonce;
int8_t dir_rep;
dirfrag_strong() {}
dirfrag_strong(int n, int dr) : nonce(n), dir_rep(dr) {}
+ void encode(bufferlist &bl) const {
+ ::encode(nonce, bl);
+ ::encode(dir_rep, bl);
+ }
+ void decode(bufferlist::iterator &bl) {
+ ::decode(nonce, bl);
+ ::decode(dir_rep, bl);
+ }
};
+ WRITE_CLASS_ENCODERS(dirfrag_strong)
+
struct dn_strong {
inodeno_t ino;
inodeno_t remote_ino;
bool is_primary() { return ino > 0; }
bool is_remote() { return remote_ino > 0; }
bool is_null() { return ino == 0 && remote_ino == 0; }
+ void encode(bufferlist &bl) const {
+ ::encode(ino, bl);
+ ::encode(remote_ino, bl);
+ ::encode(remote_d_type, bl);
+ ::encode(nonce, bl);
+ ::encode(lock, bl);
+ }
+ void decode(bufferlist::iterator &bl) {
+ ::decode(ino, bl);
+ ::decode(remote_ino, bl);
+ ::decode(remote_d_type, bl);
+ ::decode(nonce, bl);
+ ::decode(lock, bl);
+ }
};
+ WRITE_CLASS_ENCODERS(dn_strong)
struct dn_weak {
inodeno_t ino;
dn_weak() : ino(0) {}
dn_weak(inodeno_t pi) : ino(pi) {}
+ void encode(bufferlist &bl) const {
+ ::encode(ino, bl);
+ }
+ void decode(bufferlist::iterator &bl) {
+ ::decode(ino, bl);
+ }
};
+ WRITE_CLASS_ENCODERS(dn_weak)
// -- data --
int32_t op;
// -- encoding --
void encode_payload() {
- ::_encode(op, payload);
- ::_encode(strong_inodes, payload);
- ::_encode_complex(full_inodes, payload);
- ::_encode(authpinned_inodes, payload);
- ::_encode(xlocked_inodes, payload);
- ::_encode(cap_export_bl, payload);
- ::_encode(strong_dirfrags, payload);
- ::_encode(weak, payload);
- ::_encode(weak_inodes, payload);
- ::_encode(strong_dentries, payload);
- ::_encode(authpinned_dentries, payload);
- ::_encode(xlocked_dentries, payload);
+ ::encode(op, payload);
+ ::encode(strong_inodes, payload);
+ ::encode(full_inodes, payload);
+ ::encode(authpinned_inodes, payload);
+ ::encode(xlocked_inodes, payload);
+ ::encode(cap_export_bl, payload);
+ ::encode(strong_dirfrags, payload);
+ ::encode(weak, payload);
+ ::encode(weak_inodes, payload);
+ ::encode(strong_dentries, payload);
+ ::encode(authpinned_dentries, payload);
+ ::encode(xlocked_dentries, payload);
}
void decode_payload() {
bufferlist::iterator p = payload.begin();
- ::_decode_simple(op, p);
- ::_decode_simple(strong_inodes, p);
- ::_decode_complex(full_inodes, p);
- ::_decode_simple(authpinned_inodes, p);
- ::_decode_simple(xlocked_inodes, p);
- ::_decode_simple(cap_export_bl, p);
+ ::decode(op, p);
+ ::decode(strong_inodes, p);
+ ::decode(full_inodes, p);
+ ::decode(authpinned_inodes, p);
+ ::decode(xlocked_inodes, p);
+ ::decode(cap_export_bl, p);
if (cap_export_bl.length()) {
bufferlist::iterator q = cap_export_bl.begin();
- ::_decode_simple(cap_exports, q);
- ::_decode_simple(cap_export_paths, q);
+ ::decode(cap_exports, q);
+ ::decode(cap_export_paths, q);
}
- ::_decode_simple(strong_dirfrags, p);
- ::_decode_simple(weak, p);
- ::_decode_simple(weak_inodes, p);
- ::_decode_simple(strong_dentries, p);
- ::_decode_simple(authpinned_dentries, p);
- ::_decode_simple(xlocked_dentries, p);
+ ::decode(strong_dirfrags, p);
+ ::decode(weak, p);
+ ::decode(weak_inodes, p);
+ ::decode(strong_dentries, p);
+ ::decode(authpinned_dentries, p);
+ ::decode(xlocked_dentries, p);
}
};
+WRITE_CLASS_ENCODERS(MMDSCacheRejoin::inode_strong)
+WRITE_CLASS_ENCODERS(MMDSCacheRejoin::inode_full)
+WRITE_CLASS_ENCODERS(MMDSCacheRejoin::dirfrag_strong)
+WRITE_CLASS_ENCODERS(MMDSCacheRejoin::dn_strong)
+WRITE_CLASS_ENCODERS(MMDSCacheRejoin::dn_weak)
+
#endif
#include "msg/Message.h"
#include "include/types.h"
-#include "include/encodable.h"
class MMDSGetMap : public Message {
public:
const char *get_type_name() { return "mds_getmap"; }
void encode_payload() {
- ::_encode_simple(fsid, payload);
- ::_encode_simple(have, payload);
+ ::encode(fsid, payload);
+ ::encode(have, payload);
}
void decode_payload() {
bufferlist::iterator p = payload.begin();
- ::_decode_simple(fsid, p);
- ::_decode_simple(have, p);
+ ::decode(fsid, p);
+ ::decode(have, p);
}
};
#include "msg/Message.h"
#include "mds/mdstypes.h"
-#include "include/encodable.h"
class MMDSSlaveRequest : public Message {
public:
Message(MSG_MDS_SLAVE_REQUEST),
reqid(ri), op(o) { }
void encode_payload() {
- ::_encode(reqid, payload);
- ::_encode(op, payload);
- ::_encode(lock_type, payload);
- object_info._encode(payload);
- ::_encode_complex(authpins, payload);
+ ::encode(reqid, payload);
+ ::encode(op, payload);
+ ::encode(lock_type, payload);
+ ::encode(object_info, payload);
+ ::encode(authpins, payload);
::encode(srcdnpath, payload);
::encode(destdnpath, payload);
- ::_encode(witnesses, payload);
- ::_encode(now, payload);
- ::_encode(inode_export, payload);
- ::_encode(inode_export_v, payload);
- ::_encode(srci_replica, payload);
- ::_encode(stray, payload);
+ ::encode(witnesses, payload);
+ ::encode(now, payload);
+ ::encode(inode_export, payload);
+ ::encode(inode_export_v, payload);
+ ::encode(srci_replica, payload);
+ ::encode(stray, payload);
}
void decode_payload() {
bufferlist::iterator p = payload.begin();
- ::_decode_simple(reqid, p);
- ::_decode_simple(op, p);
- ::_decode_simple(lock_type, p);
- object_info._decode(p);
- ::_decode_complex(authpins, p);
+ ::decode(reqid, p);
+ ::decode(op, p);
+ ::decode(lock_type, p);
+ ::decode(object_info, p);
+ ::decode(authpins, p);
::decode(srcdnpath, p);
::decode(destdnpath, p);
- ::_decode_simple(witnesses, p);
- ::_decode_simple(now, p);
- ::_decode_simple(inode_export, p);
- ::_decode_simple(inode_export_v, p);
- ::_decode_simple(srci_replica, p);
- ::_decode_simple(stray, p);
+ ::decode(witnesses, p);
+ ::decode(now, p);
+ ::decode(inode_export, p);
+ ::decode(inode_export_v, p);
+ ::decode(srci_replica, p);
+ ::decode(stray, p);
}
const char *get_type_name() { return "slave_request"; }