[LTP] [PATCH] device-drivers/block/block_dev_kernel: Delete test_genhd.c
Petr Vorel
pvorel@suse.cz
Wed Jul 23 21:09:40 CEST 2025
Hi Tiezhu,
> test_genhd.c is not used any more, just delete it. While at it,
Thanks for your work, merged.
> update README to reflect the reality.
See below...
> Suggested-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> testcases/kernel/device-drivers/block/README | 17 +-----
> .../block/block_dev_kernel/test_genhd.c | 53 -------------------
> 2 files changed, 2 insertions(+), 68 deletions(-)
> delete mode 100644 testcases/kernel/device-drivers/block/block_dev_kernel/test_genhd.c
> diff --git a/testcases/kernel/device-drivers/block/README b/testcases/kernel/device-drivers/block/README
> index 812436bb8..1490fd295 100644
> --- a/testcases/kernel/device-drivers/block/README
> +++ b/testcases/kernel/device-drivers/block/README
> @@ -5,19 +5,6 @@ Module under test: linux/block/genhd.c
> -----------------------------+---------------+---------------
> register_blkdev() | linux/fs.h | ltp_block_dev.c
> unregister_blkdev() | linux/fs.h | ltp_block_dev.c
> - blk_register_region() | linux/genhd.h |
> - blk_unregister_region() | linux/genhd.h |
> - add_disk() | linux/genhd.h |
Internal kernel header <linux/genhd.h> was merged into in <linux/blkdev.h> in
v5.18-rc1. That means that functions was moved there. Also, some functions was
renamed, although I did not investigate whether before this change (i.e. renamed
in <linux/genhd.h>) or after in <linux/blkdev.h>. I suppose both.
Also at least add_disk() and del_gendisk() is in <linux/blkdev.h> and it's being
tested in other LTP modules:
$ git grep -l add_disk
testcases/kernel/device-drivers/include/includeTest.c
testcases/kernel/device-drivers/nls/nlsTest.c
testcases/kernel/device-drivers/tbio/tbio_kernel/ltp_tbio.c
$ git grep -l del_gendisk
testcases/kernel/device-drivers/include/includeTest.c
testcases/kernel/device-drivers/nls/nlsTest.c
testcases/kernel/device-drivers/tbio/tbio_kernel/ltp_tbio.c
These are outside of testcases/kernel/device-drivers/block/. I wonder if this
README makes sense when there are other kernel modules using block driver
related functions. But anyway, outdated README is just expected in these old
modules with questionable usability (sometimes I think we should just delete
them all and let kernel internals being tested in Kunit).
Kind regards,
Petr
More information about the ltp
mailing list