ocf: accept optional base in bottom adapter
Interpret volume->open() options as our vbdev_ocf_base struct.
This is used during metadata probe procedure, when there is no
vbdev configurations created, so we need to pass base structure
as option.
This patch is a prepartion for persistant metadata support,
and it does not change current behavior.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455415 (master)
(cherry picked from commit fec9d4146b
)
Change-Id: I0b7435df1692d8b3028931c6c9fc50d2d84b2557
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457274
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
3e5cfa4124
commit
7a606da6df
@ -47,11 +47,15 @@ static int
|
||||
vbdev_ocf_volume_open(ocf_volume_t volume, void *opts)
|
||||
{
|
||||
struct vbdev_ocf_base **priv = ocf_volume_get_priv(volume);
|
||||
struct vbdev_ocf_base *base = vbdev_ocf_get_base_by_name(ocf_volume_get_uuid(volume)->data);
|
||||
struct vbdev_ocf_base *base;
|
||||
|
||||
if (base == NULL) {
|
||||
assert(false);
|
||||
return -EINVAL;
|
||||
if (opts) {
|
||||
base = opts;
|
||||
} else {
|
||||
base = vbdev_ocf_get_base_by_name(ocf_volume_get_uuid(volume)->data);
|
||||
if (base == NULL) {
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
*priv = base;
|
||||
|
Loading…
Reference in New Issue
Block a user