[Devel] [PATCH RH9 06/12] dm-qcow2: Use handle_md_page() instead of md_page_find_or_postpone()

Kirill Tkhai ktkhai at virtuozzo.com
Wed Jan 19 19:17:26 MSK 2022


This is to make further modifications easier.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-qcow2-map.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 1aad38fe9ee9..6da6339f1213 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -2280,8 +2280,8 @@ static int relocate_refcount_table(struct qcow2 *qcow2, struct qio **qio)
 			WARN_ON_ONCE(1);
 			goto err_free_r2_pages;
 		}
-		md = md_page_find_or_postpone(qcow2, r1.page_id, NULL);
-		if (WARN_ON_ONCE(!md))
+		ret = handle_md_page(qcow2, r1.page_id, NULL, &md);
+		if (WARN_ON_ONCE(ret <= 0))
 			goto err_free_r2_pages;
 		spin_lock_irq(&qcow2->md_pages_lock);
 		set_u64_to_be_page(md->page, r1.index_in_page, i);
@@ -2309,8 +2309,8 @@ static int relocate_refcount_table(struct qcow2 *qcow2, struct qio **qio)
 
 err_free_r2_pages:
 	for (i = end; i < r2_end; i += clu_size) {
-		md = md_page_find_or_postpone(qcow2, i >> PAGE_SHIFT, NULL);
-		if (!md)
+		ret = handle_md_page(qcow2, i >> PAGE_SHIFT, NULL, &md);
+		if (ret <= 0)
 			break;
 		spin_lock_irq(&qcow2->md_pages_lock);
 		md_page_erase(qcow2, md);




More information about the Devel mailing list