]>
git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/tools/store_nbd/tm_driver.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #include "block_driver.h"
6 #include "crimson/os/seastore/cache.h"
7 #include "crimson/os/seastore/device.h"
8 #include "crimson/os/seastore/transaction_manager.h"
9 #include "test/crimson/seastore/test_block.h"
11 class TMDriver final
: public BlockDriver
{
13 TMDriver(config_t config
) : config(config
) {}
16 bufferptr
get_buffer(size_t size
) final
{
17 return ceph::buffer::create_page_aligned(size
);
20 seastar::future
<> write(
24 seastar::future
<bufferlist
> read(
28 size_t get_size() const final
;
30 seastar::future
<> mount() final
;
32 seastar::future
<> close() final
;
35 const config_t config
;
37 using DeviceRef
= crimson::os::seastore::DeviceRef
;
40 using TransactionManager
= crimson::os::seastore::TransactionManager
;
41 using TransactionManagerRef
= crimson::os::seastore::TransactionManagerRef
;
42 TransactionManagerRef tm
;
44 seastar::future
<> mkfs();
48 using read_extents_iertr
= TransactionManager::read_extent_iertr
;
49 using read_extents_ret
= read_extents_iertr::future
<
50 crimson::os::seastore::lextent_list_t
<crimson::os::seastore::TestBlock
>
52 read_extents_ret
read_extents(
53 crimson::os::seastore::Transaction
&t
,
54 crimson::os::seastore::laddr_t offset
,
55 crimson::os::seastore::extent_len_t length
);