include: wrap header files in extern "C" for c++
Update all the header files in include/spdk to include extern "C" declarations. Change-Id: I43299f68e962d0df18c1b23fbbaa19bc924fcb96 Signed-off-by: Dave Boutcher <dboutcher@ocient.com> Reviewed-on: https://review.gerrithub.io/390896 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
a7d816bfbe
commit
f58bc31505
@ -44,6 +44,10 @@
|
||||
#include "spdk/scsi_spec.h"
|
||||
#include "spdk/nvme_spec.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SPDK_BDEV_SMALL_BUF_MAX_SIZE 8192
|
||||
#define SPDK_BDEV_LARGE_BUF_MAX_SIZE (64 * 1024)
|
||||
|
||||
@ -751,4 +755,8 @@ void spdk_bdev_io_get_scsi_status(const struct spdk_bdev_io *bdev_io,
|
||||
*/
|
||||
void spdk_bdev_io_get_iovec(struct spdk_bdev_io *bdev_io, struct iovec **iovp, int *iovcntp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_BDEV_H_ */
|
||||
|
@ -68,6 +68,10 @@
|
||||
|
||||
#include "spdk/stdinc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef uint64_t spdk_blob_id;
|
||||
#define SPDK_BLOBID_INVALID (uint64_t)-1
|
||||
#define SPDK_BLOBSTORE_TYPE_LENGTH 16
|
||||
@ -305,4 +309,8 @@ void spdk_xattr_names_free(struct spdk_xattr_names *names);
|
||||
struct spdk_bs_type spdk_bs_get_bstype(struct spdk_blob_store *bs);
|
||||
void spdk_bs_set_bstype(struct spdk_blob_store *bs, struct spdk_bs_type bstype);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_BLOB_H_ */
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
#include "spdk/blob.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SPDK_FILE_NAME_MAX 255
|
||||
|
||||
struct spdk_file;
|
||||
@ -129,4 +133,8 @@ void spdk_file_set_priority(struct spdk_file *file, uint32_t priority);
|
||||
|
||||
int spdk_file_sync(struct spdk_file *file, struct spdk_io_channel *channel);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_FS_H_ */
|
||||
|
@ -41,6 +41,10 @@
|
||||
|
||||
#include "spdk/stdinc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct spdk_conf_value;
|
||||
struct spdk_conf_item;
|
||||
struct spdk_conf_section;
|
||||
@ -67,4 +71,8 @@ bool spdk_conf_section_get_boolval(struct spdk_conf_section *sp, const char *key
|
||||
|
||||
void spdk_conf_set_as_default(struct spdk_conf *cp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -40,6 +40,10 @@
|
||||
|
||||
#include "spdk/stdinc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*spdk_copy_completion_cb)(void *ref, int status);
|
||||
typedef void (*spdk_copy_fini_cb)(void *cb_arg);
|
||||
|
||||
@ -58,4 +62,8 @@ int spdk_copy_submit_fill(struct spdk_copy_task *copy_req, struct spdk_io_channe
|
||||
void *dst, uint8_t fill, uint64_t nbytes, spdk_copy_completion_cb cb);
|
||||
size_t spdk_copy_task_size(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
#include "spdk/stdinc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* IEEE CRC-32 polynomial (bit reflected)
|
||||
*/
|
||||
@ -98,4 +102,8 @@ uint32_t spdk_crc32_ieee_update(const void *buf, size_t len, uint32_t crc);
|
||||
*/
|
||||
uint32_t spdk_crc32c_update(const void *buf, size_t len, uint32_t crc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_CRC32_H */
|
||||
|
@ -46,6 +46,10 @@
|
||||
#include "spdk/queue.h"
|
||||
#include "spdk/log.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*spdk_event_fn)(void *arg1, void *arg2);
|
||||
|
||||
/**
|
||||
@ -193,4 +197,8 @@ void spdk_reactor_enable_context_switch_monitor(bool enabled);
|
||||
*/
|
||||
bool spdk_reactor_context_switch_monitor_enabled(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
#include "spdk/queue.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct spdk_thread;
|
||||
struct spdk_io_channel;
|
||||
struct spdk_poller;
|
||||
@ -220,4 +224,8 @@ struct spdk_thread *spdk_io_channel_get_thread(struct spdk_io_channel *ch);
|
||||
void spdk_for_each_channel(void *io_device, spdk_channel_msg fn, void *ctx,
|
||||
spdk_channel_for_each_cpl cpl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_IO_CHANNEL_H_ */
|
||||
|
@ -41,6 +41,10 @@
|
||||
|
||||
#include "spdk/stdinc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum spdk_json_val_type {
|
||||
SPDK_JSON_VAL_INVALID,
|
||||
SPDK_JSON_VAL_NULL,
|
||||
@ -237,4 +241,8 @@ int spdk_json_write_val(struct spdk_json_write_ctx *w, const struct spdk_json_va
|
||||
*/
|
||||
int spdk_json_write_val_raw(struct spdk_json_write_ctx *w, const void *data, size_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
#include "spdk/json.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SPDK_JSONRPC_ERROR_PARSE_ERROR -32700
|
||||
#define SPDK_JSONRPC_ERROR_INVALID_REQUEST -32600
|
||||
#define SPDK_JSONRPC_ERROR_METHOD_NOT_FOUND -32601
|
||||
@ -103,4 +107,8 @@ void spdk_jsonrpc_end_result(struct spdk_jsonrpc_request *request, struct spdk_j
|
||||
void spdk_jsonrpc_send_error_response(struct spdk_jsonrpc_request *request,
|
||||
int error_code, const char *msg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -41,6 +41,10 @@
|
||||
|
||||
#include "spdk/stdinc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Initialize the logging module. Messages prior
|
||||
* to this call will be dropped.
|
||||
@ -102,4 +106,8 @@ int spdk_log_clear_trace_flag(const char *flag);
|
||||
|
||||
void spdk_tracelog_usage(FILE *f, const char *trace_arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_LOG_H */
|
||||
|
@ -40,6 +40,10 @@
|
||||
|
||||
#include "spdk/stdinc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct spdk_bs_dev;
|
||||
struct spdk_lvol_store;
|
||||
struct spdk_lvol;
|
||||
@ -173,5 +177,8 @@ void spdk_lvs_load(struct spdk_bs_dev *bs_dev, spdk_lvs_op_with_handle_complete
|
||||
void *cb_arg);
|
||||
void spdk_lvol_open(struct spdk_lvol *lvol, spdk_lvol_op_with_handle_complete cb_fn, void *cb_arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_LVOL_H */
|
||||
|
@ -34,6 +34,10 @@
|
||||
#ifndef SPDK_NBD_H_
|
||||
#define SPDK_NBD_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct spdk_bdev;
|
||||
struct spdk_nbd_disk;
|
||||
|
||||
@ -45,4 +49,8 @@ struct spdk_nbd_disk *spdk_nbd_start(const char *bdev_name, const char *nbd_path
|
||||
|
||||
void spdk_nbd_stop(struct spdk_nbd_disk *nbd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -42,6 +42,10 @@
|
||||
|
||||
#include "spdk/queue.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define IDLE_INTERVAL_TIME_IN_US 5000
|
||||
|
||||
int spdk_interface_init(void);
|
||||
@ -83,4 +87,8 @@ int spdk_sock_set_sendbuf(int sock, int sz);
|
||||
bool spdk_sock_is_ipv6(int sock);
|
||||
bool spdk_sock_is_ipv4(int sock);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_NET_FRAMEWORK_H */
|
||||
|
@ -45,6 +45,10 @@
|
||||
#include "spdk/nvmf_spec.h"
|
||||
#include "spdk/queue.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct spdk_nvmf_tgt;
|
||||
struct spdk_nvmf_subsystem;
|
||||
struct spdk_nvmf_ctrlr;
|
||||
@ -322,4 +326,8 @@ void spdk_nvmf_handle_connect(struct spdk_nvmf_request *req);
|
||||
|
||||
void spdk_nvmf_ctrlr_disconnect(struct spdk_nvmf_qpair *qpair);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -38,6 +38,10 @@
|
||||
|
||||
#include "spdk/jsonrpc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int spdk_rpc_listen(const char *listen_addr);
|
||||
void spdk_rpc_accept(void);
|
||||
void spdk_rpc_close(void);
|
||||
@ -53,4 +57,8 @@ static void __attribute__((constructor)) rpc_register_##func(void) \
|
||||
spdk_rpc_register_method(method, func); \
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
#include "spdk/queue.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Defines for SPDK tracing framework */
|
||||
#define OWNER_SCSI_DEV 0x10
|
||||
#define OBJECT_SCSI_TASK 0x10
|
||||
@ -266,4 +270,8 @@ spdk_scsi_task_get_primary(struct spdk_scsi_task *task)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_SCSI_H */
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
#include "spdk/event.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int spdk_vhost_init(void);
|
||||
void spdk_vhost_fini(void);
|
||||
|
||||
@ -291,4 +295,8 @@ void spdk_vhost_call_external_event(const char *vdev_name, spdk_vhost_event_fn f
|
||||
*/
|
||||
void spdk_vhost_call_external_event_foreach(spdk_vhost_event_fn fn, void *arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SPDK_VHOST_H */
|
||||
|
Loading…
Reference in New Issue
Block a user