From 848cd9112b2c94f974d367b4f5f67550e247f313 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Wed, 19 Dec 2018 13:28:35 +0100 Subject: [PATCH] Add str_to_uuid function Signed-off-by: Robert Baldyga --- inc/ocf_data_obj.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inc/ocf_data_obj.h b/inc/ocf_data_obj.h index ba763d4..d42397f 100644 --- a/inc/ocf_data_obj.h +++ b/inc/ocf_data_obj.h @@ -12,6 +12,7 @@ */ #include "ocf_types.h" +#include "ocf_env.h" struct ocf_io; @@ -137,6 +138,16 @@ struct ocf_data_obj_properties { /*!< Data object operations */ }; +static inline struct ocf_data_obj_uuid ocf_str_to_uuid(char *str) +{ + struct ocf_data_obj_uuid uuid = { + .data = str, + .size = env_strnlen(str, OCF_DATA_OBJ_UUID_MAX_SIZE), + }; + + return uuid; +} + /** * @brief Get data object type *