]> git.proxmox.com Git - ceph.git/blame - ceph/src/librbd/io/ObjectDispatchInterface.h
Import ceph 15.2.8
[ceph.git] / ceph / src / librbd / io / ObjectDispatchInterface.h
CommitLineData
11fdf7f2
TL
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3
4#ifndef CEPH_LIBRBD_IO_OBJECT_DISPATCH_INTERFACE_H
5#define CEPH_LIBRBD_IO_OBJECT_DISPATCH_INTERFACE_H
6
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"
13
14struct Context;
15struct RWLock;
16
17namespace librbd {
18namespace io {
19
20struct AioCompletion;
21
22struct ObjectDispatchInterface {
23 virtual ~ObjectDispatchInterface() {
24 }
25
26 virtual ObjectDispatchLayer get_object_dispatch_layer() const = 0;
27
28 virtual void shut_down(Context* on_finish) = 0;
29
30 virtual bool read(
9f95a23c
TL
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;
11fdf7f2
TL
36
37 virtual bool discard(
9f95a23c
TL
38 uint64_t object_no, uint64_t object_off, uint64_t object_len,
39 const ::SnapContext &snapc, int discard_flags,
11fdf7f2
TL
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;
43
44 virtual bool write(
9f95a23c
TL
45 uint64_t object_no, uint64_t object_off, ceph::bufferlist&& data,
46 const ::SnapContext &snapc, int op_flags,
11fdf7f2
TL
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;
50
51 virtual bool write_same(
9f95a23c
TL
52 uint64_t object_no, uint64_t object_off, uint64_t object_len,
53 LightweightBufferExtents&& buffer_extents, ceph::bufferlist&& data,
11fdf7f2
TL
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;
58
59 virtual bool compare_and_write(
9f95a23c
TL
60 uint64_t object_no, uint64_t object_off, ceph::bufferlist&& cmp_data,
61 ceph::bufferlist&& write_data, const ::SnapContext &snapc, int op_flags,
11fdf7f2
TL
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;
66
67 virtual bool flush(
68 FlushSource flush_source, const ZTracer::Trace &parent_trace,
9f95a23c
TL
69 uint64_t* journal_tid, DispatchResult* dispatch_result,
70 Context** on_finish, Context* on_dispatched) = 0;
11fdf7f2
TL
71
72 virtual bool invalidate_cache(Context* on_finish) = 0;
73 virtual bool reset_existence_cache(Context* on_finish) = 0;
74
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;
78
79};
80
81} // namespace io
82} // namespace librbd
83
84#endif // CEPH_LIBRBD_IO_OBJECT_DISPATCH_INTERFACE_H