From patchwork Fri Apr 23 15:30:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 50844 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 90D36B7D1F for ; Sat, 24 Apr 2010 02:25:21 +1000 (EST) Received: from localhost ([127.0.0.1]:60038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5Lgs-0006pm-Ll for incoming@patchwork.ozlabs.org; Fri, 23 Apr 2010 12:25:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O5Krn-0007oM-PC for qemu-devel@nongnu.org; Fri, 23 Apr 2010 11:32:31 -0400 Received: from [140.186.70.92] (port=50617 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5Krm-0007nA-DM for qemu-devel@nongnu.org; Fri, 23 Apr 2010 11:32:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O5Krk-00061c-Nm for qemu-devel@nongnu.org; Fri, 23 Apr 2010 11:32:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44974) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O5Krj-00061N-Sg for qemu-devel@nongnu.org; Fri, 23 Apr 2010 11:32:28 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3NFWQNJ026000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 23 Apr 2010 11:32:26 -0400 Received: from localhost.localdomain (vpn2-9-155.ams2.redhat.com [10.36.9.155]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3NFVOCU020467; Fri, 23 Apr 2010 11:32:24 -0400 From: Kevin Wolf To: aliguori@linux.vnet.ibm.com Date: Fri, 23 Apr 2010 17:30:57 +0200 Message-Id: <1272036658-26776-26-git-send-email-kwolf@redhat.com> In-Reply-To: <1272036658-26776-1-git-send-email-kwolf@redhat.com> References: <1272036658-26776-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 25/26] qcow2: Use QLIST_FOREACH_SAFE macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/qcow2.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 30ded6a..f3e3cba 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -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); }