[Devel] [PATCH RHEL8 COMMIT] ploop: Return md page from ploop_bat_entries()
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Jun 29 16:08:17 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.50
------>
commit 17658632197a0d7d8be80b1a52f6d1b018ad3205
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Tue Jun 29 16:08:17 2021 +0300
ploop: Return md page from ploop_bat_entries()
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
==========================
Preparation for #PSBM-124550 (part 2)
Kirill Tkhai (14):
ploop: Kill "get_delta_name" alias
ploop: Use initial pio for COW
ploop: Rename cluster_pio into aux_pio
ploop: Shorten variable names
ploop: Rename in submit_cluster_write()
ploop: Use defer_pios() instead of manual code
ploop: Use array of pios instead of separate lists
ploop: Generalize dispatch_pios usage
ploop: Unify process_delta_wb()
ploop: Remove unused struct member
ploop: Rename page_nr
ploop: Return md page from ploop_bat_entries()
ploop: Kill dead check in ploop_attach_end_action()
ploop: Delay bio if md page is BUSY
---
drivers/md/dm-ploop-cmd.c | 2 +-
drivers/md/dm-ploop-map.c | 3 ++-
drivers/md/dm-ploop.h | 7 +++++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 363bf18371d6..bf9e2c04138a 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -728,7 +728,7 @@ static int process_update_delta_index(struct ploop *ploop, u8 level,
while (sscanf(map, "%u:%u;%n", &clu, &dst_clu, &n) == 2) {
if (clu >= ploop->nr_bat_entries)
break;
- if (ploop_bat_entries(ploop, clu, NULL) == BAT_ENTRY_NONE)
+ if (ploop_bat_entries(ploop, clu, NULL, NULL) == BAT_ENTRY_NONE)
break;
map += n;
}
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 0469147586d3..72aec0573ca3 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1371,6 +1371,7 @@ static int process_one_deferred_bio(struct ploop *ploop, struct pio *pio,
{
sector_t sector = pio->bi_iter.bi_sector;
unsigned int clu, dst_clu;
+ struct md_page *md;
u8 level;
bool ret;
@@ -1381,7 +1382,7 @@ static int process_one_deferred_bio(struct ploop *ploop, struct pio *pio,
* and wait synchronously from *this* kwork.
*/
clu = SEC_TO_CLU(ploop, sector);
- dst_clu = ploop_bat_entries(ploop, clu, &level);
+ dst_clu = ploop_bat_entries(ploop, clu, &level, &md);
if (postpone_if_cluster_locked(ploop, pio, clu))
goto out;
diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index 30bff7fd582e..ebe0c134c148 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -386,7 +386,8 @@ extern struct md_page * md_page_find(struct ploop *ploop, unsigned int id);
*/
static inline unsigned int ploop_bat_entries(struct ploop *ploop,
unsigned int clu,
- u8 *bat_level)
+ u8 *bat_level,
+ struct md_page **md_ret)
{
unsigned int *bat_entries, dst_clu, id;
struct md_page *md;
@@ -400,6 +401,8 @@ static inline unsigned int ploop_bat_entries(struct ploop *ploop,
if (bat_level)
*bat_level = md->bat_levels[clu];
+ if (md_ret)
+ *md_ret = md;
bat_entries = kmap_atomic(md->page);
dst_clu = bat_entries[clu];
@@ -415,7 +418,7 @@ static inline bool cluster_is_in_top_delta(struct ploop *ploop,
if (WARN_ON(clu >= ploop->nr_bat_entries))
return false;
- dst_clu = ploop_bat_entries(ploop, clu, &level);
+ dst_clu = ploop_bat_entries(ploop, clu, &level, NULL);
if (dst_clu == BAT_ENTRY_NONE || level < top_level(ploop))
return false;
More information about the Devel
mailing list