[Devel] [PATCH RHEL8 COMMIT] ploop: Kill {inc, dec}_nr_inflight_raw()
Konstantin Khorenko
khorenko at virtuozzo.com
Mon May 24 12:57:19 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.31
------>
commit db9ecd9d46ba4d7a2524d7eb3a7d18c1bc6923c8
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Mon May 24 12:57:19 2021 +0300
ploop: Kill {inc,dec}_nr_inflight_raw()
They are the same as inc_nr_inflight() and dec_nr_inflight()
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
=====================
Patchset description:
ploop: Truncate top delta from kernel
and refactoring at tail.
https://jira.sw.ru/browse/PSBM-129278
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/md/dm-ploop-map.c | 28 +++++++++-------------------
1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index fced934b5b7a..faebdf2d8a50 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -369,21 +369,16 @@ static void add_endio_pio(struct pio *head, struct pio *pio)
list_add_tail(&pio->list, &head->endio_list);
}
-static void inc_nr_inflight_raw(struct ploop *ploop, struct pio *h)
+static void inc_nr_inflight(struct ploop *ploop, struct pio *pio)
{
unsigned char ref_index = ploop->inflight_bios_ref_index;
- if (!WARN_ON_ONCE(h->ref_index != PLOOP_REF_INDEX_INVALID)) {
+ if (!WARN_ON_ONCE(pio->ref_index != PLOOP_REF_INDEX_INVALID)) {
percpu_ref_get(&ploop->inflight_bios_ref[ref_index]);
- h->ref_index = ref_index;
+ pio->ref_index = ref_index;
}
}
-static void inc_nr_inflight(struct ploop *ploop, struct pio *pio)
-{
- inc_nr_inflight_raw(ploop, pio);
-}
-
/*
* Note, that do_ploop_work() waits final ref dec_nr_inflight()
* (e.g., on grow), so the code decrementing the counter can't
@@ -394,17 +389,12 @@ static void inc_nr_inflight(struct ploop *ploop, struct pio *pio)
* from ki_complete of requests submitted to delta files
* (while increment occurs just right before the submitting).
*/
-static void dec_nr_inflight_raw(struct ploop *ploop, struct pio *h)
-{
- if (h->ref_index != PLOOP_REF_INDEX_INVALID) {
- percpu_ref_put(&ploop->inflight_bios_ref[h->ref_index]);
- h->ref_index = PLOOP_REF_INDEX_INVALID;
- }
-}
-
static void dec_nr_inflight(struct ploop *ploop, struct pio *pio)
{
- dec_nr_inflight_raw(ploop, pio);
+ if (pio->ref_index != PLOOP_REF_INDEX_INVALID) {
+ percpu_ref_put(&ploop->inflight_bios_ref[pio->ref_index]);
+ pio->ref_index = PLOOP_REF_INDEX_INVALID;
+ }
}
static void link_endio_hook(struct ploop *ploop, struct pio *new, struct rb_root *root,
@@ -1109,7 +1099,7 @@ static void ploop_cow_endio(struct pio *cluster_pio, void *data, blk_status_t bi
list_add_tail(&cluster_pio->list, &ploop->delta_cow_action_list);
spin_unlock_irqrestore(&ploop->deferred_lock, flags);
- dec_nr_inflight_raw(ploop, &cow->hook);
+ dec_nr_inflight(ploop, &cow->hook);
queue_work(ploop->wq, &ploop->worker);
}
@@ -1247,7 +1237,7 @@ static void submit_cluster_write(struct ploop_cow *cow)
BUG_ON(irqs_disabled());
read_lock_irq(&ploop->bat_rwlock);
- inc_nr_inflight_raw(ploop, &cow->hook);
+ inc_nr_inflight(ploop, &cow->hook);
read_unlock_irq(&ploop->bat_rwlock);
pio->endio_cb = ploop_cow_endio;
pio->endio_cb_data = cow;
More information about the Devel
mailing list