Drop 'linux/file.h' wrapper
[lttng-modules.git] / src / lttng-statedump-impl.c
index 4d7b2921f1bac52ba43a6a271f69ff3aa8865ca2..6cd97658f7b3a6088686da3e10919b82ff841291 100644 (file)
@@ -41,8 +41,7 @@
 #include <wrapper/namespace.h>
 #include <wrapper/irq.h>
 #include <wrapper/tracepoint.h>
-#include <wrapper/genhd.h>
-#include <wrapper/file.h>
+#include <wrapper/blkdev.h>
 #include <wrapper/fdtable.h>
 #include <wrapper/sched.h>
 
@@ -197,7 +196,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
 
@@ -488,7 +509,7 @@ void lttng_enumerate_task_vm_maps(struct lttng_kernel_session *session,
                down_read(&mm->mmap_sem);
                while (map) {
                        if (map->vm_file)
-                               ino = map->vm_file->lttng_f_dentry->d_inode->i_ino;
+                               ino = map->vm_file->f_path.dentry->d_inode->i_ino;
                        else
                                ino = 0;
                        trace_lttng_statedump_vm_map(session, p, map, ino);
This page took 0.025107 seconds and 4 git commands to generate.