From: Michael Jeanson Date: Mon, 15 Aug 2022 18:39:42 +0000 (-0400) Subject: fix: block: remove bdevname (v6.0) X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cc92a21191f3f7f34ed545f1ca639432911353f0;p=lttng-modules.git fix: block: remove bdevname (v6.0) See upstream commit : commit 900d156bac2bc474cf7c7bee4efbc6c83ec5ae58 Author: Christoph Hellwig Date: Wed Jul 13 07:53:17 2022 +0200 block: remove bdevname Replace the remaining calls of bdevname with snprintf using the %pg format specifier. Change-Id: I09f2afe91e549be2746334a4a09fc00be09b0778 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/src/lttng-statedump-impl.c b/src/lttng-statedump-impl.c index 0e753090..4a465980 100644 --- a/src/lttng-statedump-impl.c +++ b/src/lttng-statedump-impl.c @@ -197,7 +197,29 @@ enum lttng_process_status { }; -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,0,0)) + +#define LTTNG_PART_STRUCT_TYPE struct block_device + +static +int lttng_get_part_name(struct gendisk *disk, struct block_device *part, char *name_buf) +{ + int ret; + + ret = snprintf(name_buf, BDEVNAME_SIZE, "%pg", part); + if (ret < 0 || ret >= BDEVNAME_SIZE) + return -ENOSYS; + + return 0; +} + +static +dev_t lttng_get_part_devt(struct block_device *part) +{ + return part->bd_dev; +} + +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) #define LTTNG_PART_STRUCT_TYPE struct block_device