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:35:07 +0000 (14:35 -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 4d7b2921f1bac52ba43a6a271f69ff3aa8865ca2..06088ad274ff2ef46152b0f4e93e6ebd8330e075 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.029767 seconds and 4 git commands to generate.