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.
14 #ifndef CEPH_FSMAPCOMPACT_H
15 #define CEPH_FSMAPCOMPACT_H
19 #include <boost/utility/string_view.hpp>
21 #include "mds/mdstypes.h"
28 fs_info_t() : cid(FS_CLUSTER_ID_NONE
) {}
29 void encode(bufferlist
& bl
, uint64_t features
) const;
30 void decode(bufferlist::iterator
&bl
);
34 fs_cluster_id_t legacy_client_fscid
;
35 std::map
<fs_cluster_id_t
, fs_info_t
> filesystems
;
38 : epoch(0), legacy_client_fscid(FS_CLUSTER_ID_NONE
) { }
40 epoch_t
get_epoch() const { return epoch
; }
42 fs_cluster_id_t
get_fs_cid(boost::string_view name
) const {
43 for (auto &p
: filesystems
) {
44 if (p
.second
.name
== name
)
47 return FS_CLUSTER_ID_NONE
;
50 void encode(bufferlist
& bl
, uint64_t features
) const;
51 void decode(bufferlist::iterator
& bl
);
53 void print(ostream
& out
) const;
54 void print_summary(Formatter
*f
, ostream
*out
);
56 static void generate_test_instances(list
<FSMapUser
*>& ls
);
58 WRITE_CLASS_ENCODER_FEATURES(FSMapUser::fs_info_t
)
59 WRITE_CLASS_ENCODER_FEATURES(FSMapUser
)
61 inline ostream
& operator<<(ostream
& out
, FSMapUser
& m
) {
62 m
.print_summary(NULL
, &out
);