Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / messages / MInodeFileCaps.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph - scalable distributed file system
5  *
6  * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7  *
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.
12  * 
13  */
14
15
16 #ifndef CEPH_MINODEFILECAPS_H
17 #define CEPH_MINODEFILECAPS_H
18
19 class MInodeFileCaps : public Message {
20   inodeno_t ino;
21   __u32     caps;
22
23  public:
24   inodeno_t get_ino() { return ino; }
25   int       get_caps() { return caps; }
26
27   MInodeFileCaps() : Message(MSG_MDS_INODEFILECAPS) {}
28   MInodeFileCaps(inodeno_t ino, int caps) :
29     Message(MSG_MDS_INODEFILECAPS) {
30     this->ino = ino;
31     this->caps = caps;
32   }
33 private:
34   ~MInodeFileCaps() override {}
35
36 public:
37   const char *get_type_name() const override { return "inode_file_caps";}
38   void print(ostream& out) const override {
39     out << "inode_file_caps(" << ino << " " << ccap_string(caps) << ")";
40   }
41   
42   void encode_payload(uint64_t features) override {
43     ::encode(ino, payload);
44     ::encode(caps, payload);
45   }
46   void decode_payload() override {
47     bufferlist::iterator p = payload.begin();
48     ::decode(ino, p);
49     ::decode(caps, p);
50   }
51 };
52
53 #endif