// 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
* @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
* @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.
* 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.
* @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
* @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.
* @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.
*
* @param cluster the cluster to shutdown
*/
-void rados_shutdown(rados_t cluster);
+CEPH_RADOS_API void rados_shutdown(rados_t cluster);
/** @} init */
* @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
* @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);
/**
* @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
*
* @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
* @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
* @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 */
* @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.
* @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
* @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
* @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
* @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
* @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
* @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
*
* @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
* @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
* @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
* @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
* @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
* @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
* @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
* @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
* @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
* @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.
* @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
* @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."
* @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
* @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
* @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
* @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 */
* @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
* @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 */
/**
* @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
* @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
* @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
* @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.
*
* @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 */
/**
* @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 */
* @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
* @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
* @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.
* @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
* @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
* @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
* @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
* @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
* @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
* @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
* @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
* @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 */
* @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
* @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
* @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
* @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
* @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
* @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
* @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
* @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
* @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.
* @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.
* @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.
* @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
* @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.
*
* @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 */
* @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.
*
* @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)
* @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)
* @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
* @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
* @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
* 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 */
* @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
* @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
* @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?
* @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?
* @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
* @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
* @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
* @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
* @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
* @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
*
* @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
* @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
* @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
* @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
* @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
* @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
* @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);
/**
* @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);
/**
* @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
* @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 */
* @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
* @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
* @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 */
* @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 */
*
* @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.
* @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,
* @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
* @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
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
* @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.
* @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.
* @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
* @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
* @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
* @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
* @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
* @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
* @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
* @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
*
* @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
* @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.
* @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,
* @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
* @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.
* @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
* @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
* @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.
* @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.
* @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
* @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
* @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
* @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 */
* @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.
* @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.
* @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
* @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
* @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
*
* @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.
* @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
*
* @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
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 */