]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/osd/osd_meta.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / crimson / osd / osd_meta.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #pragma once
5
6 #include <map>
7 #include <string>
8 #include <seastar/core/future.hh>
9 #include "osd/osd_types.h"
10
11 namespace ceph::os {
12 class CyanStore;
13 class Collection;
14 class Transaction;
15 }
16
17 /// metadata shared across PGs, or put in another way,
18 /// metadata not specific to certain PGs.
19 class OSDMeta {
20 template<typename T> using Ref = boost::intrusive_ptr<T>;
21
22 ceph::os::CyanStore* store;
23 Ref<ceph::os::Collection> coll;
24
25 public:
26 OSDMeta(Ref<ceph::os::Collection> coll,
27 ceph::os::CyanStore* store)
28 : store{store}, coll{coll}
29 {}
30
31
32 auto collection() {
33 return coll;
34 }
35 void create(ceph::os::Transaction& t);
36
37 void store_map(ceph::os::Transaction& t,
38 epoch_t e, const bufferlist& m);
39 seastar::future<bufferlist> load_map(epoch_t e);
40
41 void store_superblock(ceph::os::Transaction& t,
42 const OSDSuperblock& sb);
43 seastar::future<OSDSuperblock> load_superblock();
44
45 using ec_profile_t = std::map<std::string, std::string>;
46 seastar::future<pg_pool_t,
47 std::string,
48 ec_profile_t> load_final_pool_info(int64_t pool);
49 private:
50 static ghobject_t osdmap_oid(epoch_t epoch);
51 static ghobject_t final_pool_info_oid(int64_t pool);
52 static ghobject_t superblock_oid();
53 };