From 2162e945c2a92930d3e34014c42bc3ccb9137354 Mon Sep 17 00:00:00 2001 From: Gal Hammer Date: Tue, 21 Dec 2021 20:40:17 +0200 Subject: [PATCH 1/2] configure: adapt to kernel 5.11 The disk_part_iter_next function is declated in linux/genhd.h header file. Signed-off-by: Gal Hammer Signed-off-by: Shai Fultheim --- configure.d/1_bd_first_part.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.d/1_bd_first_part.conf b/configure.d/1_bd_first_part.conf index 5869aa7..c03ad5f 100644 --- a/configure.d/1_bd_first_part.conf +++ b/configure.d/1_bd_first_part.conf @@ -9,7 +9,7 @@ check() { cur_name=$(basename $2) config_file_path=$1 - if compile_module $cur_name "struct block_device *bd; bd = disk_part_iter_next(NULL);" "linux/blk_types.h" + if compile_module $cur_name "struct block_device *bd; bd = disk_part_iter_next(NULL);" "linux/blk_types.h" "linux/genhd.h" then echo $cur_name "1" >> $config_file_path elif compile_module $cur_name "struct hd_struct *hd; hd = disk_part_iter_next(NULL);" "linux/genhd.h" From 46e6d92732dd6c686fc62c2208ef01447c2d34b2 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Wed, 29 Dec 2021 16:45:11 +0100 Subject: [PATCH 2/2] configure: trigger compilation error on pointer type incompatibility Signed-off-by: Robert Baldyga --- configure.d/1_bd_first_part.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.d/1_bd_first_part.conf b/configure.d/1_bd_first_part.conf index c03ad5f..1495c70 100644 --- a/configure.d/1_bd_first_part.conf +++ b/configure.d/1_bd_first_part.conf @@ -9,10 +9,10 @@ check() { cur_name=$(basename $2) config_file_path=$1 - if compile_module $cur_name "struct block_device *bd; bd = disk_part_iter_next(NULL);" "linux/blk_types.h" "linux/genhd.h" + if compile_module $cur_name "struct block_device bd; bd = *disk_part_iter_next(NULL);" "linux/blk_types.h" "linux/genhd.h" then echo $cur_name "1" >> $config_file_path - elif compile_module $cur_name "struct hd_struct *hd; hd = disk_part_iter_next(NULL);" "linux/genhd.h" + elif compile_module $cur_name "struct hd_struct hd; hd = *disk_part_iter_next(NULL);" "linux/genhd.h" then echo $cur_name "2" >> $config_file_path else