ceph/src/messages/MInodeFileCaps.h
Adam C. Emerson f45e480e8e messages: Use unqualified encode/decode
This is a portion of Part 1 of the namespace project: using ADL
properly in encode and decode so we can use namespaces easily in Ceph.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2018-01-10 14:02:09 -05:00

56 lines
1.4 KiB
C++

// -*- 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 CEPH_MINODEFILECAPS_H
#define CEPH_MINODEFILECAPS_H
class MInodeFileCaps : public Message {
inodeno_t ino;
__u32 caps = 0;
public:
inodeno_t get_ino() { return ino; }
int get_caps() { return caps; }
MInodeFileCaps() : Message(MSG_MDS_INODEFILECAPS) {}
MInodeFileCaps(inodeno_t ino, int caps) :
Message(MSG_MDS_INODEFILECAPS) {
this->ino = ino;
this->caps = caps;
}
private:
~MInodeFileCaps() override {}
public:
const char *get_type_name() const override { return "inode_file_caps";}
void print(ostream& out) const override {
out << "inode_file_caps(" << ino << " " << ccap_string(caps) << ")";
}
void encode_payload(uint64_t features) override {
using ceph::encode;
encode(ino, payload);
encode(caps, payload);
}
void decode_payload() override {
using ceph::decode;
bufferlist::iterator p = payload.begin();
decode(ino, p);
decode(caps, p);
}
};
#endif