module/bdev_rbd: remove spdk prefix from static/internal functions.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ie34606469aa78cd60dd949106d947cdf70c28f90
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2334
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Seth Howell 2020-05-10 01:14:45 -07:00 committed by Tomasz Zawadzki
parent fe5ba3033a
commit 289e0f5943
3 changed files with 42 additions and 42 deletions

View File

@ -94,12 +94,12 @@ bdev_rbd_free(struct bdev_rbd *rbd)
free(rbd->rbd_name); free(rbd->rbd_name);
free(rbd->user_id); free(rbd->user_id);
free(rbd->pool_name); free(rbd->pool_name);
spdk_bdev_rbd_free_config(rbd->config); bdev_rbd_free_config(rbd->config);
free(rbd); free(rbd);
} }
void void
spdk_bdev_rbd_free_config(char **config) bdev_rbd_free_config(char **config)
{ {
char **entry; char **entry;
@ -112,7 +112,7 @@ spdk_bdev_rbd_free_config(char **config)
} }
char ** char **
spdk_bdev_rbd_dup_config(const char *const *config) bdev_rbd_dup_config(const char *const *config)
{ {
size_t count; size_t count;
char **copy; char **copy;
@ -127,7 +127,7 @@ spdk_bdev_rbd_dup_config(const char *const *config)
} }
for (count = 0; config[count]; count++) { for (count = 0; config[count]; count++) {
if (!(copy[count] = strdup(config[count]))) { if (!(copy[count] = strdup(config[count]))) {
spdk_bdev_rbd_free_config(copy); bdev_rbd_free_config(copy);
return NULL; return NULL;
} }
} }
@ -682,11 +682,11 @@ static const struct spdk_bdev_fn_table rbd_fn_table = {
}; };
int int
spdk_bdev_rbd_create(struct spdk_bdev **bdev, const char *name, const char *user_id, bdev_rbd_create(struct spdk_bdev **bdev, const char *name, const char *user_id,
const char *pool_name, const char *pool_name,
const char *const *config, const char *const *config,
const char *rbd_name, const char *rbd_name,
uint32_t block_size) uint32_t block_size)
{ {
struct bdev_rbd *rbd; struct bdev_rbd *rbd;
int ret; int ret;
@ -721,7 +721,7 @@ spdk_bdev_rbd_create(struct spdk_bdev **bdev, const char *name, const char *user
return -ENOMEM; return -ENOMEM;
} }
if (config && !(rbd->config = spdk_bdev_rbd_dup_config(config))) { if (config && !(rbd->config = bdev_rbd_dup_config(config))) {
bdev_rbd_free(rbd); bdev_rbd_free(rbd);
return -ENOMEM; return -ENOMEM;
} }
@ -773,7 +773,7 @@ spdk_bdev_rbd_create(struct spdk_bdev **bdev, const char *name, const char *user
} }
void void
spdk_bdev_rbd_delete(struct spdk_bdev *bdev, spdk_delete_rbd_complete cb_fn, void *cb_arg) bdev_rbd_delete(struct spdk_bdev *bdev, spdk_delete_rbd_complete cb_fn, void *cb_arg)
{ {
if (!bdev || bdev->module != &rbd_if) { if (!bdev || bdev->module != &rbd_if) {
cb_fn(cb_arg, -ENODEV); cb_fn(cb_arg, -ENODEV);
@ -784,7 +784,7 @@ spdk_bdev_rbd_delete(struct spdk_bdev *bdev, spdk_delete_rbd_complete cb_fn, voi
} }
int int
spdk_bdev_rbd_resize(struct spdk_bdev *bdev, const uint64_t new_size_in_mb) bdev_rbd_resize(struct spdk_bdev *bdev, const uint64_t new_size_in_mb)
{ {
struct spdk_io_channel *ch; struct spdk_io_channel *ch;
struct bdev_rbd_io_channel *rbd_io_ch; struct bdev_rbd_io_channel *rbd_io_ch;
@ -883,7 +883,7 @@ bdev_rbd_library_init(void)
} }
/* TODO(?): user_id and rbd config values */ /* TODO(?): user_id and rbd config values */
rc = spdk_bdev_rbd_create(&bdev, NULL, NULL, pool_name, NULL, rbd_name, block_size); rc = bdev_rbd_create(&bdev, NULL, NULL, pool_name, NULL, rbd_name, block_size);
if (rc) { if (rc) {
goto end; goto end;
} }

View File

@ -38,15 +38,15 @@
#include "spdk/bdev.h" #include "spdk/bdev.h"
void spdk_bdev_rbd_free_config(char **config); void bdev_rbd_free_config(char **config);
char **spdk_bdev_rbd_dup_config(const char *const *config); char **bdev_rbd_dup_config(const char *const *config);
typedef void (*spdk_delete_rbd_complete)(void *cb_arg, int bdeverrno); typedef void (*spdk_delete_rbd_complete)(void *cb_arg, int bdeverrno);
int spdk_bdev_rbd_create(struct spdk_bdev **bdev, const char *name, const char *user_id, int bdev_rbd_create(struct spdk_bdev **bdev, const char *name, const char *user_id,
const char *pool_name, const char *pool_name,
const char *const *config, const char *const *config,
const char *rbd_name, uint32_t block_size); const char *rbd_name, uint32_t block_size);
/** /**
* Delete rbd bdev. * Delete rbd bdev.
* *
@ -54,8 +54,8 @@ int spdk_bdev_rbd_create(struct spdk_bdev **bdev, const char *name, const char *
* \param cb_fn Function to call after deletion. * \param cb_fn Function to call after deletion.
* \param cb_arg Argument to pass to cb_fn. * \param cb_arg Argument to pass to cb_fn.
*/ */
void spdk_bdev_rbd_delete(struct spdk_bdev *bdev, spdk_delete_rbd_complete cb_fn, void bdev_rbd_delete(struct spdk_bdev *bdev, spdk_delete_rbd_complete cb_fn,
void *cb_arg); void *cb_arg);
/** /**
* Resize rbd bdev. * Resize rbd bdev.
@ -63,6 +63,6 @@ void spdk_bdev_rbd_delete(struct spdk_bdev *bdev, spdk_delete_rbd_complete cb_fn
* \param bdev Pointer to rbd bdev. * \param bdev Pointer to rbd bdev.
* \param new_size_in_mb The new size in MiB for this bdev. * \param new_size_in_mb The new size in MiB for this bdev.
*/ */
int spdk_bdev_rbd_resize(struct spdk_bdev *bdev, const uint64_t new_size_in_mb); int bdev_rbd_resize(struct spdk_bdev *bdev, const uint64_t new_size_in_mb);
#endif /* SPDK_BDEV_RBD_H */ #endif /* SPDK_BDEV_RBD_H */

View File

@ -53,11 +53,11 @@ free_rpc_create_rbd(struct rpc_create_rbd *req)
free(req->user_id); free(req->user_id);
free(req->pool_name); free(req->pool_name);
free(req->rbd_name); free(req->rbd_name);
spdk_bdev_rbd_free_config(req->config); bdev_rbd_free_config(req->config);
} }
static int static int
spdk_bdev_rbd_decode_config(const struct spdk_json_val *values, void *out) bdev_rbd_decode_config(const struct spdk_json_val *values, void *out)
{ {
char ***map = out; char ***map = out;
char **entry; char **entry;
@ -87,7 +87,7 @@ spdk_bdev_rbd_decode_config(const struct spdk_json_val *values, void *out)
/* Here we catch errors like invalid types. */ /* Here we catch errors like invalid types. */
if (!(entry[0] = spdk_json_strdup(name)) || if (!(entry[0] = spdk_json_strdup(name)) ||
!(entry[1] = spdk_json_strdup(v))) { !(entry[1] = spdk_json_strdup(v))) {
spdk_bdev_rbd_free_config(*map); bdev_rbd_free_config(*map);
*map = NULL; *map = NULL;
return -1; return -1;
} }
@ -104,12 +104,12 @@ static const struct spdk_json_object_decoder rpc_create_rbd_decoders[] = {
{"pool_name", offsetof(struct rpc_create_rbd, pool_name), spdk_json_decode_string}, {"pool_name", offsetof(struct rpc_create_rbd, pool_name), spdk_json_decode_string},
{"rbd_name", offsetof(struct rpc_create_rbd, rbd_name), spdk_json_decode_string}, {"rbd_name", offsetof(struct rpc_create_rbd, rbd_name), spdk_json_decode_string},
{"block_size", offsetof(struct rpc_create_rbd, block_size), spdk_json_decode_uint32}, {"block_size", offsetof(struct rpc_create_rbd, block_size), spdk_json_decode_uint32},
{"config", offsetof(struct rpc_create_rbd, config), spdk_bdev_rbd_decode_config, true} {"config", offsetof(struct rpc_create_rbd, config), bdev_rbd_decode_config, true}
}; };
static void static void
spdk_rpc_bdev_rbd_create(struct spdk_jsonrpc_request *request, rpc_bdev_rbd_create(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params) const struct spdk_json_val *params)
{ {
struct rpc_create_rbd req = {}; struct rpc_create_rbd req = {};
struct spdk_json_write_ctx *w; struct spdk_json_write_ctx *w;
@ -125,10 +125,10 @@ spdk_rpc_bdev_rbd_create(struct spdk_jsonrpc_request *request,
goto cleanup; goto cleanup;
} }
rc = spdk_bdev_rbd_create(&bdev, req.name, req.user_id, req.pool_name, rc = bdev_rbd_create(&bdev, req.name, req.user_id, req.pool_name,
(const char *const *)req.config, (const char *const *)req.config,
req.rbd_name, req.rbd_name,
req.block_size); req.block_size);
if (rc) { if (rc) {
spdk_jsonrpc_send_error_response(request, rc, spdk_strerror(-rc)); spdk_jsonrpc_send_error_response(request, rc, spdk_strerror(-rc));
goto cleanup; goto cleanup;
@ -141,7 +141,7 @@ spdk_rpc_bdev_rbd_create(struct spdk_jsonrpc_request *request,
cleanup: cleanup:
free_rpc_create_rbd(&req); free_rpc_create_rbd(&req);
} }
SPDK_RPC_REGISTER("bdev_rbd_create", spdk_rpc_bdev_rbd_create, SPDK_RPC_RUNTIME) SPDK_RPC_REGISTER("bdev_rbd_create", rpc_bdev_rbd_create, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_rbd_create, construct_rbd_bdev) SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_rbd_create, construct_rbd_bdev)
struct rpc_bdev_rbd_delete { struct rpc_bdev_rbd_delete {
@ -159,7 +159,7 @@ static const struct spdk_json_object_decoder rpc_bdev_rbd_delete_decoders[] = {
}; };
static void static void
_spdk_rpc_bdev_rbd_delete_cb(void *cb_arg, int bdeverrno) _rpc_bdev_rbd_delete_cb(void *cb_arg, int bdeverrno)
{ {
struct spdk_jsonrpc_request *request = cb_arg; struct spdk_jsonrpc_request *request = cb_arg;
struct spdk_json_write_ctx *w; struct spdk_json_write_ctx *w;
@ -170,8 +170,8 @@ _spdk_rpc_bdev_rbd_delete_cb(void *cb_arg, int bdeverrno)
} }
static void static void
spdk_rpc_bdev_rbd_delete(struct spdk_jsonrpc_request *request, rpc_bdev_rbd_delete(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params) const struct spdk_json_val *params)
{ {
struct rpc_bdev_rbd_delete req = {NULL}; struct rpc_bdev_rbd_delete req = {NULL};
struct spdk_bdev *bdev; struct spdk_bdev *bdev;
@ -190,12 +190,12 @@ spdk_rpc_bdev_rbd_delete(struct spdk_jsonrpc_request *request,
goto cleanup; goto cleanup;
} }
spdk_bdev_rbd_delete(bdev, _spdk_rpc_bdev_rbd_delete_cb, request); bdev_rbd_delete(bdev, _rpc_bdev_rbd_delete_cb, request);
cleanup: cleanup:
free_rpc_bdev_rbd_delete(&req); free_rpc_bdev_rbd_delete(&req);
} }
SPDK_RPC_REGISTER("bdev_rbd_delete", spdk_rpc_bdev_rbd_delete, SPDK_RPC_RUNTIME) SPDK_RPC_REGISTER("bdev_rbd_delete", rpc_bdev_rbd_delete, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_rbd_delete, delete_rbd_bdev) SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_rbd_delete, delete_rbd_bdev)
struct rpc_bdev_rbd_resize { struct rpc_bdev_rbd_resize {
@ -215,8 +215,8 @@ free_rpc_bdev_rbd_resize(struct rpc_bdev_rbd_resize *req)
} }
static void static void
spdk_rpc_bdev_rbd_resize(struct spdk_jsonrpc_request *request, rpc_bdev_rbd_resize(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params) const struct spdk_json_val *params)
{ {
struct rpc_bdev_rbd_resize req = {}; struct rpc_bdev_rbd_resize req = {};
struct spdk_bdev *bdev; struct spdk_bdev *bdev;
@ -237,7 +237,7 @@ spdk_rpc_bdev_rbd_resize(struct spdk_jsonrpc_request *request,
goto cleanup; goto cleanup;
} }
rc = spdk_bdev_rbd_resize(bdev, req.new_size); rc = bdev_rbd_resize(bdev, req.new_size);
if (rc) { if (rc) {
spdk_jsonrpc_send_error_response(request, rc, spdk_strerror(-rc)); spdk_jsonrpc_send_error_response(request, rc, spdk_strerror(-rc));
goto cleanup; goto cleanup;
@ -249,4 +249,4 @@ spdk_rpc_bdev_rbd_resize(struct spdk_jsonrpc_request *request,
cleanup: cleanup:
free_rpc_bdev_rbd_resize(&req); free_rpc_bdev_rbd_resize(&req);
} }
SPDK_RPC_REGISTER("bdev_rbd_resize", spdk_rpc_bdev_rbd_resize, SPDK_RPC_RUNTIME) SPDK_RPC_REGISTER("bdev_rbd_resize", rpc_bdev_rbd_resize, SPDK_RPC_RUNTIME)