Get a fragmap for a specific segment of a logical volume using the provided offset and size.
A fragmap is a bitmap that records the allocation status of clusters. A value of "1" indicates
that a cluster is allocated, whereas "0" signifies that a cluster is unallocated.
Longhorn 6138
Signed-off-by: Derek Su <derek.su@suse.com>
Implemented unit test for raid grow adding a new base bdev to an
existing raid bdev operation.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
Implemented the RPC to add a new base bdev to a raid bdev,
growing the size of the raid if needed.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
Implemented the functionality to add a new base bdev to an existing
raid bdev, growing the size of the raid if needed.
Actually only raid1 supports growing with a new base bdev.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
raid_bdev_write_superblock takes an addtional cb_arg parameter
that will be passed to the callback function after the
superblock write operation.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
Refactored the code creating raid_bdev_module_get_min_operational,
distinguished intentional removal from failure in superblock base
bdev state.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
Function raid_bdev_resume takes as input parameters also a function
pointer and a context to be called at the end of the resume operation.
If no callback should be called, NULL parameters can be passed.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
A couple of format fix shown by check_format.sh in the commit
"Always append one double quote char in the end of string".
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
The returned value write_string_or_name() is not really checked, so one double quote char error
is not identified and the broken json string is directly sent to the client.
To address the issue, the workaround is always appending one double quote char in the end of string.
TODO:
1. Find the root cause
2. Check the returned value of write_string_or_name()
Longhorn 6190
Signed-off-by: Derek Su <derek.su@suse.com>
Function spdk_blob_get_shallow_copy_result has been added to
spdk_blob.map file because it is a public API function.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
A shallow copy will copy over the destination device only the
cluster allocated to the blob/lvol discarding those belonging
to the blob/lvol parent snapshot. blob/lvol must be read only.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
The size of raid name inside raid superblock structure is
increased to 64 chars to let the creation of raid bdev with longer name.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
The minimun number of raid1 base bdevs is set to 1, so a raid1 bdev
can be created with only one base bdev.
Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
Add num_base_bdevs_operational to raid_bdev and use it to determine the
required number of base bdevs.
Change-Id: I31b39cc8ea708b6cdce748f015949e4c9fdeb3cd
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
When adding a new base bdev to a raid bdev (currently only when creating
a new raid bdev) make sure that there is no existing superblock
stored on the base bdev. This prevents accidentally overwriting a base
bdev belonging to a different raid array.
Change-Id: Id5f6c7e3ed7223f6a8fc7455f75831fbbcac7e43
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change the bdev_raid examine procedure to read the superblock from the
examined base bdev. If a valid superblock is found, re-create the
raid_bdev from it.
Change-Id: I4bd589647a207a216ecf0dec9baf11c5d691f5d5
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
When creating the raid_bdev with enabled superblock option, write the
superblock to the base bdevs before bringing the array online.
Change-Id: I24659202ef3bbe6c87ca8603d514bd81660c9b41
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
There is a trap set up to kill the spdk process in case of error, there
is no need to delete any bdevs before that.
Change-Id: Ic80e2a48453f718fbc42cabe88d86eefa35c95db
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Refactor the code to use these new functions.
Change-Id: I21ee7e9a96f30fbd60106add5e8b071e86bf93c9
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reads for raid1 bdevs are balanced. Algorithm tries to evenly distribute
load by sending read I/O to all base bdevs following round-robin, but
skiping base bdev that processed most data so far.
Signed-off-by: Krzysztof Smolinski <krzysztof.smolinski@intel.com>
Change-Id: I7d85411a6421bd7352031efb562ee95f2c612011
Support for multi-stripe requests is not used anymore so remove it.
Change-Id: I8f28817763452674c8a183c640800f3a4b4b3653
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Remove struct test_request_conf and instead do some basic reads on each
chunk. Also remove the io_info splitting because it is not used now.
Change-Id: I4b945b40598670f6ab84fb8066278877fee7fb75
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Properly handle IO when one or more base bdevs are missing.
Change-Id: I51161b01a625c20da5156d7db1c5e5d9b62ce298
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Don't stop the raid bdev if the minimum number of base bdevs are
available.
When removing a base bdev, first suspend the raid bdev and then perform
the actual removal/cleanup. Finally, resume the raid bdev.
Change-Id: Ie010d3760c32b0dad455a5a2a0ab7adcc602edf9
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
This allows to simplify some code where raid_bdev and base_info are
needed.
Change-Id: I40395204fdcdd0487bdecec1cd47efb347f1310a
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Add functions to suspend and resume IO on all channels. This will be
used to safely change the device state in case of e.g. removing a base
bdev.
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I203c1899bde15101e0c2bc8da7a1066a2fee6dd2
When raid bdev is created with superblock parameter then all data on
this bdev should be shifted by some offset. Such space at the beginning
of bdev will be used to store on-disk raid metadata.
Signed-off-by: Krzysztof Smolinski <krzysztof.smolinski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I2545a2b00a651ef5332ca1757da0110a63914a43
Introduction of superblock parameter for bdev_raid_create rpc. This
parameter determines whether raid bdev should be created with support
for on-disk metadata (support for raid on-disk metadata is going to be
implemented in the future).
Signed-off-by: Krzysztof Smolinski <krzysztof.smolinski@intel.com>
Change-Id: Ie8c64f837dd7eb3ba788b7c5d7bc98e8f1368ba7