fix: block: remove bdevname (v6.0)
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 15 Aug 2022 18:39:42 +0000 (14:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 18 Aug 2022 18:32:44 +0000 (14:32 -0400)
See upstream commit :

  commit 900d156bac2bc474cf7c7bee4efbc6c83ec5ae58
  Author: Christoph Hellwig <hch@lst.de>
  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 <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/lttng-statedump-impl.c

index 0e7530906c5c79b87a2e9cf02a23bec5e5a8f83b..4a465980b03638adc129888d7c1b67ba2900e366 100644 (file)
@@ -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
 
This page took 0.027268 seconds and 4 git commands to generate.