forked from vitalif/vitastor
Compare commits
3 Commits
meson
...
meson-spli
| Author | SHA1 | Date | |
|---|---|---|---|
| b15379810b | |||
| 2300264b44 | |||
| 37600ebfc2 |
90
meson.build
Normal file
90
meson.build
Normal file
@@ -0,0 +1,90 @@
|
||||
project(
|
||||
'vitastor',
|
||||
['cpp', 'c'],
|
||||
version : '3.0.0',
|
||||
license: 'VNPL-1.1',
|
||||
default_options : [
|
||||
'buildtype=debugoptimized',
|
||||
'cpp_std=c++17',
|
||||
'b_pie=true',
|
||||
'warning_level=1',
|
||||
],
|
||||
)
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
cxx = meson.get_compiler('cpp')
|
||||
pkgconf = import('pkgconfig')
|
||||
|
||||
with_qemu = get_option('with_qemu')
|
||||
with_fio = get_option('with_fio')
|
||||
with_system_liburing = get_option('with_system_liburing')
|
||||
with_asan = get_option('with_asan')
|
||||
enable_coverage = get_option('enable_coverage')
|
||||
|
||||
common_defs = [
|
||||
'-D_GNU_SOURCE',
|
||||
'-D_LARGEFILE64_SOURCE',
|
||||
'-D_FILE_OFFSET_BITS=64',
|
||||
'-DVITASTOR_VERSION="@0@"'.format(meson.project_version()),
|
||||
]
|
||||
|
||||
common_warn = [
|
||||
'-Wall',
|
||||
'-Wno-sign-compare',
|
||||
'-Wno-comment',
|
||||
'-Wno-parentheses',
|
||||
'-Wno-pointer-arith',
|
||||
'-fdiagnostics-color=always',
|
||||
'-fno-omit-frame-pointer',
|
||||
'-fvisibility=hidden',
|
||||
]
|
||||
|
||||
common_c_args = common_defs + common_warn
|
||||
common_cpp_args = common_defs + common_warn + ['-fvisibility-inlines-hidden']
|
||||
|
||||
if with_asan
|
||||
common_c_args += ['-fsanitize=address']
|
||||
common_cpp_args += ['-fsanitize=address']
|
||||
add_project_link_arguments(['-fsanitize=address', '-fno-omit-frame-pointer'], language : ['c', 'cpp'])
|
||||
else
|
||||
add_project_link_arguments('-fno-omit-frame-pointer', language : ['c', 'cpp'])
|
||||
endif
|
||||
|
||||
if enable_coverage
|
||||
common_c_args += ['-coverage']
|
||||
common_cpp_args += ['-coverage']
|
||||
add_project_link_arguments('-coverage', language : ['c', 'cpp'])
|
||||
endif
|
||||
|
||||
add_project_arguments(common_c_args, language : 'c')
|
||||
add_project_arguments(common_cpp_args, language : 'cpp')
|
||||
|
||||
dep_threads = dependency('threads')
|
||||
dep_ibverbs = dependency('libibverbs', required : false)
|
||||
if dep_ibverbs.found()
|
||||
add_project_arguments('-DWITH_RDMA', language : ['c', 'cpp'])
|
||||
endif
|
||||
|
||||
dep_isal = dependency('libisal', required : false)
|
||||
if dep_isal.found()
|
||||
add_project_arguments('-DWITH_ISAL', language : ['c', 'cpp'])
|
||||
endif
|
||||
|
||||
dep_rdmacm = dependency('librdmacm', required : false)
|
||||
if dep_rdmacm.found()
|
||||
add_project_arguments('-DWITH_RDMACM', language : ['c', 'cpp'])
|
||||
endif
|
||||
|
||||
dep_nl3 = dependency(['libnl-3.0', 'libnl-genl-3.0'], required : false)
|
||||
dep_glib = dependency('glib-2.0', required : with_qemu)
|
||||
dep_tcmalloc = cc.find_library('tcmalloc_minimal', required : true)
|
||||
|
||||
dep_jerasure = dependency('jerasure', required : false)
|
||||
if not dep_jerasure.found()
|
||||
dep_jerasure = cc.find_library('Jerasure', required : true)
|
||||
endif
|
||||
|
||||
have_nbd_netlink = cc.has_header('linux/nbd-netlink.h')
|
||||
|
||||
subdir('src')
|
||||
|
||||
7
meson_options.txt
Normal file
7
meson_options.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
option('with_qemu', type : 'boolean', value : false, description : 'Build QEMU driver inside Vitastor source tree')
|
||||
option('with_fio', type : 'boolean', value : true, description : 'Build FIO drivers')
|
||||
option('qemu_plugindir', type : 'string', value : 'qemu', description : 'QEMU plugin directory suffix (qemu-kvm on RHEL)')
|
||||
option('with_asan', type : 'boolean', value : false, description : 'Build with AddressSanitizer')
|
||||
option('with_system_liburing', type : 'boolean', value : false, description : 'Use system liburing instead of bundled copy')
|
||||
option('enable_coverage', type : 'boolean', value : false, description : 'Enable code coverage flags')
|
||||
|
||||
57
src/blockstore/meson.build
Normal file
57
src/blockstore/meson.build
Normal file
@@ -0,0 +1,57 @@
|
||||
vitastor_blk_lib = static_library(
|
||||
'vitastor_blk',
|
||||
[
|
||||
'../util/allocator.cpp',
|
||||
'../util/crc32c.c',
|
||||
'../util/ringloop.cpp',
|
||||
'multilist.cpp',
|
||||
'blockstore_heap.cpp',
|
||||
'blockstore_disk.cpp',
|
||||
'blockstore.cpp',
|
||||
'blockstore_impl.cpp',
|
||||
'blockstore_init.cpp',
|
||||
'blockstore_open.cpp',
|
||||
'blockstore_flush.cpp',
|
||||
'blockstore_read.cpp',
|
||||
'blockstore_stable.cpp',
|
||||
'blockstore_sync.cpp',
|
||||
'blockstore_write.cpp',
|
||||
'v1/flush.cpp',
|
||||
'v1/impl.cpp',
|
||||
'v1/init.cpp',
|
||||
'v1/journal.cpp',
|
||||
'v1/open.cpp',
|
||||
'v1/read.cpp',
|
||||
'v1/rollback.cpp',
|
||||
'v1/stable.cpp',
|
||||
'v1/sync.cpp',
|
||||
'v1/write.cpp',
|
||||
],
|
||||
include_directories : inc_common,
|
||||
dependencies : [
|
||||
vitastor_common_dep,
|
||||
liburing_dep,
|
||||
dep_isal,
|
||||
],
|
||||
pic : true,
|
||||
)
|
||||
|
||||
vitastor_blk_dep = declare_dependency(
|
||||
link_with : vitastor_blk_lib,
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_common_dep, liburing_dep, dep_isal],
|
||||
)
|
||||
|
||||
if with_fio
|
||||
fio_vitastor_blk = shared_library(
|
||||
'fio_vitastor_blk',
|
||||
[
|
||||
'fio_engine.cpp',
|
||||
json11_src,
|
||||
],
|
||||
include_directories : inc_common,
|
||||
link_with : vitastor_blk_lib,
|
||||
install : true,
|
||||
)
|
||||
endif
|
||||
|
||||
166
src/client/meson.build
Normal file
166
src/client/meson.build
Normal file
@@ -0,0 +1,166 @@
|
||||
vitastor_common_lib = static_library(
|
||||
'vitastor_common',
|
||||
[
|
||||
'../util/epoll_manager.cpp',
|
||||
'etcd_state_client.cpp',
|
||||
'messenger.cpp',
|
||||
'../util/addr_util.cpp',
|
||||
'msgr_stop.cpp',
|
||||
'msgr_op.cpp',
|
||||
'msgr_send.cpp',
|
||||
'msgr_receive.cpp',
|
||||
'../util/ringloop.cpp',
|
||||
json11_src,
|
||||
'http_client.cpp',
|
||||
'osd_ops.cpp',
|
||||
'pg_states.cpp',
|
||||
'../util/timerfd_manager.cpp',
|
||||
'../util/str_util.cpp',
|
||||
'../util/json_util.cpp',
|
||||
dep_ibverbs.found() ? 'msgr_rdma.cpp' : [],
|
||||
dep_rdmacm.found() ? 'msgr_rdmacm.cpp' : [],
|
||||
],
|
||||
include_directories : inc_common,
|
||||
dependencies : [dep_threads],
|
||||
pic : true,
|
||||
)
|
||||
|
||||
vitastor_common_dep = declare_dependency(
|
||||
link_with : vitastor_common_lib,
|
||||
include_directories : inc_common,
|
||||
dependencies : [dep_threads],
|
||||
)
|
||||
|
||||
vitastor_client_lib = shared_library(
|
||||
'vitastor_client',
|
||||
[
|
||||
'cluster_client.cpp',
|
||||
'cluster_client_list.cpp',
|
||||
'cluster_client_wb.cpp',
|
||||
'vitastor_c.cpp',
|
||||
],
|
||||
include_directories : inc_common,
|
||||
dependencies : [
|
||||
vitastor_common_dep,
|
||||
vitastor_cli_dep,
|
||||
liburing_dep,
|
||||
dep_ibverbs,
|
||||
dep_rdmacm,
|
||||
],
|
||||
soversion : '0',
|
||||
install : true,
|
||||
)
|
||||
|
||||
install_headers('client/vitastor_c.h')
|
||||
|
||||
pkgconf.generate(
|
||||
filebase : 'vitastor',
|
||||
name : 'Vitastor client library',
|
||||
description : 'Vitastor client library',
|
||||
libraries : vitastor_client_lib,
|
||||
subdirs : '',
|
||||
requires_private : [liburing_dep, dep_ibverbs, dep_rdmacm],
|
||||
)
|
||||
|
||||
vitastor_client_dep = declare_dependency(
|
||||
link_with : vitastor_client_lib,
|
||||
include_directories : inc_common,
|
||||
dependencies : [
|
||||
vitastor_common_dep,
|
||||
vitastor_cli_dep,
|
||||
liburing_dep,
|
||||
dep_ibverbs,
|
||||
dep_rdmacm,
|
||||
],
|
||||
)
|
||||
|
||||
vitastor_cli = executable(
|
||||
'vitastor-cli',
|
||||
['../cmd/cli.cpp'],
|
||||
include_directories : inc_common,
|
||||
link_with : vitastor_cli_lib,
|
||||
dependencies : [vitastor_client_dep],
|
||||
install : true,
|
||||
)
|
||||
|
||||
if with_fio
|
||||
fio_vitastor = shared_library(
|
||||
'fio_vitastor',
|
||||
['fio_cluster.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_client_dep],
|
||||
install : true,
|
||||
)
|
||||
|
||||
fio_vitastor_sec = shared_library(
|
||||
'fio_vitastor_sec',
|
||||
[
|
||||
'fio_sec_osd.cpp',
|
||||
'../util/rw_blocking.cpp',
|
||||
'../util/addr_util.cpp',
|
||||
],
|
||||
include_directories : inc_common,
|
||||
dependencies : [dep_tcmalloc],
|
||||
install : true,
|
||||
)
|
||||
endif
|
||||
|
||||
if dep_nl3.found()
|
||||
nbd_c_args = have_nbd_netlink ? ['-DHAVE_NBD_NETLINK_H'] : []
|
||||
vitastor_nbd = executable(
|
||||
'vitastor-nbd',
|
||||
['nbd_proxy.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_client_dep, dep_nl3],
|
||||
c_args : nbd_c_args,
|
||||
install : true,
|
||||
)
|
||||
endif
|
||||
|
||||
vitastor_ublk = executable(
|
||||
'vitastor-ublk',
|
||||
['ublk_server.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_client_dep],
|
||||
install : true,
|
||||
)
|
||||
|
||||
if with_qemu
|
||||
qemu_inc = include_directories('../qemu/b/qemu', '../qemu/include')
|
||||
qemu_vitastor = shared_module(
|
||||
'block-vitastor',
|
||||
['qemu_driver.c'],
|
||||
include_directories : [inc_common, qemu_inc],
|
||||
dependencies : [vitastor_client_dep, dep_glib],
|
||||
name_prefix : '',
|
||||
install : true,
|
||||
install_dir : join_paths('/usr', get_option('libdir'), get_option('qemu_plugindir')),
|
||||
)
|
||||
endif
|
||||
|
||||
test_cluster_client = executable(
|
||||
'test_cluster_client',
|
||||
[
|
||||
'../test/test_cluster_client.cpp',
|
||||
'pg_states.cpp',
|
||||
'osd_ops.cpp',
|
||||
'cluster_client.cpp',
|
||||
'cluster_client_list.cpp',
|
||||
'cluster_client_wb.cpp',
|
||||
'msgr_op.cpp',
|
||||
'../test/mock/messenger.cpp',
|
||||
'msgr_stop.cpp',
|
||||
'etcd_state_client.cpp',
|
||||
'../util/timerfd_manager.cpp',
|
||||
'../util/addr_util.cpp',
|
||||
'../util/str_util.cpp',
|
||||
'../util/json_util.cpp',
|
||||
json11_src,
|
||||
],
|
||||
include_directories : [inc_common, include_directories('../test/mock')],
|
||||
dependencies : [dep_threads],
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
test('test_cluster_client', test_cluster_client)
|
||||
|
||||
@@ -67,6 +67,20 @@ msgr_rdma_context_t::~msgr_rdma_context_t()
|
||||
ibv_close_device(context);
|
||||
}
|
||||
|
||||
msgr_rdma_buf_t::~msgr_rdma_buf_t()
|
||||
{
|
||||
if (buf)
|
||||
{
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
if (mr)
|
||||
{
|
||||
ibv_dereg_mr(mr);
|
||||
mr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
msgr_rdma_connection_t::~msgr_rdma_connection_t()
|
||||
{
|
||||
ctx->reserve_cqe(-max_send-max_recv);
|
||||
@@ -84,26 +98,6 @@ msgr_rdma_connection_t::~msgr_rdma_connection_t()
|
||||
if (qp)
|
||||
ibv_destroy_qp(qp);
|
||||
#endif
|
||||
if (recv_buffers.size())
|
||||
{
|
||||
for (auto b: recv_buffers)
|
||||
{
|
||||
if (b.mr)
|
||||
ibv_dereg_mr(b.mr);
|
||||
free(b.buf);
|
||||
}
|
||||
recv_buffers.clear();
|
||||
}
|
||||
if (send_out.mr)
|
||||
{
|
||||
ibv_dereg_mr(send_out.mr);
|
||||
send_out.mr = NULL;
|
||||
}
|
||||
if (send_out.buf)
|
||||
{
|
||||
free(send_out.buf);
|
||||
send_out.buf = NULL;
|
||||
}
|
||||
send_out_size = 0;
|
||||
}
|
||||
|
||||
@@ -493,7 +487,7 @@ int msgr_rdma_connection_t::connect(msgr_rdma_address_t *dest)
|
||||
.grh = {
|
||||
.dgid = dest->gid,
|
||||
.sgid_index = conn->ctx->gid_index,
|
||||
.hop_limit = 1, // FIXME can it vary?
|
||||
.hop_limit = 64, // FIXME can it vary?
|
||||
},
|
||||
.dlid = dest->lid,
|
||||
.sl = 0, // service level
|
||||
@@ -663,7 +657,7 @@ void osd_messenger_t::try_send_rdma_nodp(osd_client_t *cl)
|
||||
{
|
||||
// Allocate send ring buffer, if not yet
|
||||
rc->send_out_size = rc->max_msg*rdma_max_send;
|
||||
rc->send_out.buf = malloc_or_die(rc->send_out_size);
|
||||
rc->send_out.buf = (uint8_t*)malloc_or_die(rc->send_out_size);
|
||||
if (!rc->ctx->odp)
|
||||
{
|
||||
rc->send_out.mr = ibv_reg_mr(rc->ctx->pd, rc->send_out.buf, rc->send_out_size, 0);
|
||||
@@ -712,12 +706,12 @@ void osd_messenger_t::try_send_rdma(osd_client_t *cl)
|
||||
try_send_rdma_nodp(cl);
|
||||
}
|
||||
|
||||
static void try_recv_rdma_wr(osd_client_t *cl, msgr_rdma_buf_t b)
|
||||
static void try_recv_rdma_wr(osd_client_t *cl, void *buf)
|
||||
{
|
||||
ibv_sge sge = {
|
||||
.addr = (uintptr_t)b.buf,
|
||||
.addr = (uintptr_t)buf,
|
||||
.length = (uint32_t)cl->rdma_conn->max_msg,
|
||||
.lkey = cl->rdma_conn->ctx->odp ? cl->rdma_conn->ctx->mr->lkey : b.mr->lkey,
|
||||
.lkey = cl->rdma_conn->ctx->odp ? cl->rdma_conn->ctx->mr->lkey : cl->rdma_conn->recv_buf.mr->lkey,
|
||||
};
|
||||
ibv_recv_wr *bad_wr = NULL;
|
||||
ibv_recv_wr wr = {
|
||||
@@ -737,19 +731,20 @@ static void try_recv_rdma_wr(osd_client_t *cl, msgr_rdma_buf_t b)
|
||||
bool osd_messenger_t::init_recv_rdma(osd_client_t *cl)
|
||||
{
|
||||
auto rc = cl->rdma_conn;
|
||||
while (rc->cur_recv < rc->max_recv)
|
||||
assert(!rc->recv_buf.buf);
|
||||
rc->recv_buf.buf = (uint8_t*)malloc_or_die(rc->max_msg * rc->max_recv);
|
||||
if (!rc->ctx->odp)
|
||||
{
|
||||
msgr_rdma_buf_t b;
|
||||
b.buf = malloc_or_die(rc->max_msg);
|
||||
if (!rc->ctx->odp)
|
||||
rc->recv_buf.mr = ibv_reg_mr(rc->ctx->pd, rc->recv_buf.buf, rc->max_msg * rc->max_recv, IBV_ACCESS_LOCAL_WRITE);
|
||||
if (!rc->recv_buf.mr)
|
||||
{
|
||||
b.mr = ibv_reg_mr(rc->ctx->pd, b.buf, rc->max_msg, IBV_ACCESS_LOCAL_WRITE);
|
||||
if (!b.mr)
|
||||
{
|
||||
fprintf(stderr, "Failed to register RDMA memory region: %s\n", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
fprintf(stderr, "Failed to register RDMA memory region: %s\n", strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
for (uint32_t i = 0; i < rc->max_recv; i++)
|
||||
{
|
||||
uint8_t *b = rc->recv_buf.buf + i*rc->max_recv;
|
||||
rc->recv_buffers.push_back(b);
|
||||
try_recv_rdma_wr(cl, b);
|
||||
}
|
||||
@@ -807,7 +802,7 @@ void osd_messenger_t::handle_rdma_events(msgr_rdma_context_t *rdma_context)
|
||||
cl->ping_time_remaining = 0;
|
||||
cl->idle_time_remaining = osd_idle_timeout;
|
||||
rc->cur_recv--;
|
||||
if (!handle_read_buffer(cl, rc->recv_buffers[rc->next_recv_buf].buf, wc[i].byte_len))
|
||||
if (!handle_read_buffer(cl, rc->recv_buffers[rc->next_recv_buf], wc[i].byte_len))
|
||||
{
|
||||
// handle_read_buffer may stop the client
|
||||
clear_immediate_ops(client_id);
|
||||
|
||||
@@ -54,8 +54,10 @@ struct msgr_rdma_context_t
|
||||
|
||||
struct msgr_rdma_buf_t
|
||||
{
|
||||
void *buf = NULL;
|
||||
uint8_t *buf = NULL;
|
||||
ibv_mr *mr = NULL;
|
||||
|
||||
~msgr_rdma_buf_t();
|
||||
};
|
||||
|
||||
struct msgr_rdma_connection_t
|
||||
@@ -72,7 +74,8 @@ struct msgr_rdma_connection_t
|
||||
int cur_send = 0, cur_recv = 0;
|
||||
int send_pos = 0, send_buf_pos = 0;
|
||||
int next_recv_buf = 0;
|
||||
std::vector<msgr_rdma_buf_t> recv_buffers;
|
||||
std::vector<void*> recv_buffers;
|
||||
msgr_rdma_buf_t recv_buf;
|
||||
std::vector<uint64_t> send_sizes;
|
||||
msgr_rdma_buf_t send_out;
|
||||
int send_out_pos = 0, send_done_pos = 0, send_out_size = 0;
|
||||
|
||||
36
src/cmd/meson.build
Normal file
36
src/cmd/meson.build
Normal file
@@ -0,0 +1,36 @@
|
||||
vitastor_cli_lib = static_library(
|
||||
'vitastor_cli',
|
||||
[
|
||||
'cli_common.cpp',
|
||||
'cli_alloc_osd.cpp',
|
||||
'cli_status.cpp',
|
||||
'cli_describe.cpp',
|
||||
'cli_fix.cpp',
|
||||
'cli_ls.cpp',
|
||||
'cli_create.cpp',
|
||||
'cli_dd.cpp',
|
||||
'cli_modify.cpp',
|
||||
'cli_modify_osd.cpp',
|
||||
'cli_osd_tree.cpp',
|
||||
'cli_pg_ls.cpp',
|
||||
'cli_flatten.cpp',
|
||||
'cli_merge.cpp',
|
||||
'cli_rm_data.cpp',
|
||||
'cli_rm_wildcard.cpp',
|
||||
'cli_rm.cpp',
|
||||
'cli_rm_osd.cpp',
|
||||
'cli_pool_cfg.cpp',
|
||||
'cli_pool_create.cpp',
|
||||
'cli_pool_ls.cpp',
|
||||
'cli_pool_modify.cpp',
|
||||
'cli_pool_rm.cpp',
|
||||
],
|
||||
include_directories : inc_common,
|
||||
pic : true,
|
||||
)
|
||||
|
||||
vitastor_cli_dep = declare_dependency(
|
||||
link_with : vitastor_cli_lib,
|
||||
include_directories : inc_common,
|
||||
)
|
||||
|
||||
34
src/disk_tool/meson.build
Normal file
34
src/disk_tool/meson.build
Normal file
@@ -0,0 +1,34 @@
|
||||
vitastor_disk = executable(
|
||||
'vitastor-disk',
|
||||
[
|
||||
'disk_tool.cpp',
|
||||
'disk_simple_offsets.cpp',
|
||||
'disk_tool_discard.cpp',
|
||||
'disk_tool_journal.cpp',
|
||||
'disk_tool_meta.cpp',
|
||||
'disk_tool_prepare.cpp',
|
||||
'disk_tool_resize.cpp',
|
||||
'disk_tool_resize_auto.cpp',
|
||||
'disk_tool_udev.cpp',
|
||||
'disk_tool_utils.cpp',
|
||||
'disk_tool_upgrade.cpp',
|
||||
'../util/crc32c.c',
|
||||
'../util/str_util.cpp',
|
||||
'../util/json_util.cpp',
|
||||
json11_src,
|
||||
'../util/rw_blocking.cpp',
|
||||
'../util/allocator.cpp',
|
||||
'../util/ringloop.cpp',
|
||||
'../blockstore/blockstore_disk.cpp',
|
||||
'../blockstore/blockstore_heap.cpp',
|
||||
'../blockstore/multilist.cpp',
|
||||
],
|
||||
include_directories : inc_common,
|
||||
dependencies : [
|
||||
dep_tcmalloc,
|
||||
liburing_dep,
|
||||
dep_isal,
|
||||
],
|
||||
install : true,
|
||||
)
|
||||
|
||||
33
src/kv/meson.build
Normal file
33
src/kv/meson.build
Normal file
@@ -0,0 +1,33 @@
|
||||
vitastor_kv_lib = shared_library(
|
||||
'vitastor_kv',
|
||||
['kv_db.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_client_dep],
|
||||
soversion : '0',
|
||||
install : true,
|
||||
)
|
||||
|
||||
install_headers('kv/vitastor_kv.h')
|
||||
|
||||
vitastor_kv_dep = declare_dependency(
|
||||
link_with : vitastor_kv_lib,
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_client_dep],
|
||||
)
|
||||
|
||||
vitastor_kv_bin = executable(
|
||||
'vitastor-kv',
|
||||
['kv_cli.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_kv_dep],
|
||||
install : true,
|
||||
)
|
||||
|
||||
vitastor_kv_stress = executable(
|
||||
'vitastor-kv-stress',
|
||||
['kv_stress.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_kv_dep],
|
||||
install : true,
|
||||
)
|
||||
|
||||
19
src/liburing/meson.build
Normal file
19
src/liburing/meson.build
Normal file
@@ -0,0 +1,19 @@
|
||||
liburing_lib = static_library(
|
||||
'uring',
|
||||
[
|
||||
'queue.c',
|
||||
'register.c',
|
||||
'setup.c',
|
||||
'syscall.c',
|
||||
'version.c',
|
||||
],
|
||||
include_directories : include_directories('include'),
|
||||
c_args : ['-fPIC'],
|
||||
pic : true,
|
||||
)
|
||||
|
||||
liburing_dep = declare_dependency(
|
||||
link_with : liburing_lib,
|
||||
include_directories : include_directories('include'),
|
||||
)
|
||||
|
||||
55
src/meson.build
Normal file
55
src/meson.build
Normal file
@@ -0,0 +1,55 @@
|
||||
with_qemu = get_option('with_qemu')
|
||||
with_fio = get_option('with_fio')
|
||||
with_system_liburing = get_option('with_system_liburing')
|
||||
enable_coverage = get_option('enable_coverage')
|
||||
|
||||
inc_common = include_directories(
|
||||
'..',
|
||||
'.',
|
||||
'blockstore',
|
||||
'cmd',
|
||||
'client',
|
||||
'disk_tool',
|
||||
'kv',
|
||||
'nfs',
|
||||
'osd',
|
||||
'test',
|
||||
'util',
|
||||
)
|
||||
inc_jerasure = include_directories('/usr/include/jerasure')
|
||||
|
||||
json11_src = files('../json11/json11.cpp')
|
||||
|
||||
if with_system_liburing
|
||||
liburing_dep = dependency('liburing', version : '>=2.10', required : true)
|
||||
else
|
||||
subdir('liburing')
|
||||
endif
|
||||
|
||||
subdir('cmd')
|
||||
subdir('client')
|
||||
subdir('blockstore')
|
||||
subdir('disk_tool')
|
||||
subdir('kv')
|
||||
subdir('nfs')
|
||||
subdir('osd')
|
||||
subdir('test')
|
||||
|
||||
meson.add_install_symlink(
|
||||
'vitastor-dump-journal',
|
||||
pointing_to : 'vitastor-disk',
|
||||
install_dir : get_option('bindir'),
|
||||
)
|
||||
|
||||
meson.add_install_symlink(
|
||||
'vitastor-rm',
|
||||
pointing_to : 'vitastor-cli',
|
||||
install_dir : get_option('bindir'),
|
||||
)
|
||||
|
||||
meson.add_install_symlink(
|
||||
'vita',
|
||||
pointing_to : 'vitastor-cli',
|
||||
install_dir : get_option('bindir'),
|
||||
)
|
||||
|
||||
34
src/nfs/meson.build
Normal file
34
src/nfs/meson.build
Normal file
@@ -0,0 +1,34 @@
|
||||
vitastor_nfs = executable(
|
||||
'vitastor-nfs',
|
||||
[
|
||||
'nfs_proxy.cpp',
|
||||
'nfs_proxy_rdma.cpp',
|
||||
'nfs_block.cpp',
|
||||
'nfs_kv.cpp',
|
||||
'nfs_kv_create.cpp',
|
||||
'nfs_kv_defrag.cpp',
|
||||
'nfs_kv_getattr.cpp',
|
||||
'nfs_kv_link.cpp',
|
||||
'nfs_kv_lookup.cpp',
|
||||
'nfs_kv_read.cpp',
|
||||
'nfs_kv_readdir.cpp',
|
||||
'nfs_kv_remove.cpp',
|
||||
'nfs_kv_rename.cpp',
|
||||
'nfs_kv_setattr.cpp',
|
||||
'nfs_kv_write.cpp',
|
||||
'nfs_fsstat.cpp',
|
||||
'nfs_mount.cpp',
|
||||
'nfs_portmap.cpp',
|
||||
'rdma_alloc.cpp',
|
||||
'../util/sha256.c',
|
||||
'proto/xdr_impl.cpp',
|
||||
'proto/rpc_rdma_xdr.cpp',
|
||||
'proto/rpc_xdr.cpp',
|
||||
'proto/portmap_xdr.cpp',
|
||||
'proto/nfs_xdr.cpp',
|
||||
],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_client_dep, vitastor_kv_dep, dep_rdmacm],
|
||||
install : true,
|
||||
)
|
||||
|
||||
63
src/osd/meson.build
Normal file
63
src/osd/meson.build
Normal file
@@ -0,0 +1,63 @@
|
||||
vitastor_osd = executable(
|
||||
'vitastor-osd',
|
||||
[
|
||||
'osd_main.cpp',
|
||||
'osd.cpp',
|
||||
'osd_secondary.cpp',
|
||||
'osd_peering.cpp',
|
||||
'osd_flush.cpp',
|
||||
'osd_peering_pg.cpp',
|
||||
'osd_primary.cpp',
|
||||
'osd_primary_chain.cpp',
|
||||
'osd_primary_sync.cpp',
|
||||
'osd_primary_write.cpp',
|
||||
'osd_primary_subops.cpp',
|
||||
'osd_cluster.cpp',
|
||||
'osd_rmw.cpp',
|
||||
'osd_scrub.cpp',
|
||||
'osd_primary_describe.cpp',
|
||||
],
|
||||
include_directories : [inc_common, inc_jerasure],
|
||||
dependencies : [
|
||||
vitastor_common_dep,
|
||||
vitastor_blk_dep,
|
||||
dep_jerasure,
|
||||
dep_isal,
|
||||
dep_ibverbs,
|
||||
dep_rdmacm,
|
||||
],
|
||||
install : true,
|
||||
)
|
||||
|
||||
osd_rmw_test = executable(
|
||||
'osd_rmw_test',
|
||||
['osd_rmw_test.cpp', '../util/allocator.cpp'],
|
||||
include_directories : [inc_common, inc_jerasure],
|
||||
dependencies : [dep_jerasure, dep_isal, dep_tcmalloc],
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
test('osd_rmw_test', osd_rmw_test)
|
||||
|
||||
if dep_isal.found()
|
||||
osd_rmw_test_je = executable(
|
||||
'osd_rmw_test_je',
|
||||
['osd_rmw_test.cpp', '../util/allocator.cpp'],
|
||||
include_directories : [inc_common, inc_jerasure],
|
||||
dependencies : [dep_jerasure, dep_tcmalloc],
|
||||
cpp_args : ['-DNO_ISAL'],
|
||||
build_by_default : false,
|
||||
)
|
||||
test('osd_rmw_test_jerasure', osd_rmw_test_je)
|
||||
endif
|
||||
|
||||
osd_peering_pg_test = executable(
|
||||
'osd_peering_pg_test',
|
||||
['osd_peering_pg_test.cpp', 'osd_peering_pg.cpp'],
|
||||
include_directories : [inc_common, inc_jerasure],
|
||||
dependencies : [dep_tcmalloc],
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
test('osd_peering_pg_test', osd_peering_pg_test)
|
||||
|
||||
97
src/test/meson.build
Normal file
97
src/test/meson.build
Normal file
@@ -0,0 +1,97 @@
|
||||
stub_osd = executable(
|
||||
'stub_osd',
|
||||
['stub_osd.cpp', '../util/rw_blocking.cpp', '../util/addr_util.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [dep_tcmalloc],
|
||||
)
|
||||
|
||||
stub_bench = executable(
|
||||
'stub_bench',
|
||||
['stub_bench.cpp', '../util/rw_blocking.cpp', '../util/addr_util.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [dep_tcmalloc],
|
||||
)
|
||||
|
||||
osd_test = executable(
|
||||
'osd_test',
|
||||
['osd_test.cpp', '../util/rw_blocking.cpp', '../util/addr_util.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [dep_tcmalloc],
|
||||
)
|
||||
|
||||
bindiff = executable('bindiff', ['bindiff.c'], include_directories : inc_common)
|
||||
|
||||
stub_uring_osd = executable(
|
||||
'stub_uring_osd',
|
||||
['stub_uring_osd.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [
|
||||
vitastor_common_dep,
|
||||
liburing_dep,
|
||||
dep_ibverbs,
|
||||
dep_rdmacm,
|
||||
dep_tcmalloc,
|
||||
],
|
||||
)
|
||||
|
||||
test_allocator = executable(
|
||||
'test_allocator',
|
||||
['test_allocator.cpp', '../util/allocator.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [dep_tcmalloc],
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
test('test_allocator', test_allocator)
|
||||
|
||||
test_heap = executable(
|
||||
'test_heap',
|
||||
[
|
||||
'test_heap.cpp',
|
||||
'../blockstore/multilist.cpp',
|
||||
'../blockstore/blockstore_heap.cpp',
|
||||
'../util/crc32c.c',
|
||||
'../util/allocator.cpp',
|
||||
'../blockstore/blockstore_disk.cpp',
|
||||
'../util/str_util.cpp',
|
||||
],
|
||||
include_directories : inc_common,
|
||||
dependencies : [dep_isal],
|
||||
build_by_default : false,
|
||||
c_args : enable_coverage ? ['-coverage'] : [],
|
||||
link_args : enable_coverage ? ['-coverage'] : [],
|
||||
)
|
||||
|
||||
test('test_heap', test_heap)
|
||||
|
||||
test_cas = executable(
|
||||
'test_cas',
|
||||
['test_cas.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_client_dep],
|
||||
)
|
||||
|
||||
test_crc32 = executable(
|
||||
'test_crc32',
|
||||
['test_crc32.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_blk_dep, dep_isal],
|
||||
)
|
||||
|
||||
test_blockstore = executable(
|
||||
'test_blockstore',
|
||||
['test_blockstore.cpp', 'ringloop_mock.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [vitastor_blk_dep, vitastor_common_dep, dep_isal],
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
test('test_blockstore', test_blockstore)
|
||||
|
||||
test_atomic = executable(
|
||||
'test_atomic',
|
||||
['test_atomic.cpp', '../util/ringloop.cpp'],
|
||||
include_directories : inc_common,
|
||||
dependencies : [liburing_dep],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user