]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/io/ObjectDispatchInterface.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_LIBRBD_IO_OBJECT_DISPATCH_INTERFACE_H
5 #define CEPH_LIBRBD_IO_OBJECT_DISPATCH_INTERFACE_H
7 #include "include/int_types.h"
8 #include "include/buffer.h"
9 #include "include/rados/librados.hpp"
10 #include "common/snap_types.h"
11 #include "common/zipkin_trace.h"
12 #include "librbd/io/Types.h"
22 struct ObjectDispatchInterface
{
23 virtual ~ObjectDispatchInterface() {
26 virtual ObjectDispatchLayer
get_object_dispatch_layer() const = 0;
28 virtual void shut_down(Context
* on_finish
) = 0;
31 const std::string
&oid
, uint64_t object_no
, uint64_t object_off
,
32 uint64_t object_len
, librados::snap_t snap_id
, int op_flags
,
33 const ZTracer::Trace
&parent_trace
, ceph::bufferlist
* read_data
,
34 ExtentMap
* extent_map
, int* object_dispatch_flags
,
35 DispatchResult
* dispatch_result
, Context
** on_finish
,
36 Context
* on_dispatched
) = 0;
39 const std::string
&oid
, uint64_t object_no
, uint64_t object_off
,
40 uint64_t object_len
, const ::SnapContext
&snapc
, int discard_flags
,
41 const ZTracer::Trace
&parent_trace
, int* object_dispatch_flags
,
42 uint64_t* journal_tid
, DispatchResult
* dispatch_result
,
43 Context
**on_finish
, Context
* on_dispatched
) = 0;
46 const std::string
&oid
, uint64_t object_no
, uint64_t object_off
,
47 ceph::bufferlist
&& data
, const ::SnapContext
&snapc
, int op_flags
,
48 const ZTracer::Trace
&parent_trace
, int* object_dispatch_flags
,
49 uint64_t* journal_tid
, DispatchResult
* dispatch_result
,
50 Context
**on_finish
, Context
* on_dispatched
) = 0;
52 virtual bool write_same(
53 const std::string
&oid
, uint64_t object_no
, uint64_t object_off
,
54 uint64_t object_len
, Extents
&& buffer_extents
, ceph::bufferlist
&& data
,
55 const ::SnapContext
&snapc
, int op_flags
,
56 const ZTracer::Trace
&parent_trace
, int* object_dispatch_flags
,
57 uint64_t* journal_tid
, DispatchResult
* dispatch_result
,
58 Context
**on_finish
, Context
* on_dispatched
) = 0;
60 virtual bool compare_and_write(
61 const std::string
&oid
, uint64_t object_no
, uint64_t object_off
,
62 ceph::bufferlist
&& cmp_data
, ceph::bufferlist
&& write_data
,
63 const ::SnapContext
&snapc
, int op_flags
,
64 const ZTracer::Trace
&parent_trace
, uint64_t* mismatch_offset
,
65 int* object_dispatch_flags
, uint64_t* journal_tid
,
66 DispatchResult
* dispatch_result
, Context
** on_finish
,
67 Context
* on_dispatched
) = 0;
70 FlushSource flush_source
, const ZTracer::Trace
&parent_trace
,
71 DispatchResult
* dispatch_result
, Context
** on_finish
,
72 Context
* on_dispatched
) = 0;
74 virtual bool invalidate_cache(Context
* on_finish
) = 0;
75 virtual bool reset_existence_cache(Context
* on_finish
) = 0;
77 virtual void extent_overwritten(
78 uint64_t object_no
, uint64_t object_off
, uint64_t object_len
,
79 uint64_t journal_tid
, uint64_t new_journal_tid
) = 0;
86 #endif // CEPH_LIBRBD_IO_OBJECT_DISPATCH_INTERFACE_H