]>
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 uint64_t object_no
, uint64_t object_off
, uint64_t object_len
,
32 librados::snap_t snap_id
, int op_flags
,const ZTracer::Trace
&parent_trace
,
33 ceph::bufferlist
* read_data
, ExtentMap
* extent_map
,
34 int* object_dispatch_flags
, DispatchResult
* dispatch_result
,
35 Context
** on_finish
, Context
* on_dispatched
) = 0;
38 uint64_t object_no
, uint64_t object_off
, uint64_t object_len
,
39 const ::SnapContext
&snapc
, int discard_flags
,
40 const ZTracer::Trace
&parent_trace
, int* object_dispatch_flags
,
41 uint64_t* journal_tid
, DispatchResult
* dispatch_result
,
42 Context
**on_finish
, Context
* on_dispatched
) = 0;
45 uint64_t object_no
, uint64_t object_off
, ceph::bufferlist
&& data
,
46 const ::SnapContext
&snapc
, int op_flags
,
47 const ZTracer::Trace
&parent_trace
, int* object_dispatch_flags
,
48 uint64_t* journal_tid
, DispatchResult
* dispatch_result
,
49 Context
**on_finish
, Context
* on_dispatched
) = 0;
51 virtual bool write_same(
52 uint64_t object_no
, uint64_t object_off
, uint64_t object_len
,
53 LightweightBufferExtents
&& buffer_extents
, ceph::bufferlist
&& data
,
54 const ::SnapContext
&snapc
, int op_flags
,
55 const ZTracer::Trace
&parent_trace
, int* object_dispatch_flags
,
56 uint64_t* journal_tid
, DispatchResult
* dispatch_result
,
57 Context
**on_finish
, Context
* on_dispatched
) = 0;
59 virtual bool compare_and_write(
60 uint64_t object_no
, uint64_t object_off
, ceph::bufferlist
&& cmp_data
,
61 ceph::bufferlist
&& write_data
, const ::SnapContext
&snapc
, int op_flags
,
62 const ZTracer::Trace
&parent_trace
, uint64_t* mismatch_offset
,
63 int* object_dispatch_flags
, uint64_t* journal_tid
,
64 DispatchResult
* dispatch_result
, Context
** on_finish
,
65 Context
* on_dispatched
) = 0;
68 FlushSource flush_source
, const ZTracer::Trace
&parent_trace
,
69 uint64_t* journal_tid
, DispatchResult
* dispatch_result
,
70 Context
** on_finish
, Context
* on_dispatched
) = 0;
72 virtual bool invalidate_cache(Context
* on_finish
) = 0;
73 virtual bool reset_existence_cache(Context
* on_finish
) = 0;
75 virtual void extent_overwritten(
76 uint64_t object_no
, uint64_t object_off
, uint64_t object_len
,
77 uint64_t journal_tid
, uint64_t new_journal_tid
) = 0;
84 #endif // CEPH_LIBRBD_IO_OBJECT_DISPATCH_INTERFACE_H