]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/os/cyan_object.h
update download target update for octopus release
[ceph.git] / ceph / src / crimson / os / cyan_object.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 #include <cstddef>
4 #include <map>
5 #include <string>
6 #include <boost/intrusive_ptr.hpp>
7 #include <boost/smart_ptr/intrusive_ref_counter.hpp>
8 #include "include/buffer.h"
9
10 namespace ceph::os {
11
12 struct Object : public boost::intrusive_ref_counter<
13 Object,
14 boost::thread_unsafe_counter>
15 {
16 using bufferlist = ceph::bufferlist;
17
18 bufferlist data;
19 std::map<std::string,bufferptr> xattr;
20 bufferlist omap_header;
21 std::map<std::string,bufferlist> omap;
22
23 typedef boost::intrusive_ptr<Object> Ref;
24
25 Object() = default;
26
27 // interface for object data
28 size_t get_size() const;
29 int read(uint64_t offset, uint64_t len, bufferlist &bl);
30 int write(uint64_t offset, const bufferlist &bl);
31 int clone(Object *src, uint64_t srcoff, uint64_t len,
32 uint64_t dstoff);
33 int truncate(uint64_t offset);
34
35 void encode(bufferlist& bl) const;
36 void decode(bufferlist::const_iterator& p);
37 };
38 }