1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
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.
15 #ifndef CEPH_MMDSFRAGMENTNOTIFY_H
16 #define CEPH_MMDSFRAGMENTNOTIFY_H
18 #include "msg/Message.h"
20 class MMDSFragmentNotify : public Message {
26 inodeno_t get_ino() { return ino; }
27 frag_t get_basefrag() { return basefrag; }
28 int get_bits() { return bits; }
32 MMDSFragmentNotify() : Message(MSG_MDS_FRAGMENTNOTIFY) {}
33 MMDSFragmentNotify(dirfrag_t df, int b) :
34 Message(MSG_MDS_FRAGMENTNOTIFY),
35 ino(df.ino), basefrag(df.frag), bits(b) { }
37 ~MMDSFragmentNotify() override {}
40 const char *get_type_name() const override { return "fragment_notify"; }
41 void print(ostream& o) const override {
42 o << "fragment_notify(" << ino << "." << basefrag
43 << " " << (int)bits << ")";
46 void encode_payload(uint64_t features) override {
47 ::encode(ino, payload);
48 ::encode(basefrag, payload);
49 ::encode(bits, payload);
50 ::encode(basebl, payload);
52 void decode_payload() override {
53 bufferlist::iterator p = payload.begin();
55 ::decode(basefrag, p);