]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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) 2011 New Dream Network | |
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 | #ifndef CEPH_MDSOPENINO_H | |
16 | #define CEPH_MDSOPENINO_H | |
17 | ||
18 | #include "msg/Message.h" | |
19 | ||
11fdf7f2 TL |
20 | class MMDSOpenIno : public MessageInstance<MMDSOpenIno> { |
21 | public: | |
22 | friend factory; | |
23 | ||
7c673cae FG |
24 | inodeno_t ino; |
25 | vector<inode_backpointer_t> ancestors; | |
26 | ||
11fdf7f2 TL |
27 | protected: |
28 | MMDSOpenIno() : MessageInstance(MSG_MDS_OPENINO) {} | |
7c673cae | 29 | MMDSOpenIno(ceph_tid_t t, inodeno_t i, vector<inode_backpointer_t>* pa) : |
11fdf7f2 | 30 | MessageInstance(MSG_MDS_OPENINO), ino(i) { |
7c673cae FG |
31 | header.tid = t; |
32 | if (pa) | |
33 | ancestors = *pa; | |
34 | } | |
11fdf7f2 | 35 | ~MMDSOpenIno() override {} |
7c673cae | 36 | |
11fdf7f2 TL |
37 | public: |
38 | std::string_view get_type_name() const override { return "openino"; } | |
7c673cae FG |
39 | void print(ostream &out) const override { |
40 | out << "openino(" << header.tid << " " << ino << " " << ancestors << ")"; | |
41 | } | |
42 | ||
43 | void encode_payload(uint64_t features) override { | |
11fdf7f2 TL |
44 | using ceph::encode; |
45 | encode(ino, payload); | |
46 | encode(ancestors, payload); | |
7c673cae FG |
47 | } |
48 | void decode_payload() override { | |
11fdf7f2 TL |
49 | auto p = payload.cbegin(); |
50 | decode(ino, p); | |
51 | decode(ancestors, p); | |
7c673cae FG |
52 | } |
53 | }; | |
54 | ||
55 | #endif |