From: Mathieu Desnoyers Date: Mon, 13 Apr 2020 16:16:43 +0000 (-0400) Subject: Introduce lttng_guid_gen wrapper for kernels >= 5.7.0 X-Git-Tag: v2.13.0-rc1~238 X-Git-Url: http://git.liburcu.org/?p=lttng-modules.git;a=commitdiff_plain;h=a70082545931d638aca82b7c4f5253f1880d3c25 Introduce lttng_guid_gen wrapper for kernels >= 5.7.0 Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-events.c b/lttng-events.c index c14ea3f2..da949e97 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -27,9 +27,9 @@ #include #include #include -#include #include +#include #include /* for wrapper_vmalloc_sync_all() */ #include #include @@ -134,7 +134,7 @@ struct lttng_session *lttng_session_create(void) goto err; INIT_LIST_HEAD(&session->chan); INIT_LIST_HEAD(&session->events); - uuid_le_gen(&session->uuid); + lttng_guid_gen(&session->uuid); metadata_cache = kzalloc(sizeof(struct lttng_metadata_cache), GFP_KERNEL); diff --git a/wrapper/uuid.h b/wrapper/uuid.h new file mode 100644 index 00000000..74946e23 --- /dev/null +++ b/wrapper/uuid.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) + * + * wrapper/uuid.h + * + * Copyright (C) 2020 Mathieu Desnoyers + */ + +#ifndef _LTTNG_WRAPPER_UUID_H +#define _LTTNG_WRAPPER_UUID_H + +#include +#include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) +static inline +void lttng_guid_gen(guid_t *u) +{ + return guid_gen(u); +} +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ +static inline +void lttng_guid_gen(guid_t *u) +{ + return uuid_le_gen(u); +} +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ + +#endif /* _LTTNG_WRAPPER_UUID_H */