[Devel] [PATCH RHEL8 COMMIT] dm-qcow2: Simplify complete_metadata_writeback()

Konstantin Khorenko khorenko at virtuozzo.com
Fri Aug 13 15:26:50 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-305.3.1.vz8.7.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-305.3.1.vz8.7.6
------>
commit 7a85682e43e15c7a5b5978d3a1ed77665c1aab02
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Aug 13 15:26:50 2021 +0300

    dm-qcow2: Simplify complete_metadata_writeback()
    
    Use qio_list_pop().
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    ====================
    It's a preparation for https://jira.sw.ru/browse/PSBM-132049
---
 drivers/md/dm-qcow2-map.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 64bb185ac7e9..84f8dac782bf 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -3478,9 +3478,7 @@ static int complete_metadata_writeback(struct qcow2 *qcow2)
 	if (unlikely(fsync_ret))
 		pr_err_ratelimited("qcow2: can't sync md: %d\n", fsync_ret);
 
-	while (!list_empty(&wb_list)) {
-		qio = list_first_entry(&wb_list, struct qio, link);
-		list_del(&qio->link);
+	while ((qio = qio_list_pop(&wb_list)) != NULL) {
 		md = qio->ext->md;
 		qvec = qio->data;
 		ret = qio->ret;


More information about the Devel mailing list