[Devel] [PATCH RH8 8/8] ploop: Shorten delta_bat_entries

Kirill Tkhai ktkhai at virtuozzo.com
Thu Jul 1 18:14:57 MSK 2021


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-bat.c |   10 +++++-----
 drivers/md/dm-ploop-cmd.c |   12 ++++++------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/md/dm-ploop-bat.c b/drivers/md/dm-ploop-bat.c
index 17c2fe46ed57..35275faee935 100644
--- a/drivers/md/dm-ploop-bat.c
+++ b/drivers/md/dm-ploop-bat.c
@@ -452,7 +452,7 @@ static void ploop_set_not_hole(struct ploop *ploop, u32 dst_clu)
 static void apply_delta_mappings(struct ploop *ploop, struct ploop_delta *deltas,
 				 u32 level, struct rb_root *md_root, u64 size_in_clus)
 {
-	map_index_t *bat_entries, *delta_bat_entries = NULL;
+	map_index_t *bat_entries, *d_bat_entries = NULL;
 	bool is_top_level, is_raw, stop = false;
 	struct md_page *md, *d_md = NULL;
 	u32 i, end, dst_clu, clu;
@@ -468,11 +468,11 @@ static void apply_delta_mappings(struct ploop *ploop, struct ploop_delta *deltas
 	ploop_for_each_md_page(ploop, md, node) {
 		bat_entries = kmap_atomic(md->page);
 		if (!is_raw)
-			delta_bat_entries = kmap_atomic(d_md->page);
+			d_bat_entries = kmap_atomic(d_md->page);
 
 		if (is_top_level && md->id == 0 && !is_raw) {
 			/* bat_entries before PLOOP_MAP_OFFSET is hdr */
-			memcpy(bat_entries, delta_bat_entries,
+			memcpy(bat_entries, d_bat_entries,
 			       sizeof(struct ploop_pvd_header));
 		}
 
@@ -490,7 +490,7 @@ static void apply_delta_mappings(struct ploop *ploop, struct ploop_delta *deltas
 			}
 
 			if (!is_raw)
-				dst_clu = delta_bat_entries[i];
+				dst_clu = d_bat_entries[i];
 			else
 				dst_clu = clu;
 
@@ -505,7 +505,7 @@ static void apply_delta_mappings(struct ploop *ploop, struct ploop_delta *deltas
 
 		kunmap_atomic(bat_entries);
 		if (!is_raw)
-			kunmap_atomic(delta_bat_entries);
+			kunmap_atomic(d_bat_entries);
 		if (stop)
 			break;
 		if (!is_raw)
diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 005fa32aba3a..68da59b63e7c 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -684,7 +684,7 @@ static void notify_delta_merged(struct ploop *ploop, u8 level,
 				struct rb_root *md_root,
 				bool forward, u32 size_in_clus)
 {
-	u32 i, end, *bat_entries, *delta_bat_entries;
+	u32 i, end, *bat_entries, *d_bat_entries;
 	struct md_page *md, *d_md;
 	struct rb_node *node;
 	struct file *file;
@@ -697,14 +697,14 @@ static void notify_delta_merged(struct ploop *ploop, u8 level,
 	ploop_for_each_md_page(ploop, md, node) {
 		init_be_iter(size_in_clus, md->id, &i, &end);
 		bat_entries = kmap_atomic(md->page);
-		delta_bat_entries = kmap_atomic(d_md->page);
+		d_bat_entries = kmap_atomic(d_md->page);
 		for (; i <= end; i++) {
 			clu = page_clu_idx_to_bat_clu(md->id, i);
 			if (clu == size_in_clus - 1)
 				stop = true;
 
 			if (md_page_cluster_is_in_top_delta(ploop, md, i) ||
-			    delta_bat_entries[i] == BAT_ENTRY_NONE ||
+			    d_bat_entries[i] == BAT_ENTRY_NONE ||
 			    md->bat_levels[i] < level)
 				continue;
 
@@ -719,17 +719,17 @@ static void notify_delta_merged(struct ploop *ploop, u8 level,
 			 * 1)next delta (which became renumbered) or
 			 * 2)prev delta (if !@forward).
 			 */
-			bat_entries[i] = delta_bat_entries[i];
+			bat_entries[i] = d_bat_entries[i];
 			WARN_ON(bat_entries[i] == BAT_ENTRY_NONE);
 			if (!forward)
 				md->bat_levels[i]--;
 		}
 
 		kunmap_atomic(bat_entries);
-		kunmap_atomic(delta_bat_entries);
+		kunmap_atomic(d_bat_entries);
 		if (stop)
 			break;
-		d_md = md_next_entry(delta_md);
+		d_md = md_next_entry(d_md);
 	}
 
 	file = ploop->deltas[level].file;




More information about the Devel mailing list