Mark all symbols hidden by default, export only required ones
This commit is contained in:
+4
-1
@@ -21,12 +21,15 @@ if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/local/?$")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-DVITASTOR_VERSION="2.2.3")
|
add_definitions(-DVITASTOR_VERSION="2.2.3")
|
||||||
add_definitions(-D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wno-sign-compare -Wno-comment -Wno-parentheses -Wno-pointer-arith -fdiagnostics-color=always -fno-omit-frame-pointer -I ${CMAKE_SOURCE_DIR}/src)
|
add_definitions(-D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wno-sign-compare -Wno-comment -Wno-parentheses -Wno-pointer-arith -fdiagnostics-color=always -fno-omit-frame-pointer -fvisibility=hidden -I ${CMAKE_SOURCE_DIR}/src)
|
||||||
add_link_options(-fno-omit-frame-pointer)
|
add_link_options(-fno-omit-frame-pointer)
|
||||||
if (${WITH_ASAN})
|
if (${WITH_ASAN})
|
||||||
add_definitions(-fsanitize=address)
|
add_definitions(-fsanitize=address)
|
||||||
add_link_options(-fsanitize=address -fno-omit-frame-pointer)
|
add_link_options(-fsanitize=address -fno-omit-frame-pointer)
|
||||||
endif (${WITH_ASAN})
|
endif (${WITH_ASAN})
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fvisibility-inlines-hidden")
|
||||||
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -fvisibility-inlines-hidden")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fvisibility-inlines-hidden")
|
||||||
|
|
||||||
set(CMAKE_BUILD_TYPE RelWithDebInfo)
|
set(CMAKE_BUILD_TYPE RelWithDebInfo)
|
||||||
string(REGEX REPLACE "([\\/\\-]O)[^ \t\r\n]*" "\\13" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
string(REGEX REPLACE "([\\/\\-]O)[^ \t\r\n]*" "\\13" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ Output:
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct blockstore_op_t
|
struct __attribute__ ((visibility("default"))) blockstore_op_t
|
||||||
{
|
{
|
||||||
// operation
|
// operation
|
||||||
uint64_t opcode = 0;
|
uint64_t opcode = 0;
|
||||||
@@ -173,7 +173,7 @@ typedef std::map<std::string, std::string> blockstore_config_t;
|
|||||||
|
|
||||||
class blockstore_impl_t;
|
class blockstore_impl_t;
|
||||||
|
|
||||||
class blockstore_t
|
class __attribute__((visibility("default"))) blockstore_t
|
||||||
{
|
{
|
||||||
blockstore_impl_t *impl;
|
blockstore_impl_t *impl;
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ static int bs_invalidate(struct thread_data *td, struct fio_file *f)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ioengine_ops ioengine = {
|
struct ioengine_ops __attribute__((visibility("default"))) ioengine = {
|
||||||
.name = "vitastor_blockstore",
|
.name = "vitastor_blockstore",
|
||||||
.version = FIO_IOOPS_VERSION,
|
.version = FIO_IOOPS_VERSION,
|
||||||
.flags = FIO_MEMALIGN | FIO_DISKLESSIO | FIO_NOEXTEND,
|
.flags = FIO_MEMALIGN | FIO_DISKLESSIO | FIO_NOEXTEND,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ struct cluster_op_part_t
|
|||||||
osd_op_t op;
|
osd_op_t op;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cluster_op_t
|
struct __attribute__((visibility("default"))) cluster_op_t
|
||||||
{
|
{
|
||||||
uint64_t opcode; // OSD_OP_READ, OSD_OP_WRITE, OSD_OP_SYNC, OSD_OP_DELETE, OSD_OP_READ_BITMAP, OSD_OP_READ_CHAIN_BITMAP
|
uint64_t opcode; // OSD_OP_READ, OSD_OP_WRITE, OSD_OP_SYNC, OSD_OP_DELETE, OSD_OP_READ_BITMAP, OSD_OP_READ_CHAIN_BITMAP
|
||||||
uint64_t inode;
|
uint64_t inode;
|
||||||
@@ -81,7 +81,7 @@ struct inode_list_pg_t;
|
|||||||
class writeback_cache_t;
|
class writeback_cache_t;
|
||||||
|
|
||||||
// FIXME: Split into public and private interfaces
|
// FIXME: Split into public and private interfaces
|
||||||
class cluster_client_t
|
class __attribute__((visibility("default"))) cluster_client_t
|
||||||
{
|
{
|
||||||
#ifdef __MOCK__
|
#ifdef __MOCK__
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ struct inode_watch_t
|
|||||||
|
|
||||||
struct http_co_t;
|
struct http_co_t;
|
||||||
|
|
||||||
struct etcd_state_client_t
|
struct __attribute__((visibility("default"))) etcd_state_client_t
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::vector<std::string> local_ips;
|
std::vector<std::string> local_ips;
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ static int sec_invalidate(struct thread_data *td, struct fio_file *f)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ioengine_ops ioengine = {
|
struct ioengine_ops __attribute__((visibility("default"))) ioengine = {
|
||||||
.name = "vitastor_cluster",
|
.name = "vitastor_cluster",
|
||||||
.version = FIO_IOOPS_VERSION,
|
.version = FIO_IOOPS_VERSION,
|
||||||
.flags = FIO_MEMALIGN | FIO_DISKLESSIO | FIO_NOEXTEND,
|
.flags = FIO_MEMALIGN | FIO_DISKLESSIO | FIO_NOEXTEND,
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ static int sec_invalidate(struct thread_data *td, struct fio_file *f)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ioengine_ops ioengine = {
|
struct ioengine_ops __attribute__((visibility("default"))) ioengine = {
|
||||||
.name = "vitastor_secondary_osd",
|
.name = "vitastor_secondary_osd",
|
||||||
.version = FIO_IOOPS_VERSION,
|
.version = FIO_IOOPS_VERSION,
|
||||||
.flags = FIO_MEMALIGN | FIO_DISKLESSIO | FIO_NOEXTEND,
|
.flags = FIO_MEMALIGN | FIO_DISKLESSIO | FIO_NOEXTEND,
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ struct osd_messenger_t;
|
|||||||
struct rdmacm_connecting_t;
|
struct rdmacm_connecting_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct osd_messenger_t
|
struct __attribute__((visibility("default"))) osd_messenger_t
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
int keepalive_timer_id = -1;
|
int keepalive_timer_id = -1;
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ struct blockstore_op_t;
|
|||||||
|
|
||||||
struct osd_primary_op_data_t;
|
struct osd_primary_op_data_t;
|
||||||
|
|
||||||
struct osd_op_t
|
struct __attribute__((visibility("default"))) osd_op_t
|
||||||
{
|
{
|
||||||
timespec tv_begin = { 0 }, tv_end = { 0 };
|
timespec tv_begin = { 0 }, tv_end = { 0 };
|
||||||
uint64_t op_type = OSD_OP_IN;
|
uint64_t op_type = OSD_OP_IN;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
// Placement group states
|
// Placement group states
|
||||||
// STARTING -> [acquire lock] -> PEERING -> INCOMPLETE|ACTIVE
|
// STARTING -> [acquire lock] -> PEERING -> INCOMPLETE|ACTIVE
|
||||||
// ACTIVE -> REPEERING -> PEERING
|
// ACTIVE -> REPEERING -> PEERING
|
||||||
@@ -50,3 +52,5 @@ extern const int pg_state_bit_count;
|
|||||||
extern const int object_state_bits[];
|
extern const int object_state_bits[];
|
||||||
extern const char *object_state_names[];
|
extern const char *object_state_names[];
|
||||||
extern const int object_state_bit_count;
|
extern const int object_state_bit_count;
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|||||||
@@ -57,11 +57,11 @@
|
|||||||
#include "vitastor_c.h"
|
#include "vitastor_c.h"
|
||||||
|
|
||||||
#ifdef VITASTOR_SOURCE_TREE
|
#ifdef VITASTOR_SOURCE_TREE
|
||||||
void qemu_module_dummy(void)
|
void __attribute__((visibility("default"))) qemu_module_dummy(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSO_STAMP_FUN(void)
|
void __attribute__((visibility("default"))) DSO_STAMP_FUN(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -85,4 +87,6 @@ uint32_t vitastor_c_inode_get_immediate_commit(vitastor_c *client, uint64_t inod
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class cluster_client_t;
|
|||||||
|
|
||||||
struct kv_db_t;
|
struct kv_db_t;
|
||||||
|
|
||||||
struct vitastorkv_dbw_t
|
struct __attribute__((visibility("default"))) vitastorkv_dbw_t
|
||||||
{
|
{
|
||||||
// cli = vitastor_c_get_internal_client(client)
|
// cli = vitastor_c_get_internal_client(client)
|
||||||
vitastorkv_dbw_t(cluster_client_t *cli);
|
vitastorkv_dbw_t(cluster_client_t *cli);
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
#include "liburing/io_uring_version.h"
|
#include "liburing/io_uring_version.h"
|
||||||
#include "liburing/barrier.h"
|
#include "liburing/barrier.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef uring_unlikely
|
#ifndef uring_unlikely
|
||||||
#define uring_unlikely(cond) __builtin_expect(!!(cond), 0)
|
#define uring_unlikely(cond) __builtin_expect(!!(cond), 0)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ struct addr_mask_t
|
|||||||
uint8_t bits;
|
uint8_t bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
bool string_to_addr(std::string str, bool parse_port, int default_port, struct sockaddr_storage *addr);
|
bool string_to_addr(std::string str, bool parse_port, int default_port, struct sockaddr_storage *addr);
|
||||||
std::string addr_to_string(const sockaddr_storage &addr);
|
std::string addr_to_string(const sockaddr_storage &addr);
|
||||||
addr_mask_t cidr_parse(std::string mask);
|
addr_mask_t cidr_parse(std::string mask);
|
||||||
@@ -22,3 +24,5 @@ bool cidr_sockaddr_match(const sockaddr_storage &addr, const addr_mask_t &mask);
|
|||||||
std::vector<std::string> getifaddr_list(const std::vector<addr_mask_t> & masks = std::vector<addr_mask_t>(), bool include_v6 = false);
|
std::vector<std::string> getifaddr_list(const std::vector<addr_mask_t> & masks = std::vector<addr_mask_t>(), bool include_v6 = false);
|
||||||
int create_and_bind_socket(std::string bind_address, int bind_port, int listen_backlog, int *listening_port);
|
int create_and_bind_socket(std::string bind_address, int bind_port, int listen_backlog, int *listening_port);
|
||||||
std::string gethostname_str();
|
std::string gethostname_str();
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
// Hierarchical bitmap allocator
|
// Hierarchical bitmap allocator
|
||||||
class allocator_t
|
class allocator_t
|
||||||
{
|
{
|
||||||
@@ -25,3 +27,5 @@ public:
|
|||||||
void bitmap_set(void *bitmap, uint64_t start, uint64_t len, uint64_t bitmap_granularity);
|
void bitmap_set(void *bitmap, uint64_t start, uint64_t len, uint64_t bitmap_granularity);
|
||||||
void bitmap_clear(void *bitmap, uint64_t start, uint64_t len, uint64_t bitmap_granularity);
|
void bitmap_clear(void *bitmap, uint64_t start, uint64_t len, uint64_t bitmap_granularity);
|
||||||
bool bitmap_check(void *bitmap, uint64_t start, uint64_t len, uint64_t bitmap_granularity);
|
bool bitmap_check(void *bitmap, uint64_t start, uint64_t len, uint64_t bitmap_granularity);
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
// unsigned __int64 _mm_crc32_u64 (unsigned __int64 crc, unsigned __int64 v)
|
// unsigned __int64 _mm_crc32_u64 (unsigned __int64 crc, unsigned __int64 v)
|
||||||
// unsigned int _mm_crc32_u8 (unsigned int crc, unsigned char v)
|
// unsigned int _mm_crc32_u8 (unsigned int crc, unsigned char v)
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -17,3 +19,5 @@ uint32_t crc32c_nopad(uint32_t prev_crc, const void *buf, size_t len, size_t lef
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include "ringloop.h"
|
#include "ringloop.h"
|
||||||
#include "timerfd_manager.h"
|
#include "timerfd_manager.h"
|
||||||
|
|
||||||
class epoll_manager_t
|
class __attribute__((visibility("default"))) epoll_manager_t
|
||||||
{
|
{
|
||||||
int epoll_fd;
|
int epoll_fd;
|
||||||
bool pending;
|
bool pending;
|
||||||
|
|||||||
@@ -8,7 +8,11 @@
|
|||||||
|
|
||||||
#include "json11/json11.hpp"
|
#include "json11/json11.hpp"
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
std::map<std::string, std::string> json_to_string_map(const json11::Json::object & config);
|
std::map<std::string, std::string> json_to_string_map(const json11::Json::object & config);
|
||||||
bool json_is_true(const json11::Json & val);
|
bool json_is_true(const json11::Json & val);
|
||||||
bool json_is_false(const json11::Json & val);
|
bool json_is_false(const json11::Json & val);
|
||||||
std::string implode(const std::string & sep, json11::Json array);
|
std::string implode(const std::string & sep, json11::Json array);
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
inline void* memalign_or_die(size_t alignment, size_t size)
|
inline void* memalign_or_die(size_t alignment, size_t size)
|
||||||
{
|
{
|
||||||
void *buf = memalign(alignment, size);
|
void *buf = memalign(alignment, size);
|
||||||
@@ -49,3 +51,5 @@ inline void* calloc_or_die(size_t nmemb, size_t size)
|
|||||||
}
|
}
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ struct ring_consumer_t
|
|||||||
std::function<void(void)> loop;
|
std::function<void(void)> loop;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ring_loop_t
|
class __attribute__((visibility("default"))) ring_loop_t
|
||||||
{
|
{
|
||||||
std::vector<std::function<void()>> immediate_queue, immediate_queue2;
|
std::vector<std::function<void()>> immediate_queue, immediate_queue2;
|
||||||
std::vector<ring_consumer_t*> consumers;
|
std::vector<ring_consumer_t*> consumers;
|
||||||
|
|||||||
@@ -6,8 +6,12 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
size_t read_blocking(int fd, void *read_buf, size_t remaining);
|
size_t read_blocking(int fd, void *read_buf, size_t remaining);
|
||||||
size_t write_blocking(int fd, void *write_buf, size_t remaining);
|
size_t write_blocking(int fd, void *write_buf, size_t remaining);
|
||||||
int readv_blocking(int fd, iovec *iov, int iovcnt);
|
int readv_blocking(int fd, iovec *iov, int iovcnt);
|
||||||
int writev_blocking(int fd, iovec *iov, int iovcnt);
|
int writev_blocking(int fd, iovec *iov, int iovcnt);
|
||||||
int sendv_blocking(int fd, iovec *iov, int iovcnt, int flags);
|
int sendv_blocking(int fd, iovec *iov, int iovcnt, int flags);
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
/*************************** HEADER FILES ***************************/
|
/*************************** HEADER FILES ***************************/
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
/****************************** MACROS ******************************/
|
/****************************** MACROS ******************************/
|
||||||
#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
|
#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
|
||||||
|
|
||||||
@@ -38,4 +40,6 @@ void sha256_final(SHA256_CTX *ctx, BYTE hash[]);
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|
||||||
#endif // SHA256_H
|
#endif // SHA256_H
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#define is_white(a) ((a) == ' ' || (a) == '\t' || (a) == '\r' || (a) == '\n')
|
#define is_white(a) ((a) == ' ' || (a) == '\t' || (a) == '\r' || (a) == '\n')
|
||||||
|
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
std::string base64_encode(const std::string &in);
|
std::string base64_encode(const std::string &in);
|
||||||
std::string base64_decode(const std::string &in);
|
std::string base64_decode(const std::string &in);
|
||||||
uint64_t parse_size(std::string size_str, bool *ok = NULL);
|
uint64_t parse_size(std::string size_str, bool *ok = NULL);
|
||||||
@@ -32,3 +34,5 @@ std::string addslashes(const std::string & str, const char *toescape = "\\\"");
|
|||||||
std::string realpath_str(std::string path, bool nofail = true);
|
std::string realpath_str(std::string path, bool nofail = true);
|
||||||
std::string format_datetime(uint64_t unixtime);
|
std::string format_datetime(uint64_t unixtime);
|
||||||
bool is_zero(void *buf, size_t size);
|
bool is_zero(void *buf, size_t size);
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ struct timerfd_timer_t
|
|||||||
std::function<void(int)> callback;
|
std::function<void(int)> callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
class timerfd_manager_t
|
class __attribute__((visibility("default"))) timerfd_manager_t
|
||||||
{
|
{
|
||||||
int wait_state = 0;
|
int wait_state = 0;
|
||||||
int timerfd;
|
int timerfd;
|
||||||
|
|||||||
Reference in New Issue
Block a user