]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MDentryUnlink.h
update sources to v12.2.5
[ceph.git] / ceph / src / messages / MDentryUnlink.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_MDENTRYUNLINK_H
17 #define CEPH_MDENTRYUNLINK_H
18
19 #include <boost/utility/string_view.hpp>
20
21 class MDentryUnlink : public Message {
22 dirfrag_t dirfrag;
23 string dn;
24
25 public:
26 dirfrag_t get_dirfrag() { return dirfrag; }
27 string& get_dn() { return dn; }
28
29 bufferlist straybl;
30
31 MDentryUnlink() :
32 Message(MSG_MDS_DENTRYUNLINK) { }
33 MDentryUnlink(dirfrag_t df, boost::string_view n) :
34 Message(MSG_MDS_DENTRYUNLINK),
35 dirfrag(df),
36 dn(n) {}
37 private:
38 ~MDentryUnlink() override {}
39
40 public:
41 const char *get_type_name() const override { return "dentry_unlink";}
42 void print(ostream& o) const override {
43 o << "dentry_unlink(" << dirfrag << " " << dn << ")";
44 }
45
46 void decode_payload() override {
47 bufferlist::iterator p = payload.begin();
48 ::decode(dirfrag, p);
49 ::decode(dn, p);
50 ::decode(straybl, p);
51 }
52 void encode_payload(uint64_t features) override {
53 ::encode(dirfrag, payload);
54 ::encode(dn, payload);
55 ::encode(straybl, payload);
56 }
57 };
58
59 #endif