Updated for recent kernel changes.
Eliminated the use of bvec_kmap_irq.patch Removed usage of removed elevator constants Resolves: rhbz#2035003 Signed-off-by: Andrew Walsh <awalsh@redhat.com>
This commit is contained in:
parent
7001b8e649
commit
f3f2514a3f
58
0001-Eliminate-use-of-bvec_kmap_irq.patch
Normal file
58
0001-Eliminate-use-of-bvec_kmap_irq.patch
Normal file
@ -0,0 +1,58 @@
|
||||
From 1dfccb284d3eb487028adc9006afb9ba0869e687 Mon Sep 17 00:00:00 2001
|
||||
From: Joseph Chapman <jochapma@redhat.com>
|
||||
Date: Thu, 23 Dec 2021 09:05:15 -0500
|
||||
Subject: [PATCH] Eliminate use of bvec_kmap_irq
|
||||
|
||||
Signed-off-by: Joseph Chapman <jochapma@redhat.com>
|
||||
---
|
||||
vdo/bio.c | 25 ++++++++-----------------
|
||||
1 file changed, 8 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/vdo/bio.c b/vdo/bio.c
|
||||
index 70f7a7d0..8234c7ed 100644
|
||||
--- a/vdo/bio.c
|
||||
+++ b/vdo/bio.c
|
||||
@@ -40,15 +40,11 @@ void vdo_bio_copy_data_in(struct bio *bio, char *data_ptr)
|
||||
{
|
||||
struct bio_vec biovec;
|
||||
struct bvec_iter iter;
|
||||
- unsigned long flags;
|
||||
|
||||
- bio_for_each_segment(biovec, bio, iter) {
|
||||
- void *from = bvec_kmap_irq(&biovec, &flags);
|
||||
-
|
||||
- memcpy(data_ptr, from, biovec.bv_len);
|
||||
- data_ptr += biovec.bv_len;
|
||||
- bvec_kunmap_irq(from, &flags);
|
||||
- }
|
||||
+ bio_for_each_segment(biovec, bio, iter) {
|
||||
+ memcpy_from_bvec(data_ptr, &biovec);
|
||||
+ data_ptr += biovec.bv_len;
|
||||
+ }
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
@@ -56,16 +52,11 @@ void vdo_bio_copy_data_out(struct bio *bio, char *data_ptr)
|
||||
{
|
||||
struct bio_vec biovec;
|
||||
struct bvec_iter iter;
|
||||
- unsigned long flags;
|
||||
|
||||
- bio_for_each_segment(biovec, bio, iter) {
|
||||
- void *dest = bvec_kmap_irq(&biovec, &flags);
|
||||
-
|
||||
- memcpy(dest, data_ptr, biovec.bv_len);
|
||||
- data_ptr += biovec.bv_len;
|
||||
- flush_dcache_page(biovec.bv_page);
|
||||
- bvec_kunmap_irq(dest, &flags);
|
||||
- }
|
||||
+ bio_for_each_segment(biovec, bio, iter) {
|
||||
+ memcpy_to_bvec(&biovec, data_ptr);
|
||||
+ data_ptr += biovec.bv_len;
|
||||
+ }
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
--
|
||||
2.31.1
|
||||
|
82
0002-Removed-usage-of-removed-elevator-constants.patch
Normal file
82
0002-Removed-usage-of-removed-elevator-constants.patch
Normal file
@ -0,0 +1,82 @@
|
||||
From 4b31b2a3e9ff5ee92d2204a5c0850d329945121b Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Walsh <awalsh@redhat.com>
|
||||
Date: Thu, 23 Dec 2021 19:05:01 -0500
|
||||
Subject: [PATCH] Removed usage of removed elevator constants.
|
||||
|
||||
---
|
||||
vdo/ioSubmitter.c | 27 ++++++++-------------------
|
||||
1 file changed, 8 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/vdo/ioSubmitter.c b/vdo/ioSubmitter.c
|
||||
index b4e571ab..a0628992 100644
|
||||
--- a/vdo/ioSubmitter.c
|
||||
+++ b/vdo/ioSubmitter.c
|
||||
@@ -305,25 +305,22 @@ static void process_bio_map(struct vdo_work_item *item)
|
||||
*
|
||||
* @param map The bio map to use for merging
|
||||
* @param vio The vio we want to merge
|
||||
- * @param merge_type The type of merging we want to try
|
||||
+ * @param back_merge Set to true for a back merge, false for a front merge
|
||||
*
|
||||
* @return the vio to merge to, NULL if no merging is possible
|
||||
*/
|
||||
static struct vio *get_mergeable_locked(struct int_map *map,
|
||||
struct vio *vio,
|
||||
- unsigned int merge_type)
|
||||
+ bool back_merge)
|
||||
{
|
||||
struct bio *bio = vio->bio;
|
||||
sector_t merge_sector = get_bio_sector(bio);
|
||||
struct vio *vio_merge;
|
||||
|
||||
- switch (merge_type) {
|
||||
- case ELEVATOR_BACK_MERGE:
|
||||
+ if (back_merge) {
|
||||
merge_sector -= VDO_SECTORS_PER_BLOCK;
|
||||
- break;
|
||||
- case ELEVATOR_FRONT_MERGE:
|
||||
+ } else {
|
||||
merge_sector += VDO_SECTORS_PER_BLOCK;
|
||||
- break;
|
||||
}
|
||||
|
||||
vio_merge = int_map_get(map, merge_sector);
|
||||
@@ -345,20 +342,14 @@ static struct vio *get_mergeable_locked(struct int_map *map,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- switch (merge_type) {
|
||||
- case ELEVATOR_BACK_MERGE:
|
||||
+ if (back_merge) {
|
||||
if (get_bio_sector(vio_merge->bios_merged.tail) !=
|
||||
merge_sector) {
|
||||
return NULL;
|
||||
}
|
||||
- break;
|
||||
-
|
||||
- case ELEVATOR_FRONT_MERGE:
|
||||
- if (get_bio_sector(vio_merge->bios_merged.head) !=
|
||||
+ } else if (get_bio_sector(vio_merge->bios_merged.head) !=
|
||||
merge_sector) {
|
||||
return NULL;
|
||||
- }
|
||||
- break;
|
||||
}
|
||||
|
||||
return vio_merge;
|
||||
@@ -422,10 +413,8 @@ static bool try_bio_map_merge(struct bio_queue_data *bio_queue_data,
|
||||
struct vio *prev_vio, *next_vio;
|
||||
|
||||
mutex_lock(&bio_queue_data->lock);
|
||||
- prev_vio = get_mergeable_locked(bio_queue_data->map, vio,
|
||||
- ELEVATOR_BACK_MERGE);
|
||||
- next_vio = get_mergeable_locked(bio_queue_data->map, vio,
|
||||
- ELEVATOR_FRONT_MERGE);
|
||||
+ prev_vio = get_mergeable_locked(bio_queue_data->map, vio, true);
|
||||
+ next_vio = get_mergeable_locked(bio_queue_data->map, vio, false);
|
||||
if (prev_vio == next_vio) {
|
||||
next_vio = NULL;
|
||||
}
|
||||
--
|
||||
2.31.1
|
||||
|
@ -6,12 +6,14 @@
|
||||
%define kmod_name kvdo
|
||||
%define kmod_driver_version %{gittag}
|
||||
%define kmod_rpm_release %{spec_release}
|
||||
%define kmod_kernel_version 5.14.0-34.el9
|
||||
%define kmod_kernel_version 5.14.0-37.el9
|
||||
%define kmod_headers_version %(rpm -qa kernel-devel | sed 's/^kernel-devel-//')
|
||||
%define kmod_kbuild_dir .
|
||||
%define kmod_devel_package 0
|
||||
|
||||
Source0: https://github.com/dm-vdo/%{kmod_name}/archive/%{commit}/%{kmod_name}-%{shortcommit}.tar.gz
|
||||
Patch0: 0001-Eliminate-use-of-bvec_kmap_irq.patch
|
||||
Patch1: 0002-Removed-usage-of-removed-elevator-constants.patch
|
||||
|
||||
%define findpat %( echo "%""P" )
|
||||
|
||||
@ -104,6 +106,8 @@ printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --dracut=/usr/bin/dracu
|
||||
|
||||
%prep
|
||||
%setup -n %{kmod_name}-%{commit}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%{nil}
|
||||
set -- *
|
||||
mkdir source
|
||||
@ -155,6 +159,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
* Sun Dec 19 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-9
|
||||
- Rebuilt for latest kernel.
|
||||
- Related: rhbz#2000926
|
||||
- Stopped using bvec_kmap_irq as it has been removed.
|
||||
- Removed usage of removed elevator constants
|
||||
- Resolves: rhbz#2035003
|
||||
|
||||
* Wed Dec 15 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-8
|
||||
- Rebuilt for latest kernel.
|
||||
|
Loading…
Reference in New Issue
Block a user