From 6088f29b44fed60d1e631383a9b6f280ff42aaa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=B6hmwalder?= Date: Thu, 11 Apr 2024 11:59:38 +0200 Subject: [PATCH 3/3] compat: gate blkdev_* patches behind bdev_open_by_path If we have bdev_open_by_path, there is no need to consider these patches since they only apply to the (older) blkdev_{get_put}_* functions. --- drbd/drbd-kernel-compat/gen_patch_names.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c index d6fe75a80cf6..8355e723f82c 100644 --- a/drbd/drbd-kernel-compat/gen_patch_names.c +++ b/drbd/drbd-kernel-compat/gen_patch_names.c @@ -562,8 +562,10 @@ int main(int argc, char **argv) patch(1, "bdev_open_by_path", true, false, COMPAT_HAVE_BDEV_OPEN_BY_PATH, "present"); +#if !defined(COMPAT_HAVE_BDEV_OPEN_BY_PATH) patch(1, "blkdev_get_by_path", true, false, COMPAT_BLKDEV_GET_BY_PATH_HAS_HOLDER_OPS, "has_holder_ops"); +#endif patch(1, "block_device_operations_open", true, false, COMPAT_BLOCK_DEVICE_OPERATIONS_OPEN_TAKES_GENDISK, "takes_gendisk"); @@ -574,8 +576,10 @@ int main(int argc, char **argv) patch(1, "blk_mode_t", true, false, COMPAT_HAVE_BLK_MODE_T, "present"); +#if !defined(COMPAT_HAVE_BDEV_OPEN_BY_PATH) patch(1, "blkdev_put", true, false, COMPAT_BLKDEV_PUT_HAS_HOLDER, "has_holder"); +#endif patch(1, "genl_info_userhdr", true, false, COMPAT_HAVE_GENL_INFO_USERHDR, "present"); -- 2.44.0