]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: Only public API symbols from the shared library 3024/head
authorJason Dillaman <dillaman@redhat.com>
Sat, 15 Nov 2014 11:00:30 +0000 (06:00 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 26 Nov 2014 21:53:46 +0000 (16:53 -0500)
The librados shared library was previously exporting all
symbols.  librados public API methods are now explicitly
exported and all other symbols are hidden.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/Makefile.am
src/common/Makefile.am
src/include/buffer.h
src/include/rados/librados.h
src/include/rados/librados.hpp
src/librados/Makefile.am
src/librados/RadosClient.h [changed mode: 0755->0644]
src/libradosstriper/Makefile.am
src/librbd/Makefile.am
src/test/Makefile.am

index c2d89e9396483cff67841961b1929392d40bf7ff..1cc80f9e7c1dbff5dd493e0aa76bc4bcc880c433 100644 (file)
@@ -79,7 +79,7 @@ bin_PROGRAMS += ceph-syn
 
 
 libkrbd_la_SOURCES = krbd.cc
-libkrbd_la_LIBADD = $(LIBSECRET) -lblkid -ludev
+libkrbd_la_LIBADD = $(LIBSECRET) $(LIBCOMMON) -lblkid -ludev
 if LINUX
 noinst_LTLIBRARIES += libkrbd.la
 endif LINUX
index bb305ea4893350fae092c3d8cdaff6d4ed1236ac..94ac19d7c9e4d4c5a3ae79f286efd3ae385dc664 100644 (file)
@@ -1,4 +1,4 @@
-libcommon_la_SOURCES = \
+libcommon_internal_la_SOURCES = \
        ceph_ver.c \
        common/DecayCounter.cc \
        common/LogClient.cc \
@@ -38,7 +38,6 @@ libcommon_la_SOURCES = \
        common/pipe.c \
        common/ceph_argparse.cc \
        common/ceph_context.cc \
-       common/buffer.cc \
        common/types.cc \
        common/code_environment.cc \
        common/dout.cc \
@@ -75,8 +74,8 @@ libcommon_la_SOURCES = \
        common/module.c \
        common/Readahead.cc
 
-# these should go out of libcommon
-libcommon_la_SOURCES += \
+# these should go out of libcommon_internal
+libcommon_internal_la_SOURCES += \
        mon/MonCap.cc \
        mon/MonClient.cc \
        mon/MonMap.cc \
@@ -88,6 +87,15 @@ libcommon_la_SOURCES += \
        mds/inode_backtrace.cc \
        mds/mdstypes.cc \
        mds/flock.cc
+LIBCOMMON_DEPS += libcommon_internal.la
+noinst_LTLIBRARIES += libcommon_internal.la
+
+libcommon_api_la_SOURCES = \
+       common/buffer.cc
+if LINUX
+libcommon_api_la_CXXFLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
+endif # LINUX
+noinst_LTLIBRARIES += libcommon_api.la
 
 # inject crc in common
 libcommon_crc_la_SOURCES = \
@@ -120,7 +128,9 @@ if LINUX
 LIBCOMMON_DEPS += -lrt
 endif # LINUX
 
-libcommon_la_LIBADD = $(LIBCOMMON_DEPS)
+libcommon_la_SOURCES =
+libcommon_la_LIBADD = $(LIBCOMMON_DEPS) libcommon_api.la
+noinst_LTLIBRARIES += libcommon.la
 
 noinst_HEADERS += \
        common/BackTrace.h \
@@ -209,9 +219,6 @@ noinst_HEADERS += \
        common/Continuation.h \
        common/Readahead.h
 
-noinst_LTLIBRARIES += libcommon.la
-
-
 libsecret_la_SOURCES = common/secret.c
 libsecret_la_LIBADD = $(KEYUTILS_LIB)
 if LINUX
index 0c917302f6b552724180a4753666f902c0ab5508..5a8048198034d6cbe9f548df09a309674f3b420d 100644 (file)
 # include <assert.h>
 #endif
 
+#if __GNUC__ >= 4
+  #define CEPH_BUFFER_API  __attribute__ ((visibility ("default")))
+#else
+  #define CEPH_BUFFER_API
+#endif
+
 namespace ceph {
 
-class buffer {
+class CEPH_BUFFER_API buffer {
   /*
    * exceptions
    */
@@ -151,7 +157,7 @@ public:
   /*
    * a buffer pointer.  references (a subsequence of) a raw buffer.
    */
-  class ptr {
+  class CEPH_BUFFER_API ptr {
     raw *_raw;
     unsigned _off, _len;
 
@@ -168,7 +174,7 @@ public:
     ~ptr() {
       release();
     }
-    
+
     bool have_raw() const { return _raw ? true:false; }
 
     raw *clone();
@@ -237,7 +243,7 @@ public:
    * list - the useful bit!
    */
 
-  class list {
+  class CEPH_BUFFER_API list {
     // my private bits
     std::list<ptr> _buffers;
     unsigned _len;
@@ -245,7 +251,7 @@ public:
     ptr append_buffer;  // where i put small appends.
 
   public:
-    class iterator {
+    class CEPH_BUFFER_API iterator {
       list *bl;
       std::list<ptr> *ls; // meh.. just here to avoid an extra pointer dereference..
       unsigned off;  // in bl
index 79afe5521a166d87790a88b8fe029d496cc80560..0c983ef18cf536544164b16bc3678de3e7cfe736 100644 (file)
@@ -68,6 +68,12 @@ extern "C" {
 // allow the transaction to succeed even if the flagged op fails
 #define LIBRADOS_OP_FLAG_FAILOK 2
 
+#if __GNUC__ >= 4
+  #define CEPH_RADOS_API  __attribute__ ((visibility ("default")))
+#else
+  #define CEPH_RADOS_API
+#endif
+
 /**
  * @defgroup librados_h_xattr_comp xattr comparison operations
  * Operators for comparing xattrs on objects, and aborting the
@@ -285,7 +291,7 @@ typedef void *rados_read_op_t;
  * @param minor where to store the minor version number
  * @param extra where to store the extra version number
  */
-void rados_version(int *major, int *minor, int *extra);
+CEPH_RADOS_API void rados_version(int *major, int *minor, int *extra);
 
 /**
  * @defgroup librados_h_init Setup and Teardown
@@ -306,7 +312,7 @@ void rados_version(int *major, int *minor, int *extra);
  * @param id the user to connect as (i.e. admin, not client.admin)
  * @returns 0 on success, negative error code on failure
  */
-int rados_create(rados_t *cluster, const char * const id);
+CEPH_RADOS_API int rados_create(rados_t *cluster, const char * const id);
 
 /**
  * Extended version of rados_create.
@@ -316,8 +322,9 @@ int rados_create(rados_t *cluster, const char * const id);
  * 2) allow specification of cluster name
  * 3) flags for future expansion
  */
-int rados_create2(rados_t *pcluster, const char *const clustername,
-                 const char * const name, uint64_t flags);
+CEPH_RADOS_API int rados_create2(rados_t *pcluster,
+                                 const char *const clustername,
+                                 const char * const name, uint64_t flags);
 
 /**
  * Initialize a cluster handle from an existing configuration.
@@ -328,7 +335,8 @@ int rados_create2(rados_t *pcluster, const char *const clustername,
  * @param cct_ the existing configuration to use
  * @returns 0 on success, negative error code on failure
  */
-int rados_create_with_context(rados_t *cluster, rados_config_t cct);
+CEPH_RADOS_API int rados_create_with_context(rados_t *cluster,
+                                             rados_config_t cct);
 
 /**
  * Ping the monitor with ID mon_id, storing the resulting reply in
@@ -344,8 +352,8 @@ int rados_create_with_context(rados_t *cluster, rados_config_t cct);
  * @param[out] outstr     double pointer with the resulting reply
  * @param[out] outstrlen  pointer with the size of the reply in outstr
  */
-int rados_ping_monitor(rados_t cluster, const char *mon_id,
-                       char **outstr, size_t *outstrlen);
+CEPH_RADOS_API int rados_ping_monitor(rados_t cluster, const char *mon_id,
+                                      char **outstr, size_t *outstrlen);
 
 /**
  * Connect to the cluster.
@@ -362,7 +370,7 @@ int rados_ping_monitor(rados_t cluster, const char *mon_id,
  * @param cluster The cluster to connect to.
  * @returns 0 on sucess, negative error code on failure
  */
-int rados_connect(rados_t cluster);
+CEPH_RADOS_API int rados_connect(rados_t cluster);
 
 /**
  * Disconnects from the cluster.
@@ -378,7 +386,7 @@ int rados_connect(rados_t cluster);
  *
  * @param cluster the cluster to shutdown
  */
-void rados_shutdown(rados_t cluster);
+CEPH_RADOS_API void rados_shutdown(rados_t cluster);
 
 /** @} init */
 
@@ -416,7 +424,7 @@ void rados_shutdown(rados_t cluster);
  * @param path path to a Ceph configuration file
  * @returns 0 on success, negative error code on failure
  */
-int rados_conf_read_file(rados_t cluster, const char *path);
+CEPH_RADOS_API int rados_conf_read_file(rados_t cluster, const char *path);
 
 /**
  * Configure the cluster handle with command line arguments
@@ -435,7 +443,8 @@ int rados_conf_read_file(rados_t cluster, const char *path);
  * @param argv arguments to parse
  * @returns 0 on success, negative error code on failure
  */
-int rados_conf_parse_argv(rados_t cluster, int argc, const char **argv);
+CEPH_RADOS_API int rados_conf_parse_argv(rados_t cluster, int argc,
+                                         const char **argv);
 
 
 /**
@@ -451,8 +460,9 @@ int rados_conf_parse_argv(rados_t cluster, int argc, const char **argv);
  * @param remargv char* array for returned unrecognized arguments
  * @returns 0 on success, negative error code on failure
  */
-int rados_conf_parse_argv_remainder(rados_t cluster, int argc,
-                                   const char **argv, const char **remargv);
+CEPH_RADOS_API int rados_conf_parse_argv_remainder(rados_t cluster, int argc,
+                                                  const char **argv,
+                                                   const char **remargv);
 /**
  * Configure the cluster handle based on an environment variable
  *
@@ -468,7 +478,7 @@ int rados_conf_parse_argv_remainder(rados_t cluster, int argc,
  * @param var name of the environment variable to read
  * @returns 0 on success, negative error code on failure
  */
-int rados_conf_parse_env(rados_t cluster, const char *var);
+CEPH_RADOS_API int rados_conf_parse_env(rados_t cluster, const char *var);
 
 /**
  * Set a configuration option
@@ -481,7 +491,8 @@ int rados_conf_parse_env(rados_t cluster, const char *var);
  * @returns 0 on success, negative error code on failure
  * @returns -ENOENT when the option is not a Ceph configuration option
  */
-int rados_conf_set(rados_t cluster, const char *option, const char *value);
+CEPH_RADOS_API int rados_conf_set(rados_t cluster, const char *option,
+                                  const char *value);
 
 /**
  * Get the value of a configuration option
@@ -494,7 +505,8 @@ int rados_conf_set(rados_t cluster, const char *option, const char *value);
  * @returns -ENAMETOOLONG if the buffer is too short to contain the
  * requested value
  */
-int rados_conf_get(rados_t cluster, const char *option, char *buf, size_t len);
+CEPH_RADOS_API int rados_conf_get(rados_t cluster, const char *option,
+                                  char *buf, size_t len);
 
 /** @} config */
 
@@ -509,7 +521,8 @@ int rados_conf_get(rados_t cluster, const char *option, char *buf, size_t len);
  * @param result where to store the results
  * @returns 0 on success, negative error code on failure
  */
-int rados_cluster_stat(rados_t cluster, struct rados_cluster_stat_t *result);
+CEPH_RADOS_API int rados_cluster_stat(rados_t cluster,
+                                      struct rados_cluster_stat_t *result);
 
 /**
  * Get the fsid of the cluster as a hexadecimal string.
@@ -523,7 +536,7 @@ int rados_cluster_stat(rados_t cluster, struct rados_cluster_stat_t *result);
  * @returns -ERANGE if the buffer is too short to contain the
  * fsid
  */
-int rados_cluster_fsid(rados_t cluster, char *buf, size_t len);
+CEPH_RADOS_API int rados_cluster_fsid(rados_t cluster, char *buf, size_t len);
 
 /**
  * Get/wait for the most recent osdmap
@@ -531,7 +544,7 @@ int rados_cluster_fsid(rados_t cluster, char *buf, size_t len);
  * @param cluster the cluster to shutdown
  * @returns 0 on sucess, negative error code on failure
  */
-int rados_wait_for_latest_osdmap(rados_t cluster);
+CEPH_RADOS_API int rados_wait_for_latest_osdmap(rados_t cluster);
 
 /**
  * @defgroup librados_h_pools Pools
@@ -560,7 +573,7 @@ int rados_wait_for_latest_osdmap(rados_t cluster);
  * @param len output buffer length
  * @returns length of the buffer we would need to list all pools
  */
-int rados_pool_list(rados_t cluster, char *buf, size_t len);
+CEPH_RADOS_API int rados_pool_list(rados_t cluster, char *buf, size_t len);
 
 /**
  * Get a configuration handle for a rados cluster handle
@@ -570,7 +583,7 @@ int rados_pool_list(rados_t cluster, char *buf, size_t len);
  * @param cluster cluster handle
  * @returns config handle for this cluster
  */
-rados_config_t rados_cct(rados_t cluster);
+CEPH_RADOS_API rados_config_t rados_cct(rados_t cluster);
 
 /**
  * Get a global id for current instance
@@ -580,7 +593,7 @@ rados_config_t rados_cct(rados_t cluster);
  * @param cluster cluster handle
  * @returns instance global id
  */
-uint64_t rados_get_instance_id(rados_t cluster);
+CEPH_RADOS_API uint64_t rados_get_instance_id(rados_t cluster);
 
 /**
  * Create an io context
@@ -593,7 +606,8 @@ uint64_t rados_get_instance_id(rados_t cluster);
  * @param ioctx where to store the io context
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_create(rados_t cluster, const char *pool_name, rados_ioctx_t *ioctx);
+CEPH_RADOS_API int rados_ioctx_create(rados_t cluster, const char *pool_name,
+                                      rados_ioctx_t *ioctx);
 
 /**
  * The opposite of rados_ioctx_create
@@ -609,7 +623,7 @@ int rados_ioctx_create(rados_t cluster, const char *pool_name, rados_ioctx_t *io
  *
  * @param io the io context to dispose of
  */
-void rados_ioctx_destroy(rados_ioctx_t io);
+CEPH_RADOS_API void rados_ioctx_destroy(rados_ioctx_t io);
 
 /**
  * Get configuration hadnle for a pool handle
@@ -617,7 +631,7 @@ void rados_ioctx_destroy(rados_ioctx_t io);
  * @param io pool handle
  * @returns rados_config_t for this cluster
  */
-rados_config_t rados_ioctx_cct(rados_ioctx_t io);
+CEPH_RADOS_API rados_config_t rados_ioctx_cct(rados_ioctx_t io);
 
 /**
  * Get the cluster handle used by this rados_ioctx_t
@@ -627,7 +641,7 @@ rados_config_t rados_ioctx_cct(rados_ioctx_t io);
  * @param io the io context
  * @returns the cluster handle for this io context
  */
-rados_t rados_ioctx_get_cluster(rados_ioctx_t io);
+CEPH_RADOS_API rados_t rados_ioctx_get_cluster(rados_ioctx_t io);
 
 /**
  * Get pool usage statistics
@@ -638,7 +652,8 @@ rados_t rados_ioctx_get_cluster(rados_ioctx_t io);
  * @param stats where to store the results
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_pool_stat(rados_ioctx_t io, struct rados_pool_stat_t *stats);
+CEPH_RADOS_API int rados_ioctx_pool_stat(rados_ioctx_t io,
+                                         struct rados_pool_stat_t *stats);
 
 /**
  * Get the id of a pool
@@ -648,7 +663,8 @@ int rados_ioctx_pool_stat(rados_ioctx_t io, struct rados_pool_stat_t *stats);
  * @returns id of the pool
  * @returns -ENOENT if the pool is not found
  */
-int64_t rados_pool_lookup(rados_t cluster, const char *pool_name);
+CEPH_RADOS_API int64_t rados_pool_lookup(rados_t cluster,
+                                         const char *pool_name);
 
 /**
  * Get the name of a pool
@@ -659,8 +675,8 @@ int64_t rados_pool_lookup(rados_t cluster, const char *pool_name);
  * @param maxlen size of buffer where name will be stored
  * @returns length of string stored, or -ERANGE if buffer too small
  */
-int rados_pool_reverse_lookup(rados_t cluster, int64_t id, char *buf,
-                             size_t maxlen);
+CEPH_RADOS_API int rados_pool_reverse_lookup(rados_t cluster, int64_t id,
+                                             char *buf, size_t maxlen);
 
 /**
  * Create a pool with default settings
@@ -672,7 +688,7 @@ int rados_pool_reverse_lookup(rados_t cluster, int64_t id, char *buf,
  * @param pool_name the name of the new pool
  * @returns 0 on success, negative error code on failure
  */
-int rados_pool_create(rados_t cluster, const char *pool_name);
+CEPH_RADOS_API int rados_pool_create(rados_t cluster, const char *pool_name);
 
 /**
  * Create a pool owned by a specific auid
@@ -685,7 +701,9 @@ int rados_pool_create(rados_t cluster, const char *pool_name);
  * @param auid the id of the owner of the new pool
  * @returns 0 on success, negative error code on failure
  */
-int rados_pool_create_with_auid(rados_t cluster, const char *pool_name, uint64_t auid);
+CEPH_RADOS_API int rados_pool_create_with_auid(rados_t cluster,
+                                               const char *pool_name,
+                                               uint64_t auid);
 
 /**
  * Create a pool with a specific CRUSH rule
@@ -695,8 +713,9 @@ int rados_pool_create_with_auid(rados_t cluster, const char *pool_name, uint64_t
  * @param crush_rule_num which rule to use for placement in the new pool1
  * @returns 0 on success, negative error code on failure
  */
-int rados_pool_create_with_crush_rule(rados_t cluster, const char *pool_name,
-                                     uint8_t crush_rule_num);
+CEPH_RADOS_API int rados_pool_create_with_crush_rule(rados_t cluster,
+                                                     const char *pool_name,
+                                                    uint8_t crush_rule_num);
 
 /**
  * Create a pool with a specific CRUSH rule and auid
@@ -710,8 +729,10 @@ int rados_pool_create_with_crush_rule(rados_t cluster, const char *pool_name,
  * @param auid the id of the owner of the new pool
  * @returns 0 on success, negative error code on failure
  */
-int rados_pool_create_with_all(rados_t cluster, const char *pool_name, uint64_t auid,
-                              uint8_t crush_rule_num);
+CEPH_RADOS_API int rados_pool_create_with_all(rados_t cluster,
+                                              const char *pool_name,
+                                              uint64_t auid,
+                                             uint8_t crush_rule_num);
 
 /**
  * Returns the pool that is the base tier for this pool.
@@ -724,7 +745,8 @@ int rados_pool_create_with_all(rados_t cluster, const char *pool_name, uint64_t
  * @param[out] base_tier base tier, or \c pool if tiering is not configured
  * @returns 0 on success, negative error code on failure
  */
-int rados_pool_get_base_tier(rados_t cluster, int64_t pool, int64_t* base_tier);
+CEPH_RADOS_API int rados_pool_get_base_tier(rados_t cluster, int64_t pool,
+                                            int64_t* base_tier);
 
 /**
  * Delete a pool and all data inside it
@@ -736,7 +758,7 @@ int rados_pool_get_base_tier(rados_t cluster, int64_t pool, int64_t* base_tier);
  * @param pool_name which pool to delete
  * @returns 0 on success, negative error code on failure
  */
-int rados_pool_delete(rados_t cluster, const char *pool_name);
+CEPH_RADOS_API int rados_pool_delete(rados_t cluster, const char *pool_name);
 
 /**
  * Attempt to change an io context's associated auid "owner."
@@ -748,7 +770,7 @@ int rados_pool_delete(rados_t cluster, const char *pool_name);
  * @param auid the auid you wish the io to have.
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_pool_set_auid(rados_ioctx_t io, uint64_t auid);
+CEPH_RADOS_API int rados_ioctx_pool_set_auid(rados_ioctx_t io, uint64_t auid);
 
 /**
  * Get the auid of a pool
@@ -757,10 +779,10 @@ int rados_ioctx_pool_set_auid(rados_ioctx_t io, uint64_t auid);
  * @param auid where to store the auid
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_pool_get_auid(rados_ioctx_t io, uint64_t *auid);
+CEPH_RADOS_API int rados_ioctx_pool_get_auid(rados_ioctx_t io, uint64_t *auid);
 
-int rados_ioctx_pool_requires_alignment(rados_ioctx_t io);
-uint64_t rados_ioctx_pool_required_alignment(rados_ioctx_t io);
+CEPH_RADOS_API int rados_ioctx_pool_requires_alignment(rados_ioctx_t io);
+CEPH_RADOS_API uint64_t rados_ioctx_pool_required_alignment(rados_ioctx_t io);
 
 /**
  * Get the pool id of the io context
@@ -768,7 +790,7 @@ uint64_t rados_ioctx_pool_required_alignment(rados_ioctx_t io);
  * @param io the io context to query
  * @returns the id of the pool the io context uses
  */
-int64_t rados_ioctx_get_id(rados_ioctx_t io);
+CEPH_RADOS_API int64_t rados_ioctx_get_id(rados_ioctx_t io);
 
 /**
  * Get the pool name of the io context
@@ -778,7 +800,8 @@ int64_t rados_ioctx_get_id(rados_ioctx_t io);
  * @param maxlen size of buffer where name will be stored
  * @returns length of string stored, or -ERANGE if buffer too small
  */
-int rados_ioctx_get_pool_name(rados_ioctx_t io, char *buf, unsigned maxlen);
+CEPH_RADOS_API int rados_ioctx_get_pool_name(rados_ioctx_t io, char *buf,
+                                             unsigned maxlen);
 
 /** @} pools */
 
@@ -803,7 +826,8 @@ int rados_ioctx_get_pool_name(rados_ioctx_t io, char *buf, unsigned maxlen);
  * @param key the key to use as the object locator, or NULL to discard
  * any previously set key
  */
-void rados_ioctx_locator_set_key(rados_ioctx_t io, const char *key);
+CEPH_RADOS_API void rados_ioctx_locator_set_key(rados_ioctx_t io,
+                                                const char *key);
 
 /**
  * Set the namespace for objects within an io context
@@ -816,7 +840,8 @@ void rados_ioctx_locator_set_key(rados_ioctx_t io, const char *key);
  * @param nspace the name to use as the namespace, or NULL use the
  * default namespace
  */
-void rados_ioctx_set_namespace(rados_ioctx_t io, const char *nspace);
+CEPH_RADOS_API void rados_ioctx_set_namespace(rados_ioctx_t io,
+                                              const char *nspace);
 /** @} obj_loc */
 
 /**
@@ -830,7 +855,8 @@ void rados_ioctx_set_namespace(rados_ioctx_t io, const char *nspace);
  * @param ctx the handle to store list context in
  * @returns 0 on success, negative error code on failure
  */
-int rados_nobjects_list_open(rados_ioctx_t io, rados_list_ctx_t *ctx);
+CEPH_RADOS_API int rados_nobjects_list_open(rados_ioctx_t io,
+                                            rados_list_ctx_t *ctx);
 
 /**
  * Return hash position of iterator, rounded to the current PG
@@ -838,7 +864,7 @@ int rados_nobjects_list_open(rados_ioctx_t io, rados_list_ctx_t *ctx);
  * @param ctx iterator marking where you are in the listing
  * @returns current hash position, rounded to the current pg
  */
-uint32_t rados_nobjects_list_get_pg_hash_position(rados_list_ctx_t ctx);
+CEPH_RADOS_API uint32_t rados_nobjects_list_get_pg_hash_position(rados_list_ctx_t ctx);
 
 /**
  * Reposition object iterator to a different hash position
@@ -847,7 +873,8 @@ uint32_t rados_nobjects_list_get_pg_hash_position(rados_list_ctx_t ctx);
  * @param pos hash position to move to
  * @returns actual (rounded) position we moved to
  */
-uint32_t rados_nobjects_list_seek(rados_list_ctx_t ctx, uint32_t pos);
+CEPH_RADOS_API uint32_t rados_nobjects_list_seek(rados_list_ctx_t ctx,
+                                                 uint32_t pos);
 
 /**
  * Get the next object name and locator in the pool
@@ -861,8 +888,10 @@ uint32_t rados_nobjects_list_seek(rados_list_ctx_t ctx, uint32_t pos);
  * @returns 0 on success, negative error code on failure
  * @returns -ENOENT when there are no more objects to list
  */
-int rados_nobjects_list_next(rados_list_ctx_t ctx, const char **entry,
-       const char **key, const char **nspace);
+CEPH_RADOS_API int rados_nobjects_list_next(rados_list_ctx_t ctx,
+                                            const char **entry,
+                                           const char **key,
+                                            const char **nspace);
 
 /**
  * Close the object listing handle.
@@ -872,7 +901,7 @@ int rados_nobjects_list_next(rados_list_ctx_t ctx, const char **entry,
  *
  * @param ctx the handle to close
  */
-void rados_nobjects_list_close(rados_list_ctx_t ctx);
+CEPH_RADOS_API void rados_nobjects_list_close(rados_list_ctx_t ctx);
 
 /** @} New Listing Objects */
 
@@ -885,27 +914,31 @@ void rados_nobjects_list_close(rados_list_ctx_t ctx);
 /**
  * @warning Deprecated: Use rados_nobjects_list_open() instead
  */
-int rados_objects_list_open(rados_ioctx_t io, rados_list_ctx_t *ctx);
+CEPH_RADOS_API int rados_objects_list_open(rados_ioctx_t io,
+                                           rados_list_ctx_t *ctx);
 
 /**
  * @warning Deprecated: Use rados_nobjects_list_get_pg_hash_position() instead
  */
-uint32_t rados_objects_list_get_pg_hash_position(rados_list_ctx_t ctx);
+CEPH_RADOS_API uint32_t rados_objects_list_get_pg_hash_position(rados_list_ctx_t ctx);
 
 /**
  * @warning Deprecated: Use rados_nobjects_list_seek() instead
  */
-uint32_t rados_objects_list_seek(rados_list_ctx_t ctx, uint32_t pos);
+CEPH_RADOS_API uint32_t rados_objects_list_seek(rados_list_ctx_t ctx,
+                                                uint32_t pos);
 
 /**
  * @warning Deprecated: Use rados_nobjects_list_next() instead
  */
-int rados_objects_list_next(rados_list_ctx_t ctx, const char **entry, const char **key);
+CEPH_RADOS_API int rados_objects_list_next(rados_list_ctx_t ctx,
+                                           const char **entry,
+                                           const char **key);
 
 /**
  * @warning Deprecated: Use rados_nobjects_list_close() instead
  */
-void rados_objects_list_close(rados_list_ctx_t ctx);
+CEPH_RADOS_API void rados_objects_list_close(rados_list_ctx_t ctx);
 
 /** @} Listing Objects */
 
@@ -945,7 +978,8 @@ void rados_objects_list_close(rados_list_ctx_t ctx);
  * @param snapname the name of the snapshot
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_snap_create(rados_ioctx_t io, const char *snapname);
+CEPH_RADOS_API int rados_ioctx_snap_create(rados_ioctx_t io,
+                                           const char *snapname);
 
 /**
  * Delete a pool snapshot
@@ -954,7 +988,8 @@ int rados_ioctx_snap_create(rados_ioctx_t io, const char *snapname);
  * @param snapname which snapshot to delete
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_snap_remove(rados_ioctx_t io, const char *snapname);
+CEPH_RADOS_API int rados_ioctx_snap_remove(rados_ioctx_t io,
+                                           const char *snapname);
 
 /**
  * Rollback an object to a pool snapshot
@@ -967,14 +1002,14 @@ int rados_ioctx_snap_remove(rados_ioctx_t io, const char *snapname);
  * @param snapname which snapshot to rollback to
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_snap_rollback(rados_ioctx_t io, const char *oid,
-                  const char *snapname);
+CEPH_RADOS_API int rados_ioctx_snap_rollback(rados_ioctx_t io, const char *oid,
+                                            const char *snapname);
 
 /**
  * @warning Deprecated: Use rados_ioctx_snap_rollback() instead
  */
-int rados_rollback(rados_ioctx_t io, const char *oid,
-                  const char *snapname);
+CEPH_RADOS_API int rados_rollback(rados_ioctx_t io, const char *oid,
+                                 const char *snapname);
 
 /**
  * Set the snapshot from which reads are performed.
@@ -986,7 +1021,8 @@ int rados_rollback(rados_ioctx_t io, const char *oid,
  * @param snap the id of the snapshot to set, or LIBRADOS_SNAP_HEAD for no
  * snapshot (i.e. normal operation)
  */
-void rados_ioctx_snap_set_read(rados_ioctx_t io, rados_snap_t snap);
+CEPH_RADOS_API void rados_ioctx_snap_set_read(rados_ioctx_t io,
+                                              rados_snap_t snap);
 
 /**
  * Allocate an ID for a self-managed snapshot
@@ -999,7 +1035,8 @@ void rados_ioctx_snap_set_read(rados_ioctx_t io, rados_snap_t snap);
  * @param snapid where to store the newly allocated snapshot ID
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_selfmanaged_snap_create(rados_ioctx_t io, rados_snap_t *snapid);
+CEPH_RADOS_API int rados_ioctx_selfmanaged_snap_create(rados_ioctx_t io,
+                                                       rados_snap_t *snapid);
 
 /**
  * Remove a self-managed snapshot
@@ -1011,7 +1048,8 @@ int rados_ioctx_selfmanaged_snap_create(rados_ioctx_t io, rados_snap_t *snapid);
  * @param snapid where to store the newly allocated snapshot ID
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_selfmanaged_snap_remove(rados_ioctx_t io, rados_snap_t snapid);
+CEPH_RADOS_API int rados_ioctx_selfmanaged_snap_remove(rados_ioctx_t io,
+                                                       rados_snap_t snapid);
 
 /**
  * Rollback an object to a self-managed snapshot
@@ -1024,7 +1062,9 @@ int rados_ioctx_selfmanaged_snap_remove(rados_ioctx_t io, rados_snap_t snapid);
  * @param snapid which snapshot to rollback to
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_selfmanaged_snap_rollback(rados_ioctx_t io, const char *oid, rados_snap_t snapid);
+CEPH_RADOS_API int rados_ioctx_selfmanaged_snap_rollback(rados_ioctx_t io,
+                                                         const char *oid,
+                                                         rados_snap_t snapid);
 
 /**
  * Set the snapshot context for use when writing to objects
@@ -1038,7 +1078,10 @@ int rados_ioctx_selfmanaged_snap_rollback(rados_ioctx_t io, const char *oid, rad
  * @returns 0 on success, negative error code on failure
  * @returns -EINVAL if snaps are not in descending order
  */
-int rados_ioctx_selfmanaged_snap_set_write_ctx(rados_ioctx_t io, rados_snap_t seq, rados_snap_t *snaps, int num_snaps);
+CEPH_RADOS_API int rados_ioctx_selfmanaged_snap_set_write_ctx(rados_ioctx_t io,
+                                                              rados_snap_t seq,
+                                                              rados_snap_t *snaps,
+                                                              int num_snaps);
 
 /**
  * List all the ids of pool snapshots
@@ -1053,7 +1096,8 @@ int rados_ioctx_selfmanaged_snap_set_write_ctx(rados_ioctx_t io, rados_snap_t se
  * @returns number of snapshots on success, negative error code on failure
  * @returns -ERANGE is returned if the snaps array is too short
  */
-int rados_ioctx_snap_list(rados_ioctx_t io, rados_snap_t *snaps, int maxlen);
+CEPH_RADOS_API int rados_ioctx_snap_list(rados_ioctx_t io, rados_snap_t *snaps,
+                                         int maxlen);
 
 /**
  * Get the id of a pool snapshot
@@ -1063,7 +1107,8 @@ int rados_ioctx_snap_list(rados_ioctx_t io, rados_snap_t *snaps, int maxlen);
  * @param id where to store the result
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_snap_lookup(rados_ioctx_t io, const char *name, rados_snap_t *id);
+CEPH_RADOS_API int rados_ioctx_snap_lookup(rados_ioctx_t io, const char *name,
+                                           rados_snap_t *id);
 
 /**
  * Get the name of a pool snapshot
@@ -1075,7 +1120,8 @@ int rados_ioctx_snap_lookup(rados_ioctx_t io, const char *name, rados_snap_t *id
  * @returns 0 on success, negative error code on failure
  * @returns -ERANGE if the name array is too small
  */
-int rados_ioctx_snap_get_name(rados_ioctx_t io, rados_snap_t id, char *name, int maxlen);
+CEPH_RADOS_API int rados_ioctx_snap_get_name(rados_ioctx_t io, rados_snap_t id,
+                                             char *name, int maxlen);
 
 /**
  * Find when a pool snapshot occurred
@@ -1085,7 +1131,8 @@ int rados_ioctx_snap_get_name(rados_ioctx_t io, rados_snap_t id, char *name, int
  * @param t where to store the result
  * @returns 0 on success, negative error code on failure
  */
-int rados_ioctx_snap_get_stamp(rados_ioctx_t io, rados_snap_t id, time_t *t);
+CEPH_RADOS_API int rados_ioctx_snap_get_stamp(rados_ioctx_t io, rados_snap_t id,
+                                              time_t *t);
 
 /** @} Snapshots */
 
@@ -1111,7 +1158,7 @@ int rados_ioctx_snap_get_stamp(rados_ioctx_t io, rados_snap_t id, time_t *t);
  * @param io the io context to check
  * @returns last read or written object version
  */
-uint64_t rados_get_last_version(rados_ioctx_t io);
+CEPH_RADOS_API uint64_t rados_get_last_version(rados_ioctx_t io);
 
 /**
  * Write *len* bytes from *buf* into the *oid* object, starting at
@@ -1125,7 +1172,8 @@ uint64_t rados_get_last_version(rados_ioctx_t io);
  * @param off byte offset in the object to begin writing at
  * @returns 0 on success, negative error code on failure
  */
-int rados_write(rados_ioctx_t io, const char *oid, const char *buf, size_t len, uint64_t off);
+CEPH_RADOS_API int rados_write(rados_ioctx_t io, const char *oid,
+                               const char *buf, size_t len, uint64_t off);
 
 /**
  * Write *len* bytes from *buf* into the *oid* object. The value of
@@ -1140,7 +1188,8 @@ int rados_write(rados_ioctx_t io, const char *oid, const char *buf, size_t len,
  * @param len length of the data, in bytes
  * @returns 0 on success, negative error code on failure
  */
-int rados_write_full(rados_ioctx_t io, const char *oid, const char *buf, size_t len);
+CEPH_RADOS_API int rados_write_full(rados_ioctx_t io, const char *oid,
+                                    const char *buf, size_t len);
 
 /**
  * Efficiently copy a portion of one object to another
@@ -1160,8 +1209,9 @@ int rados_write_full(rados_ioctx_t io, const char *oid, const char *buf, size_t
  * @param len how much data to copy
  * @returns 0 on success, negative error code on failure
  */
-int rados_clone_range(rados_ioctx_t io, const char *dst, uint64_t dst_off,
-                      const char *src, uint64_t src_off, size_t len);
+CEPH_RADOS_API int rados_clone_range(rados_ioctx_t io, const char *dst,
+                                     uint64_t dst_off, const char *src,
+                                     uint64_t src_off, size_t len);
 
 /**
  * Append *len* bytes from *buf* into the *oid* object. The value of
@@ -1173,7 +1223,8 @@ int rados_clone_range(rados_ioctx_t io, const char *dst, uint64_t dst_off,
  * @param len length of buf (in bytes)
  * @returns 0 on success, negative error code on failure
  */
-int rados_append(rados_ioctx_t io, const char *oid, const char *buf, size_t len);
+CEPH_RADOS_API int rados_append(rados_ioctx_t io, const char *oid,
+                                const char *buf, size_t len);
 
 /**
  * Read data from an object
@@ -1189,7 +1240,8 @@ int rados_append(rados_ioctx_t io, const char *oid, const char *buf, size_t len)
  * @returns number of bytes read on success, negative error code on
  * failure
  */
-int rados_read(rados_ioctx_t io, const char *oid, char *buf, size_t len, uint64_t off);
+CEPH_RADOS_API int rados_read(rados_ioctx_t io, const char *oid, char *buf,
+                              size_t len, uint64_t off);
 
 /**
  * Delete an object
@@ -1200,7 +1252,7 @@ int rados_read(rados_ioctx_t io, const char *oid, char *buf, size_t len, uint64_
  * @param oid the name of the object to delete
  * @returns 0 on success, negative error code on failure
  */
-int rados_remove(rados_ioctx_t io, const char *oid);
+CEPH_RADOS_API int rados_remove(rados_ioctx_t io, const char *oid);
 
 /**
  * Resize an object
@@ -1213,7 +1265,8 @@ int rados_remove(rados_ioctx_t io, const char *oid);
  * @param size the new size of the object in bytes
  * @returns 0 on success, negative error code on failure
  */
-int rados_trunc(rados_ioctx_t io, const char *oid, uint64_t size);
+CEPH_RADOS_API int rados_trunc(rados_ioctx_t io, const char *oid,
+                               uint64_t size);
 
 /**
  * @defgroup librados_h_xattrs Xattrs
@@ -1235,7 +1288,8 @@ int rados_trunc(rados_ioctx_t io, const char *oid, uint64_t size);
  * @param len size of buf in bytes
  * @returns length of xattr value on success, negative error code on failure
  */
-int rados_getxattr(rados_ioctx_t io, const char *o, const char *name, char *buf, size_t len);
+CEPH_RADOS_API int rados_getxattr(rados_ioctx_t io, const char *o,
+                                  const char *name, char *buf, size_t len);
 
 /**
  * Set an extended attribute on an object.
@@ -1247,7 +1301,9 @@ int rados_getxattr(rados_ioctx_t io, const char *o, const char *name, char *buf,
  * @param len the number of bytes in buf
  * @returns 0 on success, negative error code on failure
  */
-int rados_setxattr(rados_ioctx_t io, const char *o, const char *name, const char *buf, size_t len);
+CEPH_RADOS_API int rados_setxattr(rados_ioctx_t io, const char *o,
+                                  const char *name, const char *buf,
+                                  size_t len);
 
 /**
  * Delete an extended attribute from an object.
@@ -1257,7 +1313,8 @@ int rados_setxattr(rados_ioctx_t io, const char *o, const char *name, const char
  * @param name which xattr to delete
  * @returns 0 on success, negative error code on failure
  */
-int rados_rmxattr(rados_ioctx_t io, const char *o, const char *name);
+CEPH_RADOS_API int rados_rmxattr(rados_ioctx_t io, const char *o,
+                                 const char *name);
 
 /**
  * Start iterating over xattrs on an object.
@@ -1269,7 +1326,8 @@ int rados_rmxattr(rados_ioctx_t io, const char *o, const char *name);
  * @param iter where to store the iterator
  * @returns 0 on success, negative error code on failure
  */
-int rados_getxattrs(rados_ioctx_t io, const char *oid, rados_xattrs_iter_t *iter);
+CEPH_RADOS_API int rados_getxattrs(rados_ioctx_t io, const char *oid,
+                                   rados_xattrs_iter_t *iter);
 
 /**
  * Get the next xattr on the object
@@ -1286,8 +1344,9 @@ int rados_getxattrs(rados_ioctx_t io, const char *oid, rados_xattrs_iter_t *iter
  * @param len the number of bytes in val
  * @returns 0 on success, negative error code on failure
  */
-int rados_getxattrs_next(rados_xattrs_iter_t iter, const char **name,
-                        const char **val, size_t *len);
+CEPH_RADOS_API int rados_getxattrs_next(rados_xattrs_iter_t iter,
+                                        const char **name, const char **val,
+                                        size_t *len);
 
 /**
  * Close the xattr iterator.
@@ -1296,7 +1355,7 @@ int rados_getxattrs_next(rados_xattrs_iter_t iter, const char **name,
  *
  * @param iter the iterator to close
  */
-void rados_getxattrs_end(rados_xattrs_iter_t iter);
+CEPH_RADOS_API void rados_getxattrs_end(rados_xattrs_iter_t iter);
 
 /** @} Xattrs */
 
@@ -1317,10 +1376,10 @@ void rados_getxattrs_end(rados_xattrs_iter_t iter);
  * @param len where to store the number of bytes in val
  * @returns 0 on success, negative error code on failure
  */
-int rados_omap_get_next(rados_omap_iter_t iter,
-                       char **key,
-                       char **val,
-                       size_t *len);
+CEPH_RADOS_API int rados_omap_get_next(rados_omap_iter_t iter,
+                                      char **key,
+                                      char **val,
+                                      size_t *len);
 
 /**
  * Close the omap iterator.
@@ -1329,7 +1388,7 @@ int rados_omap_get_next(rados_omap_iter_t iter,
  *
  * @param iter the iterator to close
  */
-void rados_omap_get_end(rados_omap_iter_t iter);
+CEPH_RADOS_API void rados_omap_get_end(rados_omap_iter_t iter);
 
 /**
  * Get object stats (size/mtime)
@@ -1342,7 +1401,8 @@ void rados_omap_get_end(rados_omap_iter_t iter);
  * @param pmtime where to store modification time
  * @returns 0 on success, negative error code on failure
  */
-int rados_stat(rados_ioctx_t io, const char *o, uint64_t *psize, time_t *pmtime);
+CEPH_RADOS_API int rados_stat(rados_ioctx_t io, const char *o, uint64_t *psize,
+                              time_t *pmtime);
 
 /**
  * Update tmap (trivial map)
@@ -1390,7 +1450,8 @@ int rados_stat(rados_ioctx_t io, const char *o, uint64_t *psize, time_t *pmtime)
  * @param cmdbuflen command buffer length in bytes
  * @returns 0 on success, negative error code on failure
  */
-int rados_tmap_update(rados_ioctx_t io, const char *o, const char *cmdbuf, size_t cmdbuflen);
+CEPH_RADOS_API int rados_tmap_update(rados_ioctx_t io, const char *o,
+                                     const char *cmdbuf, size_t cmdbuflen);
 
 /**
  * Store complete tmap (trivial map) object
@@ -1414,7 +1475,8 @@ int rados_tmap_update(rados_ioctx_t io, const char *o, const char *cmdbuf, size_
  * @param buflen buffer length in bytes
  * @returns 0 on success, negative error code on failure
  */
-int rados_tmap_put(rados_ioctx_t io, const char *o, const char *buf, size_t buflen);
+CEPH_RADOS_API int rados_tmap_put(rados_ioctx_t io, const char *o,
+                                  const char *buf, size_t buflen);
 
 /**
  * Fetch complete tmap (trivial map) object
@@ -1429,7 +1491,8 @@ int rados_tmap_put(rados_ioctx_t io, const char *o, const char *buf, size_t bufl
  * @returns 0 on success, negative error code on failure
  * @returns -ERANGE if buf isn't big enough
  */
-int rados_tmap_get(rados_ioctx_t io, const char *o, char *buf, size_t buflen);
+CEPH_RADOS_API int rados_tmap_get(rados_ioctx_t io, const char *o, char *buf,
+                                  size_t buflen);
 
 /**
  * Execute an OSD class method on an object
@@ -1453,8 +1516,10 @@ int rados_tmap_get(rados_ioctx_t io, const char *o, char *buf, size_t buflen);
  * methods that don't return data, the return value is
  * method-specific.
  */
-int rados_exec(rados_ioctx_t io, const char *oid, const char *cls, const char *method,
-              const char *in_buf, size_t in_len, char *buf, size_t out_len);
+CEPH_RADOS_API int rados_exec(rados_ioctx_t io, const char *oid,
+                              const char *cls, const char *method,
+                             const char *in_buf, size_t in_len, char *buf,
+                              size_t out_len);
 
 
 /** @} Synchronous I/O */
@@ -1504,8 +1569,10 @@ typedef void (*rados_callback_t)(rados_completion_t cb, void *arg);
  * @param pc where to store the completion
  * @returns 0
  */
-int rados_aio_create_completion(void *cb_arg, rados_callback_t cb_complete, rados_callback_t cb_safe,
-                               rados_completion_t *pc);
+CEPH_RADOS_API int rados_aio_create_completion(void *cb_arg,
+                                               rados_callback_t cb_complete,
+                                               rados_callback_t cb_safe,
+                                              rados_completion_t *pc);
 
 /**
  * Block until an operation completes
@@ -1517,7 +1584,7 @@ int rados_aio_create_completion(void *cb_arg, rados_callback_t cb_complete, rado
  * @param c operation to wait for
  * @returns 0
  */
-int rados_aio_wait_for_complete(rados_completion_t c);
+CEPH_RADOS_API int rados_aio_wait_for_complete(rados_completion_t c);
 
 /**
  * Block until an operation is safe
@@ -1529,7 +1596,7 @@ int rados_aio_wait_for_complete(rados_completion_t c);
  * @param c operation to wait for
  * @returns 0
  */
-int rados_aio_wait_for_safe(rados_completion_t c);
+CEPH_RADOS_API int rados_aio_wait_for_safe(rados_completion_t c);
 
 /**
  * Has an asynchronous operation completed?
@@ -1540,7 +1607,7 @@ int rados_aio_wait_for_safe(rados_completion_t c);
  * @param c async operation to inspect
  * @returns whether c is complete
  */
-int rados_aio_is_complete(rados_completion_t c);
+CEPH_RADOS_API int rados_aio_is_complete(rados_completion_t c);
 
 /**
  * Is an asynchronous operation safe?
@@ -1551,7 +1618,7 @@ int rados_aio_is_complete(rados_completion_t c);
  * @param c async operation to inspect
  * @returns whether c is safe
  */
-int rados_aio_is_safe(rados_completion_t c);
+CEPH_RADOS_API int rados_aio_is_safe(rados_completion_t c);
 
 /**
  * Block until an operation completes and callback completes
@@ -1563,7 +1630,7 @@ int rados_aio_is_safe(rados_completion_t c);
  * @param c operation to wait for
  * @returns 0
  */
-int rados_aio_wait_for_complete_and_cb(rados_completion_t c);
+CEPH_RADOS_API int rados_aio_wait_for_complete_and_cb(rados_completion_t c);
 
 /**
  * Block until an operation is safe and callback has completed
@@ -1575,7 +1642,7 @@ int rados_aio_wait_for_complete_and_cb(rados_completion_t c);
  * @param c operation to wait for
  * @returns 0
  */
-int rados_aio_wait_for_safe_and_cb(rados_completion_t c);
+CEPH_RADOS_API int rados_aio_wait_for_safe_and_cb(rados_completion_t c);
 
 /**
  * Has an asynchronous operation and callback completed
@@ -1583,7 +1650,7 @@ int rados_aio_wait_for_safe_and_cb(rados_completion_t c);
  * @param c async operation to inspect
  * @returns whether c is complete
  */
-int rados_aio_is_complete_and_cb(rados_completion_t c);
+CEPH_RADOS_API int rados_aio_is_complete_and_cb(rados_completion_t c);
 
 /**
  * Is an asynchronous operation safe and has the callback completed
@@ -1591,7 +1658,7 @@ int rados_aio_is_complete_and_cb(rados_completion_t c);
  * @param c async operation to inspect
  * @returns whether c is safe
  */
-int rados_aio_is_safe_and_cb(rados_completion_t c);
+CEPH_RADOS_API int rados_aio_is_safe_and_cb(rados_completion_t c);
 
 /**
  * Get the return value of an asychronous operation
@@ -1607,7 +1674,7 @@ int rados_aio_is_safe_and_cb(rados_completion_t c);
  * @param c async operation to inspect
  * @returns return value of the operation
  */
-int rados_aio_get_return_value(rados_completion_t c);
+CEPH_RADOS_API int rados_aio_get_return_value(rados_completion_t c);
 
 /**
  * Release a completion
@@ -1617,7 +1684,7 @@ int rados_aio_get_return_value(rados_completion_t c);
  *
  * @param c completion to release
  */
-void rados_aio_release(rados_completion_t c);
+CEPH_RADOS_API void rados_aio_release(rados_completion_t c);
 
 /**
  * Write data to an object asynchronously
@@ -1634,9 +1701,9 @@ void rados_aio_release(rados_completion_t c);
  * @returns 0 on success, -EROFS if the io context specifies a snap_seq
  * other than LIBRADOS_SNAP_HEAD
  */
-int rados_aio_write(rados_ioctx_t io, const char *oid,
-                   rados_completion_t completion,
-                   const char *buf, size_t len, uint64_t off);
+CEPH_RADOS_API int rados_aio_write(rados_ioctx_t io, const char *oid,
+                                  rados_completion_t completion,
+                                  const char *buf, size_t len, uint64_t off);
 
 /**
  * Asychronously append data to an object
@@ -1654,9 +1721,9 @@ int rados_aio_write(rados_ioctx_t io, const char *oid,
  * @returns 0 on success, -EROFS if the io context specifies a snap_seq
  * other than LIBRADOS_SNAP_HEAD
  */
-int rados_aio_append(rados_ioctx_t io, const char *oid,
-                    rados_completion_t completion,
-                    const char *buf, size_t len);
+CEPH_RADOS_API int rados_aio_append(rados_ioctx_t io, const char *oid,
+                                   rados_completion_t completion,
+                                   const char *buf, size_t len);
 
 /**
  * Asychronously write an entire object
@@ -1676,9 +1743,9 @@ int rados_aio_append(rados_ioctx_t io, const char *oid,
  * @returns 0 on success, -EROFS if the io context specifies a snap_seq
  * other than LIBRADOS_SNAP_HEAD
  */
-int rados_aio_write_full(rados_ioctx_t io, const char *oid,
-                        rados_completion_t completion,
-                        const char *buf, size_t len);
+CEPH_RADOS_API int rados_aio_write_full(rados_ioctx_t io, const char *oid,
+                                       rados_completion_t completion,
+                                       const char *buf, size_t len);
 
 /**
  * Asychronously remove an object
@@ -1694,8 +1761,8 @@ int rados_aio_write_full(rados_ioctx_t io, const char *oid,
  * @returns 0 on success, -EROFS if the io context specifies a snap_seq
  * other than LIBRADOS_SNAP_HEAD
  */
-int rados_aio_remove(rados_ioctx_t io, const char *oid,
-                    rados_completion_t completion);
+CEPH_RADOS_API int rados_aio_remove(rados_ioctx_t io, const char *oid,
+                                   rados_completion_t completion);
 
 /**
  * Asychronously read data from an object
@@ -1716,9 +1783,9 @@ int rados_aio_remove(rados_ioctx_t io, const char *oid,
  * @param off the offset to start reading from in the object
  * @returns 0 on success, negative error code on failure
  */
-int rados_aio_read(rados_ioctx_t io, const char *oid,
-                  rados_completion_t completion,
-                  char *buf, size_t len, uint64_t off);
+CEPH_RADOS_API int rados_aio_read(rados_ioctx_t io, const char *oid,
+                                 rados_completion_t completion,
+                                 char *buf, size_t len, uint64_t off);
 
 /**
  * Block until all pending writes in an io context are safe
@@ -1732,7 +1799,7 @@ int rados_aio_read(rados_ioctx_t io, const char *oid,
  * @param io the context to flush
  * @returns 0 on success, negative error code on failure
  */
-int rados_aio_flush(rados_ioctx_t io);
+CEPH_RADOS_API int rados_aio_flush(rados_ioctx_t io);
 
 
 /**
@@ -1744,7 +1811,8 @@ int rados_aio_flush(rados_ioctx_t io);
  * @param completion what to do when the writes are safe
  * @returns 0 on success, negative error code on failure
  */
-int rados_aio_flush_async(rados_ioctx_t io, rados_completion_t completion);
+CEPH_RADOS_API int rados_aio_flush_async(rados_ioctx_t io,
+                                         rados_completion_t completion);
 
 
 /**
@@ -1756,9 +1824,9 @@ int rados_aio_flush_async(rados_ioctx_t io, rados_completion_t completion);
  * @param pmtime where to store modification time
  * @returns 0 on success, negative error code on failure
  */
-int rados_aio_stat(rados_ioctx_t io, const char *o,
-                  rados_completion_t completion,
-                  uint64_t *psize, time_t *pmtime);
+CEPH_RADOS_API int rados_aio_stat(rados_ioctx_t io, const char *o,
+                                 rados_completion_t completion,
+                                 uint64_t *psize, time_t *pmtime);
 
 /**
  * Cancel async operation
@@ -1767,7 +1835,8 @@ int rados_aio_stat(rados_ioctx_t io, const char *o,
  * @param completion completion handle
  * @returns 0 on success, negative error code on failure
  */
-int rados_aio_cancel(rados_ioctx_t io, rados_completion_t completion);
+CEPH_RADOS_API int rados_aio_cancel(rados_ioctx_t io,
+                                    rados_completion_t completion);
 
 /** @} Asynchronous I/O */
 
@@ -1827,8 +1896,9 @@ typedef void (*rados_watchcb_t)(uint8_t opcode, uint64_t ver, void *arg);
  * @returns 0 on success, negative error code on failure
  * @returns -ERANGE if the version of the object is greater than ver
  */
-int rados_watch(rados_ioctx_t io, const char *o, uint64_t ver, uint64_t *handle,
-                rados_watchcb_t watchcb, void *arg);
+CEPH_RADOS_API int rados_watch(rados_ioctx_t io, const char *o, uint64_t ver,
+                               uint64_t *handle, rados_watchcb_t watchcb,
+                               void *arg);
 
 /**
  * Unregister an interest in an object
@@ -1841,7 +1911,8 @@ int rados_watch(rados_ioctx_t io, const char *o, uint64_t ver, uint64_t *handle,
  * @param handle which watch to unregister
  * @returns 0 on success, negative error code on failure
  */
-int rados_unwatch(rados_ioctx_t io, const char *o, uint64_t handle);
+CEPH_RADOS_API int rados_unwatch(rados_ioctx_t io, const char *o,
+                                 uint64_t handle);
 
 /**
  * Sychronously notify watchers of an object
@@ -1859,7 +1930,8 @@ int rados_unwatch(rados_ioctx_t io, const char *o, uint64_t handle);
  * @param buf_len length of buf in bytes
  * @returns 0 on success, negative error code on failure
  */
-int rados_notify(rados_ioctx_t io, const char *o, uint64_t ver, const char *buf, int buf_len);
+CEPH_RADOS_API int rados_notify(rados_ioctx_t io, const char *o, uint64_t ver,
+                                const char *buf, int buf_len);
 
 /** @} Watch/Notify */
 
@@ -1882,9 +1954,9 @@ int rados_notify(rados_ioctx_t io, const char *o, uint64_t ver, const char *buf,
  * @param expected_write_size expected size of writes to the object, in bytes
  * @returns 0 on success, negative error code on failure
  */
-int rados_set_alloc_hint(rados_ioctx_t io, const char *o,
-                         uint64_t expected_object_size,
-                         uint64_t expected_write_size);
+CEPH_RADOS_API int rados_set_alloc_hint(rados_ioctx_t io, const char *o,
+                                        uint64_t expected_object_size,
+                                        uint64_t expected_write_size);
 
 /** @} Hints */
 
@@ -1910,26 +1982,27 @@ int rados_set_alloc_hint(rados_ioctx_t io, const char *o,
  *
  * @returns non-NULL on success, NULL on memory allocation error.
  */
-rados_write_op_t rados_create_write_op(void);
+CEPH_RADOS_API rados_write_op_t rados_create_write_op(void);
 
 /**
  * Free a rados_write_op_t, must be called when you're done with it.
  * @param write_op operation to deallocate, created with rados_create_write_op
  */
-void rados_release_write_op(rados_write_op_t write_op);
+CEPH_RADOS_API void rados_release_write_op(rados_write_op_t write_op);
 
 /**
  * Set flags for the last operation added to this write_op.
  * At least one op must have been added to the write_op.
  * @param flags see librados.h constants beginning with LIBRADOS_OP_FLAG
  */
-void rados_write_op_set_flags(rados_write_op_t write_op, int flags);
+CEPH_RADOS_API void rados_write_op_set_flags(rados_write_op_t write_op,
+                                             int flags);
 
 /**
  * Ensure that the object exists before writing
  * @param write_op operation to add this action to
  */
-void rados_write_op_assert_exists(rados_write_op_t write_op);
+CEPH_RADOS_API void rados_write_op_assert_exists(rados_write_op_t write_op);
 
 /**
  * Ensure that given xattr satisfies comparison.
@@ -1942,11 +2015,11 @@ void rados_write_op_assert_exists(rados_write_op_t write_op);
  * @param value buffer to compare actual xattr value to
  * @param value_len length of buffer to compare actual xattr value to
  */
-void rados_write_op_cmpxattr(rados_write_op_t write_op,
-                             const char *name,
-                             uint8_t comparison_operator,
-                             const char *value,
-                             size_t value_len);
+CEPH_RADOS_API void rados_write_op_cmpxattr(rados_write_op_t write_op,
+                                            const char *name,
+                                            uint8_t comparison_operator,
+                                            const char *value,
+                                            size_t value_len);
 
 /**
  * Ensure that the an omap value satisfies a comparison,
@@ -1961,12 +2034,12 @@ void rados_write_op_cmpxattr(rados_write_op_t write_op,
  * @param val_len length of value in bytes
  * @param prval where to store the return value from this action
  */
-void rados_write_op_omap_cmp(rados_write_op_t write_op,
-                            const char *key,
-                            uint8_t comparison_operator,
-                            const char *val,
-                            size_t val_len,
-                            int *prval);
+CEPH_RADOS_API void rados_write_op_omap_cmp(rados_write_op_t write_op,
+                                           const char *key,
+                                           uint8_t comparison_operator,
+                                           const char *val,
+                                           size_t val_len,
+                                           int *prval);
 
 /**
  * Set an xattr
@@ -1975,17 +2048,18 @@ void rados_write_op_omap_cmp(rados_write_op_t write_op,
  * @param value buffer to set xattr to
  * @param value_len length of buffer to set xattr to
  */
-void rados_write_op_setxattr(rados_write_op_t write_op,
-                             const char *name,
-                             const char *value,
-                             size_t value_len);
+CEPH_RADOS_API void rados_write_op_setxattr(rados_write_op_t write_op,
+                                            const char *name,
+                                            const char *value,
+                                            size_t value_len);
 
 /**
  * Remove an xattr
  * @param write_op operation to add this action to
  * @param name name of the xattr to remove
  */
-void rados_write_op_rmxattr(rados_write_op_t write_op, const char *name);
+CEPH_RADOS_API void rados_write_op_rmxattr(rados_write_op_t write_op,
+                                           const char *name);
 
 /**
  * Create the object
@@ -1994,9 +2068,9 @@ void rados_write_op_rmxattr(rados_write_op_t write_op, const char *name);
    LIBRADOS_CREATE_IDEMPOTENT
  * will error if the object already exists.
  */
-void rados_write_op_create(rados_write_op_t write_op,
-                           int exclusive,
-                           const char* category);
+CEPH_RADOS_API void rados_write_op_create(rados_write_op_t write_op,
+                                          int exclusive,
+                                          const char* category);
 
 /**
  * Write to offset
@@ -2005,10 +2079,10 @@ void rados_write_op_create(rados_write_op_t write_op,
  * @param buffer bytes to write
  * @param len length of buffer
  */
-void rados_write_op_write(rados_write_op_t write_op,
-                          const char *buffer,
-                          size_t len,
-                          uint64_t offset);
+CEPH_RADOS_API void rados_write_op_write(rados_write_op_t write_op,
+                                         const char *buffer,
+                                         size_t len,
+                                         uint64_t offset);
 
 /**
  * Write whole object, atomically replacing it.
@@ -2016,9 +2090,9 @@ void rados_write_op_write(rados_write_op_t write_op,
  * @param buffer bytes to write
  * @param len length of buffer
  */
-void rados_write_op_write_full(rados_write_op_t write_op,
-                               const char *buffer,
-                               size_t len);
+CEPH_RADOS_API void rados_write_op_write_full(rados_write_op_t write_op,
+                                              const char *buffer,
+                                              size_t len);
 
 /**
  * Append to end of object.
@@ -2026,21 +2100,22 @@ void rados_write_op_write_full(rados_write_op_t write_op,
  * @param buffer bytes to write
  * @param len length of buffer
  */
-void rados_write_op_append(rados_write_op_t write_op,
-                           const char *buffer,
-                           size_t len);
+CEPH_RADOS_API void rados_write_op_append(rados_write_op_t write_op,
+                                          const char *buffer,
+                                          size_t len);
 /**
  * Remove object
  * @param write_op operation to add this action to
  */
-void rados_write_op_remove(rados_write_op_t write_op);
+CEPH_RADOS_API void rados_write_op_remove(rados_write_op_t write_op);
 
 /**
  * Truncate an object
  * @param write_op operation to add this action to
  * @offset Offset to truncate to
  */
-void rados_write_op_truncate(rados_write_op_t write_op, uint64_t offset);
+CEPH_RADOS_API void rados_write_op_truncate(rados_write_op_t write_op,
+                                            uint64_t offset);
 
 /**
  * Zero part of an object
@@ -2048,9 +2123,9 @@ void rados_write_op_truncate(rados_write_op_t write_op, uint64_t offset);
  * @offset Offset to zero
  * @len length to zero
  */
-void rados_write_op_zero(rados_write_op_t write_op,
-                        uint64_t offset,
-                        uint64_t len);
+CEPH_RADOS_API void rados_write_op_zero(rados_write_op_t write_op,
+                                       uint64_t offset,
+                                       uint64_t len);
 
 /**
  * Execute an OSD class method on an object
@@ -2063,12 +2138,12 @@ void rados_write_op_zero(rados_write_op_t write_op,
  * @param in_len length of in_buf in bytes
  * @param prval where to store the return value from the method
  */
-void rados_write_op_exec(rados_write_op_t write_op,
-                        const char *cls,
-                        const char *method,
-                        const char *in_buf,
-                        size_t in_len,
-                        int *prval);
+CEPH_RADOS_API void rados_write_op_exec(rados_write_op_t write_op,
+                                       const char *cls,
+                                       const char *method,
+                                       const char *in_buf,
+                                       size_t in_len,
+                                       int *prval);
 
 /**
  * Set key/value pairs on an object
@@ -2079,11 +2154,11 @@ void rados_write_op_exec(rados_write_op_t write_op,
  * @param lens array of lengths corresponding to each value
  * @param num number of key/value pairs to set
  */
-void rados_write_op_omap_set(rados_write_op_t write_op,
-                            char const* const* keys,
-                            char const* const* vals,
-                            const size_t *lens,
-                            size_t num);
+CEPH_RADOS_API void rados_write_op_omap_set(rados_write_op_t write_op,
+                                           char const* const* keys,
+                                           char const* const* vals,
+                                           const size_t *lens,
+                                           size_t num);
 
 /**
  * Remove key/value pairs from an object
@@ -2092,16 +2167,16 @@ void rados_write_op_omap_set(rados_write_op_t write_op,
  * @param keys array of null-terminated char arrays representing keys to remove
  * @param keys_len number of key/value pairs to remove
  */
-void rados_write_op_omap_rm_keys(rados_write_op_t write_op,
-                                char const* const* keys,
-                                size_t keys_len);
+CEPH_RADOS_API void rados_write_op_omap_rm_keys(rados_write_op_t write_op,
+                                               char const* const* keys,
+                                               size_t keys_len);
 
 /**
  * Remove all key/value pairs from an object
  *
  * @param write_op operation to add this action to
  */
-void rados_write_op_omap_clear(rados_write_op_t write_op);
+CEPH_RADOS_API void rados_write_op_omap_clear(rados_write_op_t write_op);
 
 /**
  * Set allocation hint for an object
@@ -2110,9 +2185,9 @@ void rados_write_op_omap_clear(rados_write_op_t write_op);
  * @param expected_object_size expected size of the object, in bytes
  * @param expected_write_size expected size of writes to the object, in bytes
  */
-void rados_write_op_set_alloc_hint(rados_write_op_t write_op,
-                                   uint64_t expected_object_size,
-                                   uint64_t expected_write_size);
+CEPH_RADOS_API void rados_write_op_set_alloc_hint(rados_write_op_t write_op,
+                                                  uint64_t expected_object_size,
+                                                  uint64_t expected_write_size);
 
 /**
  * Perform a write operation synchronously
@@ -2122,11 +2197,11 @@ void rados_write_op_set_alloc_hint(rados_write_op_t write_op,
  * @param mtime the time to set the mtime to, NULL for the current time
  * @param flags flags to apply to the entire operation (LIBRADOS_OPERATION_*)
  */
-int rados_write_op_operate(rados_write_op_t write_op,
-                          rados_ioctx_t io,
-                          const char *oid,
-                          time_t *mtime,
-                          int flags);
+CEPH_RADOS_API int rados_write_op_operate(rados_write_op_t write_op,
+                                         rados_ioctx_t io,
+                                         const char *oid,
+                                         time_t *mtime,
+                                         int flags);
 /**
  * Perform a write operation asynchronously
  * @param write_op operation to perform
@@ -2136,12 +2211,12 @@ int rados_write_op_operate(rados_write_op_t write_op,
  * @param mtime the time to set the mtime to, NULL for the current time
  * @param flags flags to apply to the entire operation (LIBRADOS_OPERATION_*)
  */
-int rados_aio_write_op_operate(rados_write_op_t write_op,
-                               rados_ioctx_t io,
-                               rados_completion_t completion,
-                               const char *oid,
-                               time_t *mtime,
-                              int flags);
+CEPH_RADOS_API int rados_aio_write_op_operate(rados_write_op_t write_op,
+                                              rados_ioctx_t io,
+                                              rados_completion_t completion,
+                                              const char *oid,
+                                              time_t *mtime,
+                                             int flags);
 
 /**
  * Create a new rados_read_op_t write operation. This will store all
@@ -2151,26 +2226,26 @@ int rados_aio_write_op_operate(rados_write_op_t write_op,
  *
  * @returns non-NULL on success, NULL on memory allocation error.
  */
-rados_read_op_t rados_create_read_op(void);
+CEPH_RADOS_API rados_read_op_t rados_create_read_op(void);
 
 /**
  * Free a rados_read_op_t, must be called when you're done with it.
  * @param read_op operation to deallocate, created with rados_create_read_op
  */
-void rados_release_read_op(rados_read_op_t read_op);
+CEPH_RADOS_API void rados_release_read_op(rados_read_op_t read_op);
 
 /**
  * Set flags for the last operation added to this read_op.
  * At least one op must have been added to the read_op.
  * @param flags see librados.h constants beginning with LIBRADOS_OP_FLAG
  */
-void rados_read_op_set_flags(rados_read_op_t read_op, int flags);
+CEPH_RADOS_API void rados_read_op_set_flags(rados_read_op_t read_op, int flags);
 
 /**
  * Ensure that the object exists before reading
  * @param read_op operation to add this action to
  */
-void rados_read_op_assert_exists(rados_read_op_t read_op);
+CEPH_RADOS_API void rados_read_op_assert_exists(rados_read_op_t read_op);
 
 /**
  * Ensure that the an xattr satisfies a comparison
@@ -2183,11 +2258,11 @@ void rados_read_op_assert_exists(rados_read_op_t read_op);
  * @param value buffer to compare actual xattr value to
  * @param value_len length of buffer to compare actual xattr value to
  */
-void rados_read_op_cmpxattr(rados_read_op_t read_op,
-                           const char *name,
-                           uint8_t comparison_operator,
-                           const char *value,
-                           size_t value_len);
+CEPH_RADOS_API void rados_read_op_cmpxattr(rados_read_op_t read_op,
+                                          const char *name,
+                                          uint8_t comparison_operator,
+                                          const char *value,
+                                          size_t value_len);
 
 /**
  * Start iterating over xattrs on an object.
@@ -2196,9 +2271,9 @@ void rados_read_op_cmpxattr(rados_read_op_t read_op,
  * @param iter where to store the iterator
  * @param prval where to store the return value of this action
  */
-void rados_read_op_getxattrs(rados_read_op_t read_op,
-                            rados_xattrs_iter_t *iter,
-                            int *prval);
+CEPH_RADOS_API void rados_read_op_getxattrs(rados_read_op_t read_op,
+                                           rados_xattrs_iter_t *iter,
+                                           int *prval);
 
 /**
  * Ensure that the an omap value satisfies a comparison,
@@ -2213,12 +2288,12 @@ void rados_read_op_getxattrs(rados_read_op_t read_op,
  * @param val_len length of value in bytes
  * @param prval where to store the return value from this action
  */
-void rados_read_op_omap_cmp(rados_read_op_t read_op,
-                           const char *key,
-                           uint8_t comparison_operator,
-                           const char *val,
-                           size_t val_len,
-                           int *prval);
+CEPH_RADOS_API void rados_read_op_omap_cmp(rados_read_op_t read_op,
+                                          const char *key,
+                                          uint8_t comparison_operator,
+                                          const char *val,
+                                          size_t val_len,
+                                          int *prval);
 
 /**
  * Get object size and mtime
@@ -2227,10 +2302,10 @@ void rados_read_op_omap_cmp(rados_read_op_t read_op,
  * @param pmtime where to store modification time
  * @param prval where to store the return value of this action
  */
-void rados_read_op_stat(rados_read_op_t read_op,
-                       uint64_t *psize,
-                       time_t *pmtime,
-                       int *prval);
+CEPH_RADOS_API void rados_read_op_stat(rados_read_op_t read_op,
+                                      uint64_t *psize,
+                                      time_t *pmtime,
+                                      int *prval);
 
 /**
  * Read bytes from offset into buffer.
@@ -2246,12 +2321,12 @@ void rados_read_op_stat(rados_read_op_t read_op,
  * @param prval where to store the return value of this action
  * @param bytes_read where to store the number of bytes read by this action
  */
-void rados_read_op_read(rados_read_op_t read_op,
-                       uint64_t offset,
-                       size_t len,
-                       char *buf,
-                       size_t *bytes_read,
-                       int *prval);
+CEPH_RADOS_API void rados_read_op_read(rados_read_op_t read_op,
+                                      uint64_t offset,
+                                      size_t len,
+                                      char *buf,
+                                      size_t *bytes_read,
+                                      int *prval);
 
 /**
  * Execute an OSD class method on an object
@@ -2271,14 +2346,14 @@ void rados_read_op_read(rados_read_op_t read_op,
  * @param out_len length of out_buf in bytes
  * @param prval where to store the return value from the method
  */
-void rados_read_op_exec(rados_read_op_t read_op,
-                       const char *cls,
-                       const char *method,
-                       const char *in_buf,
-                       size_t in_len,
-                       char **out_buf,
-                       size_t *out_len,
-                       int *prval);
+CEPH_RADOS_API void rados_read_op_exec(rados_read_op_t read_op,
+                                      const char *cls,
+                                      const char *method,
+                                      const char *in_buf,
+                                      size_t in_len,
+                                      char **out_buf,
+                                      size_t *out_len,
+                                      int *prval);
 
 /**
  * Execute an OSD class method on an object
@@ -2297,15 +2372,15 @@ void rados_read_op_exec(rados_read_op_t read_op,
  * @param used_len where to store the number of bytes read into out_buf
  * @param prval where to store the return value from the method
  */
-void rados_read_op_exec_user_buf(rados_read_op_t read_op,
-                                const char *cls,
-                                const char *method,
-                                const char *in_buf,
-                                size_t in_len,
-                                char *out_buf,
-                                size_t out_len,
-                                size_t *used_len,
-                                int *prval);
+CEPH_RADOS_API void rados_read_op_exec_user_buf(rados_read_op_t read_op,
+                                               const char *cls,
+                                               const char *method,
+                                               const char *in_buf,
+                                               size_t in_len,
+                                               char *out_buf,
+                                               size_t out_len,
+                                               size_t *used_len,
+                                               int *prval);
 
 /**
  * Start iterating over key/value pairs on an object.
@@ -2319,12 +2394,12 @@ void rados_read_op_exec_user_buf(rados_read_op_t read_op,
  * @param iter where to store the iterator
  * @param prval where to store the return value from this action
  */
-void rados_read_op_omap_get_vals(rados_read_op_t read_op,
-                                const char *start_after,
-                                const char *filter_prefix,
-                                uint64_t max_return,
-                                rados_omap_iter_t *iter,
-                                int *prval);
+CEPH_RADOS_API void rados_read_op_omap_get_vals(rados_read_op_t read_op,
+                                               const char *start_after,
+                                               const char *filter_prefix,
+                                               uint64_t max_return,
+                                               rados_omap_iter_t *iter,
+                                               int *prval);
 
 /**
  * Start iterating over keys on an object.
@@ -2338,11 +2413,11 @@ void rados_read_op_omap_get_vals(rados_read_op_t read_op,
  * @param iter where to store the iterator
  * @param prval where to store the return value from this action
  */
-void rados_read_op_omap_get_keys(rados_read_op_t read_op,
-                                const char *start_after,
-                                uint64_t max_return,
-                                rados_omap_iter_t *iter,
-                                int *prval);
+CEPH_RADOS_API void rados_read_op_omap_get_keys(rados_read_op_t read_op,
+                                               const char *start_after,
+                                               uint64_t max_return,
+                                               rados_omap_iter_t *iter,
+                                               int *prval);
 
 /**
  * Start iterating over specific key/value pairs
@@ -2355,11 +2430,11 @@ void rados_read_op_omap_get_keys(rados_read_op_t read_op,
  * @param iter where to store the iterator
  * @param prval where to store the return value from this action
  */
-void rados_read_op_omap_get_vals_by_keys(rados_read_op_t read_op,
-                                        char const* const* keys,
-                                        size_t keys_len,
-                                        rados_omap_iter_t *iter,
-                                        int *prval);
+CEPH_RADOS_API void rados_read_op_omap_get_vals_by_keys(rados_read_op_t read_op,
+                                                       char const* const* keys,
+                                                       size_t keys_len,
+                                                       rados_omap_iter_t *iter,
+                                                       int *prval);
 
 /**
  * Perform a read operation synchronously
@@ -2368,10 +2443,10 @@ void rados_read_op_omap_get_vals_by_keys(rados_read_op_t read_op,
  * @oid the object id
  * @flags flags to apply to the entire operation (LIBRADOS_OPERATION_*)
  */
-int rados_read_op_operate(rados_read_op_t read_op,
-                         rados_ioctx_t io,
-                         const char *oid,
-                         int flags);
+CEPH_RADOS_API int rados_read_op_operate(rados_read_op_t read_op,
+                                        rados_ioctx_t io,
+                                        const char *oid,
+                                        int flags);
 
 /**
  * Perform a read operation asynchronously
@@ -2381,11 +2456,11 @@ int rados_read_op_operate(rados_read_op_t read_op,
  * @oid the object id
  * @flags flags to apply to the entire operation (LIBRADOS_OPERATION_*)
  */
-int rados_aio_read_op_operate(rados_read_op_t read_op,
-                             rados_ioctx_t io,
-                             rados_completion_t completion,
-                             const char *oid,
-                             int flags);
+CEPH_RADOS_API int rados_aio_read_op_operate(rados_read_op_t read_op,
+                                            rados_ioctx_t io,
+                                            rados_completion_t completion,
+                                            const char *oid,
+                                            int flags);
 
 /** @} Object Operations */
 
@@ -2403,9 +2478,11 @@ int rados_aio_read_op_operate(rados_read_op_t read_op,
  * @returns -EBUSY if the lock is already held by another (client, cookie) pair
  * @returns -EEXIST if the lock is already held by the same (client, cookie) pair
  */
-int rados_lock_exclusive(rados_ioctx_t io, const char * o, const char * name,
-              const char * cookie, const char * desc, struct timeval * duration,
-              uint8_t flags);
+CEPH_RADOS_API int rados_lock_exclusive(rados_ioctx_t io, const char * o,
+                                        const char * name, const char * cookie,
+                                        const char * desc,
+                                        struct timeval * duration,
+                                        uint8_t flags);
 
 /**
  * Take a shared lock on an object.
@@ -2422,9 +2499,10 @@ int rados_lock_exclusive(rados_ioctx_t io, const char * o, const char * name,
  * @returns -EBUSY if the lock is already held by another (client, cookie) pair
  * @returns -EEXIST if the lock is already held by the same (client, cookie) pair
  */
-int rados_lock_shared(rados_ioctx_t io, const char * o, const char * name,
-              const char * cookie, const char * tag, const char * desc,
-              struct timeval * duration, uint8_t flags);
+CEPH_RADOS_API int rados_lock_shared(rados_ioctx_t io, const char * o,
+                                     const char * name, const char * cookie,
+                                     const char * tag, const char * desc,
+                                    struct timeval * duration, uint8_t flags);
 
 /**
  * Release a shared or exclusive lock on an object.
@@ -2436,8 +2514,8 @@ int rados_lock_shared(rados_ioctx_t io, const char * o, const char * name,
  * @returns 0 on success, negative error code on failure
  * @returns -ENOENT if the lock is not held by the specified (client, cookie) pair
  */
-int rados_unlock(rados_ioctx_t io, const char *o, const char *name,
-                const char *cookie);
+CEPH_RADOS_API int rados_unlock(rados_ioctx_t io, const char *o,
+                                const char *name, const char *cookie);
 
 /**
  * List clients that have locked the named object lock and information about
@@ -2462,12 +2540,12 @@ int rados_unlock(rados_ioctx_t io, const char *o, const char *name,
  * @returns number of lockers on success, negative error code on failure
  * @returns -ERANGE if any of the buffers are too short
  */
-ssize_t rados_list_lockers(rados_ioctx_t io, const char *o,
-                          const char *name, int *exclusive,
-                          char *tag, size_t *tag_len,
-                          char *clients, size_t *clients_len,
-                          char *cookies, size_t *cookies_len,
-                          char *addrs, size_t *addrs_len);
+CEPH_RADOS_API ssize_t rados_list_lockers(rados_ioctx_t io, const char *o,
+                                         const char *name, int *exclusive,
+                                         char *tag, size_t *tag_len,
+                                         char *clients, size_t *clients_len,
+                                         char *cookies, size_t *cookies_len,
+                                         char *addrs, size_t *addrs_len);
 
 /**
  * Releases a shared or exclusive lock on an object, which was taken by the
@@ -2482,8 +2560,9 @@ ssize_t rados_list_lockers(rados_ioctx_t io, const char *o,
  * @returns -ENOENT if the lock is not held by the specified (client, cookie) pair
  * @returns -EINVAL if the client cannot be parsed
  */
-int rados_break_lock(rados_ioctx_t io, const char *o, const char *name,
-                    const char *client, const char *cookie);
+CEPH_RADOS_API int rados_break_lock(rados_ioctx_t io, const char *o,
+                                    const char *name, const char *client,
+                                    const char *cookie);
 /**
  * @defgroup librados_h_commands Mon/OSD/PG Commands
  *
@@ -2513,10 +2592,11 @@ int rados_break_lock(rados_ioctx_t io, const char *o, const char *name,
  * @param outslen pointer to status string length
  * @returns 0 on success, negative error code on failure
  */
-int rados_mon_command(rados_t cluster, const char **cmd, size_t cmdlen,
-                     const char *inbuf, size_t inbuflen,
-                     char **outbuf, size_t *outbuflen,
-                     char **outs, size_t *outslen);
+CEPH_RADOS_API int rados_mon_command(rados_t cluster, const char **cmd,
+                                     size_t cmdlen, const char *inbuf,
+                                     size_t inbuflen, char **outbuf,
+                                     size_t *outbuflen, char **outs,
+                                     size_t *outslen);
 
 /**
  * Send monitor command to a specific monitor.
@@ -2540,11 +2620,11 @@ int rados_mon_command(rados_t cluster, const char **cmd, size_t cmdlen,
  * @param outslen pointer to status string length
  * @returns 0 on success, negative error code on failure
  */
-int rados_mon_command_target(rados_t cluster, const char *name,
-                            const char **cmd, size_t cmdlen,
-                            const char *inbuf, size_t inbuflen,
-                            char **outbuf, size_t *outbuflen,
-                            char **outs, size_t *outslen);
+CEPH_RADOS_API int rados_mon_command_target(rados_t cluster, const char *name,
+                                           const char **cmd, size_t cmdlen,
+                                           const char *inbuf, size_t inbuflen,
+                                           char **outbuf, size_t *outbuflen,
+                                           char **outs, size_t *outslen);
 
 /**
  * free a rados-allocated buffer
@@ -2553,19 +2633,19 @@ int rados_mon_command_target(rados_t cluster, const char *name,
  *
  * @param buf buffer pointer
  */
-void rados_buffer_free(char *buf);
+CEPH_RADOS_API void rados_buffer_free(char *buf);
 
-int rados_osd_command(rados_t cluster, int osdid, const char **cmd,
-                     size_t cmdlen,
-                     const char *inbuf, size_t inbuflen,
-                     char **outbuf, size_t *outbuflen,
-                     char **outs, size_t *outslen);
+CEPH_RADOS_API int rados_osd_command(rados_t cluster, int osdid,
+                                     const char **cmd, size_t cmdlen,
+                                    const char *inbuf, size_t inbuflen,
+                                    char **outbuf, size_t *outbuflen,
+                                    char **outs, size_t *outslen);
 
-int rados_pg_command(rados_t cluster, const char *pgstr, const char **cmd,
-                    size_t cmdlen,
-                    const char *inbuf, size_t inbuflen,
-                    char **outbuf, size_t *outbuflen,
-                    char **outs, size_t *outslen);
+CEPH_RADOS_API int rados_pg_command(rados_t cluster, const char *pgstr,
+                                    const char **cmd, size_t cmdlen,
+                                   const char *inbuf, size_t inbuflen,
+                                   char **outbuf, size_t *outbuflen,
+                                   char **outs, size_t *outslen);
 
 /*
  * This is not a doxygen comment leadin, because doxygen breaks on
@@ -2595,7 +2675,8 @@ typedef void (*rados_log_callback_t)(void *arg,
                                     uint64_t seq, const char *level,
                                     const char *msg);
 
-int rados_monitor_log(rados_t cluster, const char *level, rados_log_callback_t cb, void *arg);
+CEPH_RADOS_API int rados_monitor_log(rados_t cluster, const char *level,
+                                     rados_log_callback_t cb, void *arg);
 
 /** @} Mon/OSD/PG commands */
 
index cabe63f97b5f991404b8f78994d93a9a42cad830..703ddb61ed7b5f22241aa5f4b71daa88c041e564 100644 (file)
@@ -65,7 +65,7 @@ namespace librados
   typedef void *completion_t;
   typedef void (*callback_t)(completion_t cb, void *arg);
 
-  class ListObject
+  class CEPH_RADOS_API ListObject
   {
   public:
     const std::string& get_nspace() const;
@@ -84,9 +84,9 @@ namespace librados
 
     ListObjectImpl *impl;
   };
-  std::ostream& operator<<(std::ostream& out, const librados::ListObject& lop);
+  CEPH_RADOS_API std::ostream& operator<<(std::ostream& out, const librados::ListObject& lop);
 
-  class NObjectIterator : public std::iterator <std::forward_iterator_tag, ListObject> {
+  class CEPH_RADOS_API NObjectIterator : public std::iterator <std::forward_iterator_tag, ListObject> {
   public:
     static const NObjectIterator __EndObjectIterator;
     NObjectIterator(): impl(NULL) {}
@@ -116,7 +116,7 @@ namespace librados
   };
 
   // DEPRECATED; Use NObjectIterator
-  class ObjectIterator : public std::iterator <std::forward_iterator_tag, std::pair<std::string, std::string> > {
+  class CEPH_RADOS_API ObjectIterator : public std::iterator <std::forward_iterator_tag, std::pair<std::string, std::string> > {
   public:
     static const ObjectIterator __EndObjectIterator;
     ObjectIterator() {}
@@ -145,13 +145,13 @@ namespace librados
     std::pair<std::string, std::string> cur_obj;
   };
 
-  class WatchCtx {
+  class CEPH_RADOS_API WatchCtx {
   public:
     virtual ~WatchCtx();
     virtual void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) = 0;
   };
 
-  struct AioCompletion {
+  struct CEPH_RADOS_API AioCompletion {
     AioCompletion(AioCompletionImpl *pc_) : pc(pc_) {}
     int set_complete_callback(void *cb_arg, callback_t cb);
     int set_safe_callback(void *cb_arg, callback_t cb);
@@ -170,7 +170,7 @@ namespace librados
     AioCompletionImpl *pc;
   };
 
-  struct PoolAsyncCompletion {
+  struct CEPH_RADOS_API PoolAsyncCompletion {
     PoolAsyncCompletion(PoolAsyncCompletionImpl *pc_) : pc(pc_) {}
     int set_callback(void *cb_arg, callback_t cb);
     int wait();
@@ -189,7 +189,7 @@ namespace librados
     OP_FAILOK = LIBRADOS_OP_FLAG_FAILOK,
   };
 
-  class ObjectOperationCompletion {
+  class CEPH_RADOS_API ObjectOperationCompletion {
   public:
     virtual ~ObjectOperationCompletion() {}
     virtual void handle_completion(int r, bufferlist& outbl) = 0;
@@ -230,7 +230,7 @@ namespace librados
    * Batch multiple object operations into a single request, to be applied
    * atomically.
    */
-  class ObjectOperation
+  class CEPH_RADOS_API ObjectOperation
   {
   public:
     ObjectOperation();
@@ -295,7 +295,7 @@ namespace librados
    * Batch multiple object operations into a single request, to be applied
    * atomically.
    */
-  class ObjectWriteOperation : public ObjectOperation
+  class CEPH_RADOS_API ObjectWriteOperation : public ObjectOperation
   {
   protected:
     time_t *pmtime;
@@ -397,7 +397,7 @@ namespace librados
    * Batch multiple object operations into a single request, to be applied
    * atomically.
    */
-  class ObjectReadOperation : public ObjectOperation
+  class CEPH_RADOS_API ObjectReadOperation : public ObjectOperation
   {
   public:
     ObjectReadOperation() {}
@@ -552,7 +552,7 @@ namespace librados
    * p->stat(&stats);
    * ... etc ...
    */
-  class IoCtx
+  class CEPH_RADOS_API IoCtx
   {
   public:
     IoCtx();
@@ -939,7 +939,7 @@ namespace librados
     IoCtxImpl *io_ctx_impl;
   };
 
-  class Rados
+  class CEPH_RADOS_API Rados
   {
   public:
     static void version(int *major, int *minor, int *extra);
index c9ad50e94f400ca267d6aa99c183a72cfb7b9cc0..e5acc8c22e318dfb33a7b1a3304ac3b5341b1f79 100644 (file)
@@ -1,14 +1,20 @@
-librados_la_SOURCES = \
-       librados/librados.cc \
+librados_internal_la_SOURCES = \
        librados/RadosClient.cc \
        librados/IoCtxImpl.cc \
-       librados/snap_set_diff.cc \
-       librados/RadosXattrIter.cc
+       librados/RadosXattrIter.cc \
+       librados/snap_set_diff.cc
+noinst_LTLIBRARIES += librados_internal.la
+
+librados_la_SOURCES = \
+       common/buffer.cc \
+       librados/librados.cc
 
 # We need this to avoid basename conflicts with the librados build tests in test/Makefile.am
 librados_la_CXXFLAGS = ${AM_CXXFLAGS}
 
-LIBRADOS_DEPS += libcls_lock_client.la $(LIBOSDC) $(LIBCOMMON)
+LIBRADOS_DEPS += \
+       librados_internal.la libcls_lock_client.la \
+       $(LIBOSDC) $(LIBCOMMON_DEPS)
 if WITH_LTTNG
 LIBRADOS_DEPS += $(LIBRADOS_TP)
 endif
@@ -16,7 +22,8 @@ endif
 librados_la_LIBADD = $(LIBRADOS_DEPS) $(PTHREAD_LIBS) $(CRYPTO_LIBS) $(EXTRALIBS)
 librados_la_LDFLAGS = ${AM_LDFLAGS} -version-info 2:0:0
 if LINUX
-librados_la_LDFLAGS += -export-symbols-regex '^rados_.*'
+librados_la_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
+librados_la_LDFLAGS += -Xcompiler -Xlinker -Xcompiler '--exclude-libs=ALL'
 endif
 lib_LTLIBRARIES += librados.la
 
old mode 100755 (executable)
new mode 100644 (file)
index e88f594785e198a52370f5b2388b0b99c27d72f7..ad0ebb56b3369b59f0be94cd8f9f03f6c31cda42 100644 (file)
@@ -6,7 +6,7 @@ libradosstriper_la_SOURCES = \
 # We need this to avoid basename conflicts with the libradosstriper build tests in test/Makefile.am
 libradosstriper_la_CXXFLAGS = ${AM_CXXFLAGS}
 
-LIBRADOSSTRIPER_DEPS = $(LIBRADOS)
+LIBRADOSSTRIPER_DEPS = $(LIBRADOS_DEPS)
 libradosstriper_la_LIBADD = $(LIBRADOSSTRIPER_DEPS)
 libradosstriper_la_LDFLAGS = ${AM_LDFLAGS} -version-info 1:0:0
 if LINUX
index cfa891eabfde09c7236a0dd608a8872e534e0dff..4274eb1c84f2c879bd26973499561c176db365f8 100644 (file)
@@ -7,8 +7,10 @@ librbd_la_SOURCES = \
        librbd/LibrbdWriteback.cc \
        librbd/WatchCtx.cc
 librbd_la_LIBADD = \
-       $(LIBRADOS) $(LIBOSDC) \
-       libcls_rbd_client.la libcls_lock_client.la \
+       $(LIBRADOS) $(LIBCOMMON) $(LIBOSDC) \
+       librados_internal.la \
+       libcls_rbd_client.la \
+       libcls_lock_client.la \
        $(PTHREAD_LIBS) $(EXTRALIBS)
 
 if WITH_LTTNG
index c114a9c7b9e07ae1581cac5da70daba14f527953..9ade407730234a5c57dbf440c9aac1965087b7ba 100644 (file)
@@ -705,13 +705,17 @@ bin_DEBUGPROGRAMS += ceph_test_librbd
 if LINUX
 # Force use of C++ linker with dummy.cc - LIBKRBD is a C++ library
 ceph_test_librbd_fsx_SOURCES = test/librbd/fsx.c common/dummy.cc
-ceph_test_librbd_fsx_LDADD = $(LIBKRBD) $(LIBRBD) $(LIBRADOS)
+ceph_test_librbd_fsx_LDADD = \
+       $(LIBKRBD) $(LIBRBD) $(LIBRADOS) \
+       $(CRYPTO_LIBS) $(PTHREAD_LIBS) -luuid
 ceph_test_librbd_fsx_CFLAGS = ${AM_CFLAGS}
 bin_DEBUGPROGRAMS += ceph_test_librbd_fsx
 endif
 
 ceph_test_cls_rbd_SOURCES = test/cls_rbd/test_cls_rbd.cc
-ceph_test_cls_rbd_LDADD = $(LIBRADOS) libcls_rbd_client.la libcls_lock_client.la $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
+ceph_test_cls_rbd_LDADD = \
+       $(LIBRADOS) libcls_rbd_client.la libcls_lock_client.la \
+       $(LIBCOMMON) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
 ceph_test_cls_rbd_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_cls_rbd
 
@@ -743,7 +747,9 @@ ceph_test_cls_replica_log_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_cls_replica_log
 
 ceph_test_cls_lock_SOURCES = test/cls_lock/test_cls_lock.cc
-ceph_test_cls_lock_LDADD = $(LIBRADOS) libcls_lock_client.la $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
+ceph_test_cls_lock_LDADD = \
+       $(LIBRADOS) libcls_lock_client.la \
+       $(LIBCOMMON) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
 ceph_test_cls_lock_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_cls_lock
 
@@ -756,7 +762,9 @@ bin_DEBUGPROGRAMS += ceph_test_cls_hello
 
 if WITH_RADOSGW
 ceph_test_cls_rgw_SOURCES = test/cls_rgw/test_cls_rgw.cc
-ceph_test_cls_rgw_LDADD = $(LIBRADOS) libcls_rgw_client.la $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
+ceph_test_cls_rgw_LDADD = \
+       $(LIBRADOS) libcls_rgw_client.la \
+       $(LIBCOMMON) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
 ceph_test_cls_rgw_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_cls_rgw
 endif # WITH_RADOSGW
@@ -771,7 +779,9 @@ ceph_test_mon_msg_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_mon_msg
 
 ceph_test_rados_api_cmd_SOURCES = test/librados/cmd.cc
-ceph_test_rados_api_cmd_LDADD = $(LIBRADOS) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
+ceph_test_rados_api_cmd_LDADD = \
+       $(LIBCOMMON) $(LIBRADOS) $(CRYPTO_LIBS) \
+       $(UNITTEST_LDADD) $(RADOS_TEST_LDADD) -luuid
 ceph_test_rados_api_cmd_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_rados_api_cmd
 
@@ -793,7 +803,8 @@ ceph_test_rados_api_c_read_operations_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_rados_api_c_read_operations
 
 ceph_test_rados_api_aio_SOURCES = test/librados/aio.cc
-ceph_test_rados_api_aio_LDADD = $(LIBRADOS) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
+ceph_test_rados_api_aio_LDADD = \
+       $(LIBRADOS) $(LIBCOMMON) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
 ceph_test_rados_api_aio_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_rados_api_aio
 
@@ -850,7 +861,9 @@ ceph_test_rados_api_lock_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_rados_api_lock
 
 ceph_test_rados_striper_api_io_SOURCES = test/libradosstriper/io.cc
-ceph_test_rados_striper_api_io_LDADD = $(LIBRADOS) $(LIBRADOSSTRIPER) $(UNITTEST_LDADD) $(RADOS_STRIPER_TEST_LDADD)
+ceph_test_rados_striper_api_io_LDADD = \
+       $(LIBRADOS) $(LIBRADOSSTRIPER) $(LIBCOMMON) \
+       $(UNITTEST_LDADD) $(RADOS_STRIPER_TEST_LDADD)
 ceph_test_rados_striper_api_io_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_rados_striper_api_io
 
@@ -917,7 +930,8 @@ ceph_test_filejournal_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_filejournal
 
 ceph_test_stress_watch_SOURCES = test/test_stress_watch.cc
-ceph_test_stress_watch_LDADD = $(LIBRADOS) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
+ceph_test_stress_watch_LDADD = \
+       $(LIBRADOS) $(LIBCOMMON) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
 ceph_test_stress_watch_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 bin_DEBUGPROGRAMS += ceph_test_stress_watch