Skip to contentSkip to conversation

qcow2: Use QLIST_FOREACH_SAFE macro

PATCH Applied Stefan Hajnoczi 2 participants 2 messages Apr 15, 2010 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qcow2: Use QLIST_FOREACH_SAFE macro

---
 block/qcow2.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
block/qcow2.c +2 -8
index 11ce8d1..9b986ae 100644
@@ -539,14 +539,8 @@ static void run_dependent_requests(QCowL2Meta *m)
         QLIST_REMOVE(m, next_in_flight);
     }
 
-    /*
-     * Restart all dependent requests.
-     * Can't use QLIST_FOREACH here - the next link might not be the same
-     * any more after the callback  (request could depend on a different
-     * request now)
-     */
-    for (req = m->dependent_requests.lh_first; req != NULL; req = next) {
-        next = req->next_depend.le_next;
+    /* Restart all dependent requests */
+    QLIST_FOREACH_SAFE(req, &m->dependent_requests, next_depend, next) {
         qcow_aio_write_cb(req, 0);
     }
 
Signature · 1 line
1.7.0