Browse Source

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

tags/v0.5.1
Vitaliy Filippov 3 months ago
parent
commit
3d05aa9362
15 changed files with 41 additions and 25 deletions
  1. +3
    -3
      Makefile
  2. +1
    -0
      blockstore.h
  3. +1
    -0
      cluster_client.cpp
  4. +1
    -0
      epoll_manager.cpp
  5. +1
    -6
      fio_cluster.cpp
  6. +1
    -6
      fio_engine.cpp
  7. +16
    -0
      fio_headers.h
  8. +1
    -6
      fio_sec_osd.cpp
  9. +2
    -0
      http_client.cpp
  10. +1
    -0
      malloc_or_die.h
  11. +1
    -0
      messenger.cpp
  12. +5
    -4
      qemu_driver.c
  13. +4
    -0
      ringloop.cpp
  14. +1
    -0
      ringloop.h
  15. +2
    -0
      timerfd_manager.cpp

+ 3
- 3
Makefile View File

@@ -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 $@ $<


+ 1
- 0
blockstore.h View File

@@ -9,6 +9,7 @@

#include <stdint.h>

#include <string>
#include <map>
#include <unordered_map>
#include <functional>


+ 1
- 0
cluster_client.cpp View File

@@ -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)


+ 1
- 0
epoll_manager.cpp View File

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

#include "epoll_manager.h"



+ 1
- 6
fio_cluster.cpp View File

@@ -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
{


+ 1
- 6
fio_engine.cpp View File

@@ -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
- 0
fio_headers.h View File

@@ -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"
}

+ 1
- 6
fio_sec_osd.cpp View File

@@ -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
{


+ 2
- 0
http_client.cpp View File

@@ -13,6 +13,8 @@
#include <fcntl.h>
#include <string.h>

#include <stdexcept>

#include "json11/json11.hpp"
#include "http_client.h"
#include "timerfd_manager.h"


+ 1
- 0
malloc_or_die.h View File

@@ -4,6 +4,7 @@
#pragma once

#include <malloc.h>
#include <stdlib.h>

inline void* memalign_or_die(size_t alignment, size_t size)
{


+ 1
- 0
messenger.cpp View File

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

#include "messenger.h"



+ 5
- 4
qemu_driver.c View File

@@ -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,


+ 4
- 0
ringloop.cpp View File

@@ -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)


+ 1
- 0
ringloop.h View File

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

#include <string>
#include <functional>
#include <vector>



+ 2
- 0
timerfd_manager.cpp View File

@@ -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)


Loading…
Cancel
Save