diff --git a/CHANGELOG.md b/CHANGELOG.md index 7316e9fe86..539c302f2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## v19.01.1: (Upcoming Release) +### logical volumes + +Added option to change method for erasing data region on lvol store creation. +Default of unmapping can now be changed to writing zeroes or no operation. + ## v19.01: ### ocf bdev diff --git a/autotest.sh b/autotest.sh index f60f9c7664..5ba2fa0c19 100755 --- a/autotest.sh +++ b/autotest.sh @@ -205,7 +205,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then timing_enter lvol test_cases="1,50,51,52,53,100,101,102,150,200,201,250,251,252,253,254,255," test_cases+="300,301,450,451,452,550,551,552,553," - test_cases+="600,601,650,651,652,654,655," + test_cases+="600,601,602,650,651,652,654,655," test_cases+="700,701,702,750,751,752,753,754,755,756,757,758,759,760," test_cases+="800,801,802,803,804,10000" run_test suite ./test/lvol/lvol.sh --test-cases=$test_cases diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index c790dff69a..6e41f0305d 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -4499,6 +4499,7 @@ Name | Optional | Type | Description bdev_name | Required | string | Bdev on which to construct logical volume store lvs_name | Required | string | Name of the logical volume store to create cluster_sz | Optional | number | Cluster size of the logical volume store in bytes +clear_method | Optional | string | Change clear method for data region. Available: none, unmap (default), write_zeroes ### Response @@ -4515,6 +4516,7 @@ Example request: "params": { "lvs_name": "LVS0", "bdev_name": "Malloc0" + "clear_method": "write_zeroes" } } ~~~ diff --git a/doc/lvol.md b/doc/lvol.md index 42a2d34f7a..63f1578ffb 100644 --- a/doc/lvol.md +++ b/doc/lvol.md @@ -10,6 +10,7 @@ The Logical Volumes library is a flexible storage space management system. It pr * Type name: struct spdk_lvol_store A logical volume store uses the super blob feature of blobstore to hold uuid (and in future other metadata). Blobstore types are implemented in blobstore itself, and saved on disk. An lvolstore will generate a UUID on creation, so that it can be uniquely identified from other lvolstores. +By default when creating lvol store data region is unmapped. Optional --clear-method parameter can be passed on creation to change that behavior to writing zeroes or performing no operation. ## Logical volume {#lvol} @@ -84,6 +85,7 @@ construct_lvol_store [-h] [-c CLUSTER_SZ] bdev_name lvs_name Optional parameters: -h show help -c CLUSTER_SZ Specifies the size of cluster. By default its 4MiB. + --clear-method specify data region clear method "none", "unmap" (default), "write_zeroes" destroy_lvol_store [-h] [-u UUID] [-l LVS_NAME] Destroy lvolstore on specified bdev. Removes lvolstore along with lvols on it. User can identify lvol store by UUID or its name. Note that destroying diff --git a/include/spdk/blob.h b/include/spdk/blob.h index 3cb42b90ef..065fcffc78 100644 --- a/include/spdk/blob.h +++ b/include/spdk/blob.h @@ -77,6 +77,12 @@ enum blob_clear_method { BLOB_CLEAR_WITH_WRITE_ZEROES, }; +enum bs_clear_method { + BS_CLEAR_WITH_UNMAP, + BS_CLEAR_WITH_WRITE_ZEROES, + BS_CLEAR_WITH_NONE, +}; + struct spdk_blob_store; struct spdk_io_channel; struct spdk_blob; @@ -206,6 +212,9 @@ struct spdk_bs_opts { /** Maximum simultaneous operations per channel */ uint32_t max_channel_ops; + /** Clear method */ + enum bs_clear_method clear_method; + /** Blobstore type */ struct spdk_bs_type bstype; diff --git a/include/spdk/lvol.h b/include/spdk/lvol.h index 9d0f97de9a..3715454589 100644 --- a/include/spdk/lvol.h +++ b/include/spdk/lvol.h @@ -39,6 +39,7 @@ #define SPDK_LVOL_H #include "spdk/stdinc.h" +#include "spdk/blob.h" #ifdef __cplusplus extern "C" { @@ -55,6 +56,11 @@ enum lvol_clear_method { LVOL_CLEAR_WITH_WRITE_ZEROES, }; +enum lvs_clear_method { + LVS_CLEAR_WITH_UNMAP = BS_CLEAR_WITH_UNMAP, + LVS_CLEAR_WITH_WRITE_ZEROES = BS_CLEAR_WITH_WRITE_ZEROES, + LVS_CLEAR_WITH_NONE = BS_CLEAR_WITH_NONE, +}; /* Must include null terminator. */ #define SPDK_LVS_NAME_MAX 64 @@ -64,8 +70,9 @@ enum lvol_clear_method { * Parameters for lvolstore initialization. */ struct spdk_lvs_opts { - uint32_t cluster_sz; - char name[SPDK_LVS_NAME_MAX]; + uint32_t cluster_sz; + enum lvs_clear_method clear_method; + char name[SPDK_LVS_NAME_MAX]; }; /** diff --git a/lib/bdev/lvol/vbdev_lvol.c b/lib/bdev/lvol/vbdev_lvol.c index a71e3c4612..e41c272de3 100644 --- a/lib/bdev/lvol/vbdev_lvol.c +++ b/lib/bdev/lvol/vbdev_lvol.c @@ -205,7 +205,7 @@ end: int vbdev_lvs_create(struct spdk_bdev *base_bdev, const char *name, uint32_t cluster_sz, - spdk_lvs_op_with_handle_complete cb_fn, void *cb_arg) + enum lvs_clear_method clear_method, spdk_lvs_op_with_handle_complete cb_fn, void *cb_arg) { struct spdk_bs_dev *bs_dev; struct spdk_lvs_with_handle_req *lvs_req; @@ -223,6 +223,10 @@ vbdev_lvs_create(struct spdk_bdev *base_bdev, const char *name, uint32_t cluster opts.cluster_sz = cluster_sz; } + if (clear_method != 0) { + opts.clear_method = clear_method; + } + if (name == NULL) { SPDK_ERRLOG("missing name param\n"); return -EINVAL; diff --git a/lib/bdev/lvol/vbdev_lvol.h b/lib/bdev/lvol/vbdev_lvol.h index fbd82eb948..ed3eb1c8e2 100644 --- a/lib/bdev/lvol/vbdev_lvol.h +++ b/lib/bdev/lvol/vbdev_lvol.h @@ -48,7 +48,7 @@ struct lvol_store_bdev { }; int vbdev_lvs_create(struct spdk_bdev *base_bdev, const char *name, uint32_t cluster_sz, - spdk_lvs_op_with_handle_complete cb_fn, void *cb_arg); + enum lvs_clear_method clear_method, spdk_lvs_op_with_handle_complete cb_fn, void *cb_arg); void vbdev_lvs_destruct(struct spdk_lvol_store *lvs, spdk_lvs_op_complete cb_fn, void *cb_arg); void vbdev_lvs_unload(struct spdk_lvol_store *lvs, spdk_lvs_op_complete cb_fn, void *cb_arg); diff --git a/lib/bdev/lvol/vbdev_lvol_rpc.c b/lib/bdev/lvol/vbdev_lvol_rpc.c index 373558299b..16bd861daf 100644 --- a/lib/bdev/lvol/vbdev_lvol_rpc.c +++ b/lib/bdev/lvol/vbdev_lvol_rpc.c @@ -44,6 +44,7 @@ struct rpc_construct_lvol_store { char *lvs_name; char *bdev_name; uint32_t cluster_sz; + char *clear_method; }; static int @@ -81,12 +82,14 @@ free_rpc_construct_lvol_store(struct rpc_construct_lvol_store *req) { free(req->bdev_name); free(req->lvs_name); + free(req->clear_method); } static const struct spdk_json_object_decoder rpc_construct_lvol_store_decoders[] = { {"bdev_name", offsetof(struct rpc_construct_lvol_store, bdev_name), spdk_json_decode_string}, {"cluster_sz", offsetof(struct rpc_construct_lvol_store, cluster_sz), spdk_json_decode_uint32, true}, {"lvs_name", offsetof(struct rpc_construct_lvol_store, lvs_name), spdk_json_decode_string}, + {"clear_method", offsetof(struct rpc_construct_lvol_store, clear_method), spdk_json_decode_string, true}, }; static void @@ -123,6 +126,7 @@ spdk_rpc_construct_lvol_store(struct spdk_jsonrpc_request *request, struct rpc_construct_lvol_store req = {}; struct spdk_bdev *bdev; int rc; + enum lvs_clear_method clear_method; if (spdk_json_decode_object(params, rpc_construct_lvol_store_decoders, SPDK_COUNTOF(rpc_construct_lvol_store_decoders), @@ -150,8 +154,23 @@ spdk_rpc_construct_lvol_store(struct spdk_jsonrpc_request *request, goto invalid; } - rc = vbdev_lvs_create(bdev, req.lvs_name, req.cluster_sz, _spdk_rpc_lvol_store_construct_cb, - request); + if (req.clear_method != NULL) { + if (!strcasecmp(req.clear_method, "none")) { + clear_method = LVS_CLEAR_WITH_NONE; + } else if (!strcasecmp(req.clear_method, "unmap")) { + clear_method = LVS_CLEAR_WITH_UNMAP; + } else if (!strcasecmp(req.clear_method, "write_zeroes")) { + clear_method = LVS_CLEAR_WITH_WRITE_ZEROES; + } else { + rc = -EINVAL; + goto invalid; + } + } else { + clear_method = LVS_CLEAR_WITH_UNMAP; + } + + rc = vbdev_lvs_create(bdev, req.lvs_name, req.cluster_sz, clear_method, + _spdk_rpc_lvol_store_construct_cb, request); if (rc < 0) { goto invalid; } diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c index 1d68c52ff2..7d5873d461 100644 --- a/lib/blob/blobstore.c +++ b/lib/blob/blobstore.c @@ -2421,6 +2421,7 @@ spdk_bs_opts_init(struct spdk_bs_opts *opts) opts->num_md_pages = SPDK_BLOB_OPTS_NUM_MD_PAGES; opts->max_md_ops = SPDK_BLOB_OPTS_MAX_MD_OPS; opts->max_channel_ops = SPDK_BLOB_OPTS_DEFAULT_CHANNEL_OPS; + opts->clear_method = BS_CLEAR_WITH_UNMAP; memset(&opts->bstype, 0, sizeof(opts->bstype)); opts->iter_cb_fn = NULL; opts->iter_cb_arg = NULL; @@ -3694,8 +3695,14 @@ spdk_bs_init(struct spdk_bs_dev *dev, struct spdk_bs_opts *o, /* Clear metadata space */ spdk_bs_batch_write_zeroes_dev(batch, 0, num_md_lba); - /* Trim data clusters */ - spdk_bs_batch_unmap_dev(batch, num_md_lba, ctx->bs->dev->blockcnt - num_md_lba); + + if (opts.clear_method == BS_CLEAR_WITH_UNMAP) { + /* Trim data clusters */ + spdk_bs_batch_unmap_dev(batch, num_md_lba, ctx->bs->dev->blockcnt - num_md_lba); + } else if (opts.clear_method == BS_CLEAR_WITH_WRITE_ZEROES) { + /* Write_zeroes to data clusters */ + spdk_bs_batch_write_zeroes_dev(batch, num_md_lba, ctx->bs->dev->blockcnt - num_md_lba); + } spdk_bs_batch_close(batch); } diff --git a/lib/lvol/lvol.c b/lib/lvol/lvol.c index 5d8c1381f4..a44de99e9d 100644 --- a/lib/lvol/lvol.c +++ b/lib/lvol/lvol.c @@ -556,6 +556,7 @@ void spdk_lvs_opts_init(struct spdk_lvs_opts *o) { o->cluster_sz = SPDK_LVS_OPTS_CLUSTER_SZ; + o->clear_method = LVS_CLEAR_WITH_UNMAP; memset(o->name, 0, sizeof(o->name)); } @@ -565,6 +566,7 @@ _spdk_setup_lvs_opts(struct spdk_bs_opts *bs_opts, struct spdk_lvs_opts *o) assert(o != NULL); spdk_lvs_bs_opts_init(bs_opts); bs_opts->cluster_sz = o->cluster_sz; + bs_opts->clear_method = (enum bs_clear_method)o->clear_method; } int diff --git a/scripts/rpc.py b/scripts/rpc.py index 1dbf33ee35..acad089b2e 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1063,12 +1063,15 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse print(rpc.lvol.construct_lvol_store(args.client, bdev_name=args.bdev_name, lvs_name=args.lvs_name, - cluster_sz=args.cluster_sz)) + cluster_sz=args.cluster_sz, + clear_method=args.clear_method)) p = subparsers.add_parser('construct_lvol_store', help='Add logical volume store on base bdev') p.add_argument('bdev_name', help='base bdev name') p.add_argument('lvs_name', help='name for lvol store') p.add_argument('-c', '--cluster-sz', help='size of cluster (in bytes)', type=int, required=False) + p.add_argument('--clear-method', help="""Change clear method for data region. + Available: none, unmap, write_zeroes""", required=False) p.set_defaults(func=construct_lvol_store) def rename_lvol_store(args): diff --git a/scripts/rpc/lvol.py b/scripts/rpc/lvol.py index be0f6ec301..16612873d8 100644 --- a/scripts/rpc/lvol.py +++ b/scripts/rpc/lvol.py @@ -1,10 +1,11 @@ -def construct_lvol_store(client, bdev_name, lvs_name, cluster_sz=None): +def construct_lvol_store(client, bdev_name, lvs_name, cluster_sz=None, clear_method=None): """Construct a logical volume store. Args: bdev_name: bdev on which to construct logical volume store lvs_name: name of the logical volume store to create cluster_sz: cluster size of the logical volume store in bytes (optional) + clear_method: Change clear method for data region. Available: none, unmap, write_zeroes (optional) Returns: UUID of created logical volume store. @@ -12,6 +13,8 @@ def construct_lvol_store(client, bdev_name, lvs_name, cluster_sz=None): params = {'bdev_name': bdev_name, 'lvs_name': lvs_name} if cluster_sz: params['cluster_sz'] = cluster_sz + if clear_method: + params['clear_method'] = clear_method return client.call('construct_lvol_store', params) diff --git a/test/lvol/rpc_commands_lib.py b/test/lvol/rpc_commands_lib.py index 696ad5a237..9ebd554405 100644 --- a/test/lvol/rpc_commands_lib.py +++ b/test/lvol/rpc_commands_lib.py @@ -112,12 +112,16 @@ class Commands_Rpc(object): output = self.rpc.construct_malloc_bdev(total_size, block_size)[0] return output.rstrip('\n') - def construct_lvol_store(self, base_name, lvs_name, cluster_size=None): + def construct_lvol_store(self, base_name, lvs_name, cluster_size=None, clear_method=None): print("INFO: RPC COMMAND construct_lvol_store") if cluster_size: output = self.rpc.construct_lvol_store(base_name, lvs_name, "-c {cluster_sz}".format(cluster_sz=cluster_size))[0] + elif clear_method: + output = self.rpc.construct_lvol_store(base_name, + lvs_name, + "--clear-method {clear_m}".format(clear_m=clear_method))[0] else: output = self.rpc.construct_lvol_store(base_name, lvs_name)[0] return output.rstrip('\n') diff --git a/test/lvol/test_cases.py b/test/lvol/test_cases.py index bf0db1eb94..43c3a1176b 100644 --- a/test/lvol/test_cases.py +++ b/test/lvol/test_cases.py @@ -121,6 +121,7 @@ def case_message(func): 553: 'unregister_lvol_bdev', 600: 'construct_lvol_store_with_cluster_size_max', 601: 'construct_lvol_store_with_cluster_size_min', + 602: 'construct_lvol_store_with_all_clear_methods', 650: 'thin_provisioning_check_space', 651: 'thin_provisioning_read_empty_bdev', 652: 'thin_provisionind_data_integrity_test', @@ -1023,6 +1024,43 @@ class TestCases(object): # - Error code response printed to stdout return fail_count + @case_message + def test_case602(self): + """ + construct_lvol_store_with_all_clear_methods + + Call construct_lvol_store with all options for clear methods. + """ + fail_count = 0 + # Create malloc bdev + base_name = self.c.construct_malloc_bdev(self.total_size, + self.block_size) + # Construct lvol store with clear method 'none' + lvol_uuid = self.c.construct_lvol_store(base_name, self.lvs_name, clear_method="none") + fail_count += self.c.check_get_lvol_stores(base_name, lvol_uuid) + fail_count += self.c.delete_malloc_bdev(base_name) + + # Create malloc bdev + base_name = self.c.construct_malloc_bdev(self.total_size, + self.block_size) + # Construct lvol store with clear method 'unmap' + lvol_uuid = self.c.construct_lvol_store(base_name, self.lvs_name, clear_method="unmap") + fail_count += self.c.check_get_lvol_stores(base_name, lvol_uuid) + fail_count += self.c.delete_malloc_bdev(base_name) + + # Create malloc bdev + base_name = self.c.construct_malloc_bdev(self.total_size, + self.block_size) + # Construct lvol store with clear method 'write_zeroes' + lvol_uuid = self.c.construct_lvol_store(base_name, self.lvs_name, clear_method="write_zeroes") + fail_count += self.c.check_get_lvol_stores(base_name, lvol_uuid) + fail_count += self.c.delete_malloc_bdev(base_name) + + # Expected result: + # - construct lvol store return code != 0 + # - Error code response printed to stdout + return fail_count + @case_message def test_case650(self): """ diff --git a/test/unit/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut.c b/test/unit/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut.c index 2ee82b4791..74c5870025 100644 --- a/test/unit/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut.c +++ b/test/unit/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut.c @@ -705,7 +705,8 @@ ut_lvs_destroy(void) struct spdk_lvol_store *lvs; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -738,7 +739,8 @@ ut_lvol_init(void) int rc; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -772,7 +774,8 @@ ut_lvol_snapshot(void) struct spdk_lvol *lvol = NULL; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -821,7 +824,8 @@ ut_lvol_clone(void) struct spdk_lvol *clone = NULL; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -886,7 +890,8 @@ ut_lvol_hotremove(void) lvol_already_opened = false; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -979,7 +984,8 @@ ut_lvol_rename(void) int rc; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -1043,7 +1049,8 @@ ut_lvol_destroy(void) int rc; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -1097,7 +1104,8 @@ ut_lvol_resize(void) int rc = 0; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -1142,7 +1150,8 @@ ut_lvol_set_read_only(void) int rc = 0; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -1181,7 +1190,8 @@ ut_lvs_unload(void) struct spdk_lvol_store *lvs; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -1216,7 +1226,8 @@ ut_lvs_init(void) /* spdk_lvs_init() fails */ lvol_store_initialize_fail = true; - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc != 0); CU_ASSERT(g_lvserrno == 0); CU_ASSERT(g_lvol_store == NULL); @@ -1226,7 +1237,8 @@ ut_lvs_init(void) /* spdk_lvs_init_cb() fails */ lvol_store_initialize_cb_fail = true; - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno != 0); CU_ASSERT(g_lvol_store == NULL); @@ -1234,7 +1246,8 @@ ut_lvs_init(void) lvol_store_initialize_cb_fail = false; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL); @@ -1244,7 +1257,8 @@ ut_lvs_init(void) g_lvol_store = NULL; /* Bdev with lvol store already claimed */ - rc = vbdev_lvs_create(&g_bdev, "lvs", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "lvs", 0, LVS_CLEAR_WITH_UNMAP, lvol_store_op_with_handle_complete, + NULL); CU_ASSERT(rc != 0); CU_ASSERT(g_lvserrno == 0); CU_ASSERT(g_lvol_store == NULL); @@ -1379,7 +1393,8 @@ ut_lvs_rename(void) struct spdk_lvol_store *lvs; /* Lvol store is successfully created */ - rc = vbdev_lvs_create(&g_bdev, "old_lvs_name", 0, lvol_store_op_with_handle_complete, NULL); + rc = vbdev_lvs_create(&g_bdev, "old_lvs_name", 0, LVS_CLEAR_WITH_UNMAP, + lvol_store_op_with_handle_complete, NULL); CU_ASSERT(rc == 0); CU_ASSERT(g_lvserrno == 0); SPDK_CU_ASSERT_FATAL(g_lvol_store != NULL);