]>
git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/os/cyanstore/cyan_object.h
624f9513a930e8afd43f9b71cc3b41d99bbd2cdf
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
8 #include <boost/intrusive_ptr.hpp>
9 #include <boost/smart_ptr/intrusive_ref_counter.hpp>
11 #include "include/buffer.h"
13 namespace crimson::os
{
15 struct Object
: public boost::intrusive_ref_counter
<
17 boost::thread_unsafe_counter
>
19 using bufferlist
= ceph::bufferlist
;
22 // use transparent comparator for better performance, see
23 // https://en.cppreference.com/w/cpp/utility/functional/less_void
24 std::map
<std::string
,bufferlist
,std::less
<>> xattr
;
25 bufferlist omap_header
;
26 std::map
<std::string
,bufferlist
> omap
;
28 typedef boost::intrusive_ptr
<Object
> Ref
;
32 // interface for object data
33 size_t get_size() const;
34 ceph::bufferlist
read(uint64_t offset
, uint64_t len
);
35 int write(uint64_t offset
, const bufferlist
&bl
);
36 int clone(Object
*src
, uint64_t srcoff
, uint64_t len
,
38 int truncate(uint64_t offset
);
40 void encode(bufferlist
& bl
) const;
41 void decode(bufferlist::const_iterator
& p
);
43 using ObjectRef
= boost::intrusive_ptr
<Object
>;