Blame SOURCES/0002-Removed-usage-of-removed-elevator-constants.patch

f264a0
From 4b31b2a3e9ff5ee92d2204a5c0850d329945121b Mon Sep 17 00:00:00 2001
f264a0
From: Andrew Walsh <awalsh@redhat.com>
f264a0
Date: Thu, 23 Dec 2021 19:05:01 -0500
f264a0
Subject: [PATCH] Removed usage of removed elevator constants.
f264a0
f264a0
---
f264a0
 vdo/ioSubmitter.c | 27 ++++++++-------------------
f264a0
 1 file changed, 8 insertions(+), 19 deletions(-)
f264a0
f264a0
diff --git a/vdo/ioSubmitter.c b/vdo/ioSubmitter.c
f264a0
index b4e571ab..a0628992 100644
f264a0
--- a/vdo/ioSubmitter.c
f264a0
+++ b/vdo/ioSubmitter.c
f264a0
@@ -305,25 +305,22 @@ static void process_bio_map(struct vdo_work_item *item)
f264a0
  *
f264a0
  * @param map         The bio map to use for merging
f264a0
  * @param vio         The vio we want to merge
f264a0
- * @param merge_type  The type of merging we want to try
f264a0
+ * @param back_merge  Set to true for a back merge, false for a front merge
f264a0
  *
f264a0
  * @return the vio to merge to, NULL if no merging is possible
f264a0
  */
f264a0
 static struct vio *get_mergeable_locked(struct int_map *map,
f264a0
 					struct vio *vio,
f264a0
-					unsigned int merge_type)
f264a0
+					bool back_merge)
f264a0
 {
f264a0
 	struct bio *bio = vio->bio;
f264a0
 	sector_t merge_sector = get_bio_sector(bio);
f264a0
 	struct vio *vio_merge;
f264a0
 
f264a0
-	switch (merge_type) {
f264a0
-	case ELEVATOR_BACK_MERGE:
f264a0
+	if (back_merge) {
f264a0
 		merge_sector -= VDO_SECTORS_PER_BLOCK;
f264a0
-		break;
f264a0
-	case ELEVATOR_FRONT_MERGE:
f264a0
+        } else {
f264a0
 		merge_sector += VDO_SECTORS_PER_BLOCK;
f264a0
-		break;
f264a0
 	}
f264a0
 
f264a0
 	vio_merge = int_map_get(map, merge_sector);
f264a0
@@ -345,20 +342,14 @@ static struct vio *get_mergeable_locked(struct int_map *map,
f264a0
 		return NULL;
f264a0
 	}
f264a0
 
f264a0
-	switch (merge_type) {
f264a0
-	case ELEVATOR_BACK_MERGE:
f264a0
+	if (back_merge) {
f264a0
 		if (get_bio_sector(vio_merge->bios_merged.tail) !=
f264a0
 		    merge_sector) {
f264a0
 			return NULL;
f264a0
 		}
f264a0
-		break;
f264a0
-
f264a0
-	case ELEVATOR_FRONT_MERGE:
f264a0
-		if (get_bio_sector(vio_merge->bios_merged.head) !=
f264a0
+        } else if (get_bio_sector(vio_merge->bios_merged.head) !=
f264a0
 		    merge_sector) {
f264a0
 			return NULL;
f264a0
-		}
f264a0
-		break;
f264a0
 	}
f264a0
 
f264a0
 	return vio_merge;
f264a0
@@ -422,10 +413,8 @@ static bool try_bio_map_merge(struct bio_queue_data *bio_queue_data,
f264a0
 	struct vio *prev_vio, *next_vio;
f264a0
 
f264a0
 	mutex_lock(&bio_queue_data->lock);
f264a0
-	prev_vio = get_mergeable_locked(bio_queue_data->map, vio,
f264a0
-					ELEVATOR_BACK_MERGE);
f264a0
-	next_vio = get_mergeable_locked(bio_queue_data->map, vio,
f264a0
-				        ELEVATOR_FRONT_MERGE);
f264a0
+	prev_vio = get_mergeable_locked(bio_queue_data->map, vio, true);
f264a0
+	next_vio = get_mergeable_locked(bio_queue_data->map, vio, false);
f264a0
 	if (prev_vio == next_vio) {
f264a0
 		next_vio = NULL;
f264a0
 	}
f264a0
-- 
f264a0
2.31.1
f264a0