Add missing lock in ocf_ctx_get_volume_type_id()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
parent
a00ec916e2
commit
a2bef43975
@ -98,12 +98,14 @@ int ocf_ctx_get_volume_type_id(ocf_ctx_t ctx, ocf_volume_type_t type)
|
|||||||
|
|
||||||
OCF_CHECK_NULL(ctx);
|
OCF_CHECK_NULL(ctx);
|
||||||
|
|
||||||
|
env_rmutex_lock(&ctx->lock);
|
||||||
for (i = 0; i < OCF_VOLUME_TYPE_MAX; ++i) {
|
for (i = 0; i < OCF_VOLUME_TYPE_MAX; ++i) {
|
||||||
if (ctx->volume_type[i] == type)
|
if (ctx->volume_type[i] == type)
|
||||||
return i;
|
break;
|
||||||
}
|
}
|
||||||
|
env_rmutex_unlock(&ctx->lock);
|
||||||
|
|
||||||
return -1;
|
return (i < OCF_VOLUME_TYPE_MAX) ? i : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user