Commit ca87060d authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Jim Harris
Browse files

lvol: add option to change clear method for lvol store creation



Default 'unmap' option stays as it was.

'Write_zeroes' comes useful when one wants to make sure
that data presented from lvol bdevs on initial creation presents 0's.

'None' will be used for performance tests,
when whole device is preconditioned before creating lvol store.
Instead of performing preconditioning on each lvol bdev after its creation.

Change-Id: Ic5a5985e42a84f038a882bbe6f881624ae96242c
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/442881


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 3d951cd3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -173,6 +173,9 @@ This allows for basing clones on top of lvol_bdev without first creating a snaps
Added option to change method for data erasure when deleting lvol or resizing down.
Default of unmapping clusters can now be changed to writing zeroes or no operation.

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.

### log

"trace flags" are now referred to as "log flags" in the SPDK log API.  The
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,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
+2 −0
Original line number Diff line number Diff line
@@ -4505,6 +4505,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

@@ -4521,6 +4522,7 @@ Example request:
  "params": {
    "lvs_name": "LVS0",
    "bdev_name": "Malloc0"
    "clear_method": "write_zeroes"
  }
}
~~~
+2 −0
Original line number Diff line number Diff line
@@ -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}

@@ -85,6 +86,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
+9 −0
Original line number Diff line number Diff line
@@ -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;

Loading