[Devel] [PATCH RHEL9 COMMIT] dm-ploop: Fix obsolete comments
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Nov 16 17:48:30 MSK 2021
The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.10.28
------>
commit 8b59a2a3299bc45f401331ec04917d0909596584
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Tue Nov 16 17:48:30 2021 +0300
dm-ploop: Fix obsolete comments
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/md/dm-ploop-bat.c | 2 +-
drivers/md/dm-ploop-map.c | 22 +++-------------------
2 files changed, 4 insertions(+), 20 deletions(-)
diff --git a/drivers/md/dm-ploop-bat.c b/drivers/md/dm-ploop-bat.c
index c84cc939d8c6..347d5ff265ba 100644
--- a/drivers/md/dm-ploop-bat.c
+++ b/drivers/md/dm-ploop-bat.c
@@ -489,7 +489,7 @@ int ploop_add_delta(struct ploop *ploop, u32 level, struct file *file, bool is_r
size_in_clus = POS_TO_CLU(ploop, file_size);
}
- ret = -EBADSLT;
+ ret = -EBADSLT; /* Lower delta can't be bigger then upper */
if (level != top_level(ploop) &&
size_in_clus > deltas[level + 1].size_in_clus)
goto out;
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 8c356de05469..3873b7000953 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -87,7 +87,7 @@ void init_pio(struct ploop *ploop, unsigned int bi_op, struct pio *pio)
pio->level = BAT_LEVEL_INVALID;
}
-/* Get clu related to pio sectors */
+/* Check that rq end byte is not behind end of device */
static int ploop_rq_valid(struct ploop *ploop, struct request *rq)
{
sector_t sector = ploop_rq_pos(ploop, rq);
@@ -450,16 +450,6 @@ static void inc_nr_inflight(struct ploop *ploop, struct pio *pio)
}
}
-/*
- * Note, that do_ploop_work() waits final ref dec_nr_inflight()
- * (e.g., on grow), so the code decrementing the counter can't
- * depend on the work or some actions it makes.
- *
- * The only intended usecase is that the counter is decremented
- * from endio of bios submitted to underlined device (loop) or
- * from ki_complete of requests submitted to delta files
- * (while increment occurs just right before the submitting).
- */
static void dec_nr_inflight(struct ploop *ploop, struct pio *pio)
{
if (pio->ref_index != PLOOP_REF_INDEX_INVALID) {
@@ -1474,19 +1464,13 @@ static int process_one_deferred_bio(struct ploop *ploop, struct pio *pio)
u8 level;
bool ret;
- /*
- * Unlocked, since no one can update BAT in parallel:
- * we update BAT only 1)from *this* kwork, and 2)from
- * ploop_advance_local_after_bat_wb(), which we start
- * and wait synchronously from *this* kwork.
- */
clu = SEC_TO_CLU(ploop, sector);
- dst_clu = ploop_bat_entries(ploop, clu, &level, &md);
-
if (postpone_if_cluster_locked(ploop, pio, clu))
goto out;
+ dst_clu = ploop_bat_entries(ploop, clu, &level, &md);
if (op_is_discard(pio->bi_op)) {
+ /* FIXME: check there is no parallel alloc */
handle_discard_pio(ploop, pio, clu, dst_clu);
goto out;
}
More information about the Devel
mailing list