Commit 7a294f4c authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Ben Walker
Browse files

RPC: rename rpc inflate_lvol_bdev to bdev_lvol_inflate



Change-Id: I56628060381218f25fb8bd5dfdf19fe7ca7e9da6
Signed-off-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466698


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 975efa2a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -304,7 +304,7 @@ Example response:
    "bdev_lvol_resize",
    "bdev_lvol_set_read_only",
    "bdev_lvol_decouple_parent",
    "inflate_lvol_bdev",
    "bdev_lvol_inflate",
    "bdev_lvol_rename",
    "bdev_lvol_clone",
    "snapshot_lvol_bdev",
@@ -5215,7 +5215,7 @@ Example response:
}
~~~

## inflate_lvol_bdev {#rpc_inflate_lvol_bdev}
## bdev_lvol_inflate {#rpc_bdev_lvol_inflate}

Inflate a logical volume. All unallocated clusters are allocated and copied from the parent or zero filled if not allocated in the parent. Then all dependencies on the parent are removed.

@@ -5232,7 +5232,7 @@ Example request:
~~~
{
  "jsonrpc": "2.0",
  "method": "inflate_lvol_bdev",
  "method": "bdev_lvol_inflate",
  "id": 1,
  "params": {
    "name": "8d87fccc-c278-49f0-9d4c-6237951aca09"
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ bdev_lvol_set_read_only [-h] name
    Mark lvol bdev as read only
    optional arguments:
    -h, --help  show help
inflate_lvol_bdev [-h] name
bdev_lvol_inflate [-h] name
    Inflate lvol bdev
    optional arguments:
    -h, --help  show help
+18 −17
Original line number Diff line number Diff line
@@ -641,22 +641,22 @@ cleanup:
SPDK_RPC_REGISTER("bdev_lvol_rename", spdk_rpc_bdev_lvol_rename, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_lvol_rename, rename_lvol_bdev)

struct rpc_inflate_lvol_bdev {
struct rpc_bdev_lvol_inflate {
	char *name;
};

static void
free_rpc_inflate_lvol_bdev(struct rpc_inflate_lvol_bdev *req)
free_rpc_bdev_lvol_inflate(struct rpc_bdev_lvol_inflate *req)
{
	free(req->name);
}

static const struct spdk_json_object_decoder rpc_inflate_lvol_bdev_decoders[] = {
	{"name", offsetof(struct rpc_inflate_lvol_bdev, name), spdk_json_decode_string},
static const struct spdk_json_object_decoder rpc_bdev_lvol_inflate_decoders[] = {
	{"name", offsetof(struct rpc_bdev_lvol_inflate, name), spdk_json_decode_string},
};

static void
_spdk_rpc_inflate_lvol_bdev_cb(void *cb_arg, int lvolerrno)
_spdk_rpc_bdev_lvol_inflate_cb(void *cb_arg, int lvolerrno)
{
	struct spdk_json_write_ctx *w;
	struct spdk_jsonrpc_request *request = cb_arg;
@@ -676,17 +676,17 @@ invalid:
}

static void
spdk_rpc_inflate_lvol_bdev(struct spdk_jsonrpc_request *request,
spdk_rpc_bdev_lvol_inflate(struct spdk_jsonrpc_request *request,
			   const struct spdk_json_val *params)
{
	struct rpc_inflate_lvol_bdev req = {};
	struct rpc_bdev_lvol_inflate req = {};
	struct spdk_bdev *bdev;
	struct spdk_lvol *lvol;

	SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "Inflating lvol\n");

	if (spdk_json_decode_object(params, rpc_inflate_lvol_bdev_decoders,
				    SPDK_COUNTOF(rpc_inflate_lvol_bdev_decoders),
	if (spdk_json_decode_object(params, rpc_bdev_lvol_inflate_decoders,
				    SPDK_COUNTOF(rpc_bdev_lvol_inflate_decoders),
				    &req)) {
		SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "spdk_json_decode_object failed\n");
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
@@ -708,26 +708,27 @@ spdk_rpc_inflate_lvol_bdev(struct spdk_jsonrpc_request *request,
		goto cleanup;
	}

	spdk_lvol_inflate(lvol, _spdk_rpc_inflate_lvol_bdev_cb, request);
	spdk_lvol_inflate(lvol, _spdk_rpc_bdev_lvol_inflate_cb, request);

cleanup:
	free_rpc_inflate_lvol_bdev(&req);
	free_rpc_bdev_lvol_inflate(&req);
}

SPDK_RPC_REGISTER("inflate_lvol_bdev", spdk_rpc_inflate_lvol_bdev, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER("bdev_lvol_inflate", spdk_rpc_bdev_lvol_inflate, SPDK_RPC_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_lvol_inflate, inflate_lvol_bdev)

static void
spdk_rpc_bdev_lvol_decouple_parent(struct spdk_jsonrpc_request *request,
				   const struct spdk_json_val *params)
{
	struct rpc_inflate_lvol_bdev req = {};
	struct rpc_bdev_lvol_inflate req = {};
	struct spdk_bdev *bdev;
	struct spdk_lvol *lvol;

	SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "Decoupling parent of lvol\n");

	if (spdk_json_decode_object(params, rpc_inflate_lvol_bdev_decoders,
				    SPDK_COUNTOF(rpc_inflate_lvol_bdev_decoders),
	if (spdk_json_decode_object(params, rpc_bdev_lvol_inflate_decoders,
				    SPDK_COUNTOF(rpc_bdev_lvol_inflate_decoders),
				    &req)) {
		SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "spdk_json_decode_object failed\n");
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
@@ -749,10 +750,10 @@ spdk_rpc_bdev_lvol_decouple_parent(struct spdk_jsonrpc_request *request,
		goto cleanup;
	}

	spdk_lvol_decouple_parent(lvol, _spdk_rpc_inflate_lvol_bdev_cb, request);
	spdk_lvol_decouple_parent(lvol, _spdk_rpc_bdev_lvol_inflate_cb, request);

cleanup:
	free_rpc_inflate_lvol_bdev(&req);
	free_rpc_bdev_lvol_inflate(&req);
}

SPDK_RPC_REGISTER("bdev_lvol_decouple_parent", spdk_rpc_bdev_lvol_decouple_parent, SPDK_RPC_RUNTIME)
+5 −4
Original line number Diff line number Diff line
@@ -1228,13 +1228,14 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
    p.add_argument('new_name', help='new lvol name')
    p.set_defaults(func=bdev_lvol_rename)

    def inflate_lvol_bdev(args):
        rpc.lvol.inflate_lvol_bdev(args.client,
    def bdev_lvol_inflate(args):
        rpc.lvol.bdev_lvol_inflate(args.client,
                                   name=args.name)

    p = subparsers.add_parser('inflate_lvol_bdev', help='Make thin provisioned lvol a thick provisioned lvol')
    p = subparsers.add_parser('bdev_lvol_inflate', aliases=['inflate_lvol_bdev'],
                              help='Make thin provisioned lvol a thick provisioned lvol')
    p.add_argument('name', help='lvol bdev name')
    p.set_defaults(func=inflate_lvol_bdev)
    p.set_defaults(func=bdev_lvol_inflate)

    def bdev_lvol_decouple_parent(args):
        rpc.lvol.bdev_lvol_decouple_parent(args.client,
+3 −2
Original line number Diff line number Diff line
@@ -155,7 +155,8 @@ def destroy_lvol_bdev(client, name):
    return client.call('destroy_lvol_bdev', params)


def inflate_lvol_bdev(client, name):
@deprecated_alias('inflate_lvol_bdev')
def bdev_lvol_inflate(client, name):
    """Inflate a logical volume.

    Args:
@@ -164,7 +165,7 @@ def inflate_lvol_bdev(client, name):
    params = {
        'name': name,
    }
    return client.call('inflate_lvol_bdev', params)
    return client.call('bdev_lvol_inflate', params)


@deprecated_alias('decouple_parent_lvol_bdev')
Loading