From patchwork Tue Apr 19 14:16:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Cody X-Patchwork-Id: 612173 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qq6Xd0Yk4z9t8x for ; Wed, 20 Apr 2016 00:17:21 +1000 (AEST) Received: from localhost ([::1]:58904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asWSs-00040L-Um for incoming@patchwork.ozlabs.org; Tue, 19 Apr 2016 10:17:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asWSB-0002UU-VJ for qemu-devel@nongnu.org; Tue, 19 Apr 2016 10:16:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asWS6-0004BV-4f for qemu-devel@nongnu.org; Tue, 19 Apr 2016 10:16:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asWS4-0004Al-7a; Tue, 19 Apr 2016 10:16:28 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EEE8CC04B301; Tue, 19 Apr 2016 14:16:27 +0000 (UTC) Received: from localhost (ovpn-112-74.phx2.redhat.com [10.3.112.74]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3JEGQBG018501 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=NO); Tue, 19 Apr 2016 10:16:27 -0400 From: Jeff Cody To: qemu-block@nongnu.org Date: Tue, 19 Apr 2016 10:16:20 -0400 Message-Id: <0218dcc50268dc91bdc2c37aaad10f16bce3450d.1461075204.git.jcody@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.6 v3 2/3] block/gluster: code movement of qemu_gluster_close() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, pkarampu@redhat.com, rwheeler@redhat.com, qemu-devel@nongnu.org, rgowdapp@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Move qemu_gluster_close() further up in the file, in preparation for the next patch, to avoid a forward declaration. Signed-off-by: Jeff Cody --- block/gluster.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index b0e2cc2..d9aace6 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -589,6 +589,17 @@ static coroutine_fn int qemu_gluster_co_writev(BlockDriverState *bs, return qemu_gluster_co_rw(bs, sector_num, nb_sectors, qiov, 1); } +static void qemu_gluster_close(BlockDriverState *bs) +{ + BDRVGlusterState *s = bs->opaque; + + if (s->fd) { + glfs_close(s->fd); + s->fd = NULL; + } + glfs_fini(s->glfs); +} + static coroutine_fn int qemu_gluster_co_flush_to_disk(BlockDriverState *bs) { int ret; @@ -661,17 +672,6 @@ static int64_t qemu_gluster_allocated_file_size(BlockDriverState *bs) } } -static void qemu_gluster_close(BlockDriverState *bs) -{ - BDRVGlusterState *s = bs->opaque; - - if (s->fd) { - glfs_close(s->fd); - s->fd = NULL; - } - glfs_fini(s->glfs); -} - static int qemu_gluster_has_zero_init(BlockDriverState *bs) { /* GlusterFS volume could be backed by a block device */