drbd/0026-compat-gate-blkdev_-patches-behind-bdev_open_by_path.patch
heming zhao 60ef287345 Accepting request 1167777 from home:gsu:branches:network:ha-clustering:Factory
------------------------------------------------------------------
- drbd: fix build error against kernel v6.8.2 (boo#1222397)
  * add upstream patches
    + 0024-compat-fixup-FMODE_READ-FMODE_WRITE-usage.patch
    + 0025-compat-drdb-Convert-to-use-bdev_open_by_path.patch
    + 0026-compat-gate-blkdev_-patches-behind-bdev_open_by_path.patch

OBS-URL: https://build.opensuse.org/request/show/1167777
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=149
2024-04-16 08:01:44 +00:00

42 lines
1.5 KiB
Diff

From 6088f29b44fed60d1e631383a9b6f280ff42aaa6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20B=C3=B6hmwalder?=
<christoph.boehmwalder@linbit.com>
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