Make it build with GCC 10, fio 3.20+ (atomics...) and QEMU 5.1

Vitaliy Filippov 2020-10-06 02:35:11 +03:00
padre 94efb54feb
commit 3d05aa9362
Se han modificado 15 ficheros con 41 adiciones y 25 borrados

Ver fichero

@ -99,11 +99,11 @@ epoll_manager.o: epoll_manager.cpp epoll_manager.h ringloop.h timerfd_manager.h
g++ $(CXXFLAGS) -c -o $@ $<
etcd_state_client.o: etcd_state_client.cpp base64.h etcd_state_client.h http_client.h json11/json11.hpp object_id.h osd_id.h osd_ops.h pg_states.h timerfd_manager.h
g++ $(CXXFLAGS) -c -o $@ $<
fio_cluster.o: fio_cluster.cpp cluster_client.h epoll_manager.h etcd_state_client.h fio/fio.h fio/optgroup.h http_client.h json11/json11.hpp malloc_or_die.h messenger.h object_id.h osd_id.h osd_ops.h ringloop.h timerfd_manager.h
fio_cluster.o: fio_cluster.cpp cluster_client.h epoll_manager.h etcd_state_client.h fio/arch/arch.h fio/fio.h fio/optgroup.h fio_headers.h http_client.h json11/json11.hpp malloc_or_die.h messenger.h object_id.h osd_id.h osd_ops.h ringloop.h timerfd_manager.h
g++ $(CXXFLAGS) -c -o $@ $<
fio_engine.o: fio_engine.cpp blockstore.h fio/fio.h fio/optgroup.h json11/json11.hpp object_id.h ringloop.h
fio_engine.o: fio_engine.cpp blockstore.h fio/arch/arch.h fio/fio.h fio/optgroup.h fio_headers.h json11/json11.hpp object_id.h ringloop.h
g++ $(CXXFLAGS) -c -o $@ $<
fio_sec_osd.o: fio_sec_osd.cpp fio/fio.h fio/optgroup.h object_id.h osd_id.h osd_ops.h rw_blocking.h
fio_sec_osd.o: fio_sec_osd.cpp fio/arch/arch.h fio/fio.h fio/optgroup.h fio_headers.h object_id.h osd_id.h osd_ops.h rw_blocking.h
g++ $(CXXFLAGS) -c -o $@ $<
http_client.o: http_client.cpp http_client.h json11/json11.hpp timerfd_manager.h
g++ $(CXXFLAGS) -c -o $@ $<

Ver fichero

@ -9,6 +9,7 @@
#include <stdint.h>
#include <string>
#include <map>
#include <unordered_map>
#include <functional>

Ver fichero

@ -1,6 +1,7 @@
// Copyright (c) Vitaliy Filippov, 2019+
// License: VNPL-1.0 or GNU GPL-2.0+ (see README.md for details)
#include <stdexcept>
#include "cluster_client.h"
cluster_client_t::cluster_client_t(ring_loop_t *ringloop, timerfd_manager_t *tfd, json11::Json & config)

Ver fichero

@ -4,6 +4,7 @@
#include <sys/epoll.h>
#include <sys/poll.h>
#include <unistd.h>
#include <stdexcept>
#include "epoll_manager.h"

Ver fichero

@ -28,12 +28,7 @@
#include "epoll_manager.h"
#include "cluster_client.h"
extern "C" {
#define CONFIG_HAVE_GETTID
#define CONFIG_PWRITEV2
#include "fio/fio.h"
#include "fio/optgroup.h"
}
#include "fio_headers.h"
struct sec_data
{

Ver fichero

@ -25,12 +25,7 @@
// -bs_config='{"data_device":"./test_data.bin"}' -size=1000M
#include "blockstore.h"
extern "C" {
#define CONFIG_HAVE_GETTID
#define CONFIG_PWRITEV2
#include "fio/fio.h"
#include "fio/optgroup.h"
}
#include "fio_headers.h"
#include "json11/json11.hpp"

16
fio_headers.h Normal file
Ver fichero

@ -0,0 +1,16 @@
extern "C" {
// Kill atomics in fio headers
#define _STDATOMIC_H
#include "fio/arch/arch.h"
#undef atomic_load_acquire
#undef atomic_store_release
#define atomic_load_acquire(p) *(p)
#define atomic_store_release(p, v) (*(p)) = (v)
#define CONFIG_HAVE_GETTID
#define CONFIG_SYNC_FILE_RANGE
#define CONFIG_PWRITEV2
#include "fio/fio.h"
#include "fio/optgroup.h"
}

Ver fichero

@ -30,12 +30,7 @@
#include "rw_blocking.h"
#include "osd_ops.h"
extern "C" {
#define CONFIG_HAVE_GETTID
#define CONFIG_PWRITEV2
#include "fio/fio.h"
#include "fio/optgroup.h"
}
#include "fio_headers.h"
struct sec_data
{

Ver fichero

@ -13,6 +13,8 @@
#include <fcntl.h>
#include <string.h>
#include <stdexcept>
#include "json11/json11.hpp"
#include "http_client.h"
#include "timerfd_manager.h"

Ver fichero

@ -4,6 +4,7 @@
#pragma once
#include <malloc.h>
#include <stdlib.h>
inline void* memalign_or_die(size_t alignment, size_t size)
{

Ver fichero

@ -6,6 +6,7 @@
#include <sys/socket.h>
#include <sys/epoll.h>
#include <netinet/tcp.h>
#include <stdexcept>
#include "messenger.h"

Ver fichero

@ -212,7 +212,11 @@ static int coroutine_fn vitastor_co_truncate(BlockDriverState *bs, int64_t offse
#if QEMU_VERSION_MAJOR >= 4
bool exact,
#endif
PreallocMode prealloc, Error **errp)
PreallocMode prealloc,
#if QEMU_VERSION_MAJOR >= 5 && QEMU_VERSION_MINOR >= 1 || QEMU_VERSION_MAJOR > 5
BdrvRequestFlags flags,
#endif
Error **errp)
{
VitastorClient *client = bs->opaque;
@ -357,9 +361,6 @@ static BlockDriver bdrv_vitastor = {
.bdrv_parse_filename = vitastor_parse_filename,
.bdrv_has_zero_init = bdrv_has_zero_init_1,
#if QEMU_VERSION_MAJOR >= 4
.bdrv_has_zero_init_truncate = bdrv_has_zero_init_1,
#endif
.bdrv_get_info = vitastor_get_info,
.bdrv_getlength = vitastor_getlength,
.bdrv_probe_blocksizes = vitastor_probe_blocksizes,

Ver fichero

@ -1,6 +1,10 @@
// Copyright (c) Vitaliy Filippov, 2019+
// License: VNPL-1.0 or GNU GPL-2.0+ (see README.md for details)
#include <stdlib.h>
#include <stdexcept>
#include "ringloop.h"
ring_loop_t::ring_loop_t(int qd)

Ver fichero

@ -11,6 +11,7 @@
#include <assert.h>
#include <liburing.h>
#include <string>
#include <functional>
#include <vector>

Ver fichero

@ -7,6 +7,8 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <string>
#include <stdexcept>
#include "timerfd_manager.h"
timerfd_manager_t::timerfd_manager_t(std::function<void(int, bool, std::function<void(int, int)>)> set_fd_handler)