Implement the resize function for RAID0. raid0_resize() calculate the new raid_bdev's block count and if it is different from the old block count, call spdk_bdev_notify_blockcnt_change() with the new block count. A raid0 bdev always opens all base bdevs. Hence, if the size of base bdevs are reduced, resize fails now. This limitation will be removed later. Add a simple functional test for this feature. The test is to create a raid0 bdev with two null bdevs, resize one null bdev, check if the raid0 bdev is not resize, resize another null bdev, check if the raid0 bdev is resized. test/iscsi_tgt/resize/resize.sh was used a reference to write the test. Using jq rather than grep&sed is better and hence replace grep&sed by jq of test/iscsi_tgt/resize/resize.sh together in this patch. Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Change-Id: I07136648c4189b970843fc6da51ff40355423144 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16261 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> |
||
---|---|---|
.. | ||
bdev_raid_ut.c | ||
Makefile |