[Devel] [PATCH RHEL8 COMMIT] ploop: Pass @ploop to md_page_cluster_is_in_top_delta()
Konstantin Khorenko
khorenko at virtuozzo.com
Tue May 11 18:30:59 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.27
------>
commit 9106aab1220876745e867eaac594199196f40dec
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Tue May 11 18:30:59 2021 +0300
ploop: Pass @ploop to md_page_cluster_is_in_top_delta()
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
=====================
Patchset description:
ploop: Preparation to kill-loop from dm-ploop (series 4)
Currently, ploop requires underlining loop for top delta. This is overkill,
since we may submit bios directly to fs, without using it.
Initially there was a possibility, we may use device-mapper format snapshots
instead of ploop-based. But we don't do that, so we have to use loop for top
delta and directly submit bios to the rest of deltas. So, these two ways to do
the same actions are wrong.
This is preparations #3 for further series.
Let's this goes to testing earlier.
Kirill Tkhai (8):
ploop: Fix prealloc_md_pages() defaults
ploop: Move alloc wq up
ploop: Pass nr_deltas to parse_bat_entries()
ploop: Pass @ploop to md_page_cluster_is_in_top_delta()
ploop: Kill "message snapshot" interface
ploop: Introduce top_level()
ploop: Do not try to track bios on resize
ploop: Make fields in dm_ploop_endio_hook separate
https://jira.sw.ru/browse/PSBM-123654
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/md/dm-ploop-cmd.c | 6 +++---
drivers/md/dm-ploop.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index f259ff5d7652..3961155cf4fd 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -46,7 +46,7 @@ static void ploop_advance_holes_bitmap(struct ploop *ploop,
init_bat_entries_iter(ploop, md->id, &i, &end);
bat_entries = kmap_atomic(md->page);
for (; i <= end; i++) {
- if (!md_page_cluster_is_in_top_delta(md, i))
+ if (!md_page_cluster_is_in_top_delta(ploop, md, i))
continue;
dst_cluster = bat_entries[i];
/* This may happen after grow->shrink->(now) grow */
@@ -138,7 +138,7 @@ static unsigned int ploop_find_bat_entry(struct ploop *ploop,
for (; i <= end; i++) {
if (bat_entries[i] != dst_cluster)
continue;
- if (md_page_cluster_is_in_top_delta(md, i)) {
+ if (md_page_cluster_is_in_top_delta(ploop, md, i)) {
cluster = page_clu_idx_to_bat_clu(md->id, i);
break;
}
@@ -728,7 +728,7 @@ static void process_notify_delta_merged(struct ploop *ploop,
init_bat_entries_iter(ploop, md->id, &i, &end);
bat_entries = kmap_atomic(md->page);
for (; i <= end; i++) {
- if (md_page_cluster_is_in_top_delta(md, i) ||
+ if (md_page_cluster_is_in_top_delta(ploop, md, i) ||
delta_bat_entries[i] == BAT_ENTRY_NONE ||
md->bat_levels[i] < level)
continue;
diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index 45db3ec67950..3a64522187a8 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -410,8 +410,8 @@ static inline bool cluster_is_in_top_delta(struct ploop *ploop,
return true;
}
-static inline bool md_page_cluster_is_in_top_delta(struct md_page *md,
- unsigned int cluster)
+static inline bool md_page_cluster_is_in_top_delta(struct ploop *ploop,
+ struct md_page *md, unsigned int cluster)
{
unsigned int count, *bat_entries;
bool ret = true;
More information about the Devel
mailing list