[Devel] [RFC PATCH vz9 v4 18/33] dm-ploop: remove extra ploop_cluster_is_in_top_delta()
Alexander Atanasov
alexander.atanasov at virtuozzo.com
Mon Nov 4 13:59:13 MSK 2024
From: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
as we already got all info from ploop_bat_entries() earlier.
https://virtuozzo.atlassian.net/browse/VSTOR-91817
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
drivers/md/dm-ploop-map.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 5ec05d96bba1..905a58e6c2d3 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -610,7 +610,7 @@ static int ploop_zero_range(struct file *file, loff_t pos, loff_t len)
}
static int ploop_handle_discard_pio(struct ploop *ploop, struct pio *pio,
- u32 clu, u32 dst_clu)
+ u32 clu, u32 dst_clu, u8 level)
{
struct pio *inflight_h;
unsigned long flags;
@@ -629,7 +629,7 @@ static int ploop_handle_discard_pio(struct ploop *ploop, struct pio *pio,
return 1;
}
- if (!ploop_cluster_is_in_top_delta(ploop, clu)) {
+ if (dst_clu == BAT_ENTRY_NONE || level < ploop_top_level(ploop)) {
ploop_pio_endio(pio);
return 1;
}
@@ -1527,13 +1527,13 @@ static int ploop_process_one_deferred_bio(struct ploop *ploop, struct pio *pio)
dst_clu = ploop_bat_entries(ploop, clu, &level, &md);
if (op_is_discard(pio->bi_op)) {
/* FIXME: check there is no parallel alloc */
- ret = ploop_handle_discard_pio(ploop, pio, clu, dst_clu);
+ ret = ploop_handle_discard_pio(ploop, pio, clu, dst_clu, level);
if (ret)
goto handled;
goto executed;
}
- if (ploop_cluster_is_in_top_delta(ploop, clu)) {
+ if (!(dst_clu == BAT_ENTRY_NONE || level < ploop_top_level(ploop))) {
/* Already mapped */
if (ploop_pio_endio_if_merge_fake_pio(pio))
goto handled;
--
2.43.0
More information about the Devel
mailing list