]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
UBUNTU: hio: fix build error with kernel 5.11
authorAndrea Righi <andrea.righi@canonical.com>
Wed, 30 Dec 2020 09:55:44 +0000 (10:55 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Tue, 2 Nov 2021 07:24:53 +0000 (08:24 +0100)
hd_struct has been merged with block_device by this commit:

 0d02129e76edf91cf04fabf1efbc3a9a1f1d729a ("block: merge struct block_device and struct hd_struct")

Update hio to properly support this change.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
ubuntu/hio/hio.c

index 28fac1ba35931045283ba16553415406f70f8c1b..6d295473bfc92fd212ddcd642c3b8da6787e265e 100644 (file)
@@ -90,7 +90,7 @@
 #define hio_warn(f, arg...) printk(KERN_WARNING MODULE_NAME"warn: " f , ## arg)
 #define hio_err(f, arg...)  printk(KERN_ERR MODULE_NAME"err: " f , ## arg)
 
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(5,6,0))
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(5,6,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5,11,0))
 struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, sector_t sector);
 #endif
 
@@ -6116,7 +6116,10 @@ static int ssd_init_rom_info(struct ssd_device *dev)
 static int ssd_update_smart(struct ssd_device *dev, struct ssd_smart *smart)
 {
        uint64_t cur_time, run_time;
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
+       struct block_device *part;
+       int cpu;
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
        struct hd_struct *part;
        int cpu;
 #endif