drbd/0009-compat-fix-gen_patch_names-for-bdev_file_open_by_pat.patch

50 lines
1.8 KiB
Diff
Raw Permalink Normal View History

From 98325293e7d64ffae0e5e70620c5040ab0c76179 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20B=C3=B6hmwalder?=
<christoph.boehmwalder@linbit.com>
Date: Tue, 13 Aug 2024 12:23:52 +0200
Subject: [PATCH 09/32] compat: fix gen_patch_names for bdev_file_open_by_path
---
drbd/drbd-kernel-compat/gen_patch_names.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c
index a9781bbd04e5..7549ee39afb7 100644
--- a/drbd/drbd-kernel-compat/gen_patch_names.c
+++ b/drbd/drbd-kernel-compat/gen_patch_names.c
@@ -564,14 +564,17 @@ int main(int argc, char **argv)
patch(1, "__bio_add_page", true, false,
COMPAT_HAVE___BIO_ADD_PAGE, "present");
+ /* blkdev_put is oldest, then bdev_open_by_path, then bdev_file_open_by_path */
patch(1, "bdev_file_open_by_path", true, false,
COMPAT_HAVE_BDEV_FILE_OPEN_BY_PATH, "present");
-
#if !defined(COMPAT_HAVE_BDEV_FILE_OPEN_BY_PATH)
+ /* middle ground: bdev_open_by_path */
patch(1, "bdev_open_by_path", true, false,
COMPAT_HAVE_BDEV_OPEN_BY_PATH, "present");
-
# if !defined(COMPAT_HAVE_BDEV_OPEN_BY_PATH)
+ /* old: blkdev_get_by_* and blkdev_put */
+ patch(1, "blkdev_put", true, false,
+ COMPAT_BLKDEV_PUT_HAS_HOLDER, "has_holder");
patch(1, "blkdev_get_by_path", true, false,
COMPAT_BLKDEV_GET_BY_PATH_HAS_HOLDER_OPS, "has_holder_ops");
# endif
@@ -586,11 +589,6 @@ 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.35.3