]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/cache/ImageWriteback.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_CACHE_IMAGE_WRITEBACK
5 #define CEPH_LIBRBD_CACHE_IMAGE_WRITEBACK
7 #include "include/buffer_fwd.h"
8 #include "include/int_types.h"
20 * client-side, image extent cache writeback handler
22 template <typename ImageCtxT
= librbd::ImageCtx
>
23 class ImageWriteback
{
25 typedef std::vector
<std::pair
<uint64_t,uint64_t> > Extents
;
27 ImageWriteback(ImageCtxT
&image_ctx
);
29 void aio_read(Extents
&&image_extents
, ceph::bufferlist
*bl
,
30 int fadvise_flags
, Context
*on_finish
);
31 void aio_write(Extents
&&image_extents
, ceph::bufferlist
&& bl
,
32 int fadvise_flags
, Context
*on_finish
);
33 void aio_discard(uint64_t offset
, uint64_t length
,
34 bool skip_partial_discard
, Context
*on_finish
);
35 void aio_flush(Context
*on_finish
);
36 void aio_writesame(uint64_t offset
, uint64_t length
,
37 ceph::bufferlist
&& bl
,
38 int fadvise_flags
, Context
*on_finish
);
39 void aio_compare_and_write(Extents
&&image_extents
,
40 ceph::bufferlist
&& cmp_bl
,
41 ceph::bufferlist
&& bl
,
42 uint64_t *mismatch_offset
,
43 int fadvise_flags
, Context
*on_finish
);
45 ImageCtxT
&m_image_ctx
;
52 extern template class librbd::cache::ImageWriteback
<librbd::ImageCtx
>;
54 #endif // CEPH_LIBRBD_CACHE_IMAGE_WRITEBACK