From patchwork Thu Jun 29 09:23:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9816281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 314C96035F for ; Thu, 29 Jun 2017 09:25:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 267F628653 for ; Thu, 29 Jun 2017 09:25:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AD9F286E5; Thu, 29 Jun 2017 09:25:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9755F28653 for ; Thu, 29 Jun 2017 09:25:40 +0000 (UTC) Received: from localhost ([::1]:37934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQVhj-0006HS-RH for patchwork-qemu-devel@patchwork.kernel.org; Thu, 29 Jun 2017 05:25:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQVfC-0004bX-41 for qemu-devel@nongnu.org; Thu, 29 Jun 2017 05:23:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQVf7-0006o7-5F for qemu-devel@nongnu.org; Thu, 29 Jun 2017 05:23:02 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:34581) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQVf6-0006np-Tv; Thu, 29 Jun 2017 05:22:57 -0400 Received: by mail-pf0-x241.google.com with SMTP id d5so12387962pfe.1; Thu, 29 Jun 2017 02:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wlzoG7oQRHBbI3gL8iwuPmGQOHTo9rMYaIJacXohg3U=; b=pqMa5i35yOpoEdpyFZZ4BP51kpe9pfIbKybXOeUlWftcEJN6IyzhTgg4m0XYPJ+0ko EZRL++s47AJ7txUfWDTpIx9BE49IfO5zyMvN/aRGmDhC2fKIY3xpnmE5LdwDiDvZI+GR CANTpPbDa3K1Fr/58cdkYYq0GtDWEXnaGx8iRWh5PEdiiHUtMqZmWYrjhPTzmcoj8PW0 jQ11BBIaZWlEPlfza0Zu2QggenQiaRHgOhuPCBZFh11sOtDss24jT4t+rkQ3g58dfuSZ 6eF7kAc85k9RLaV3hRcML2NE26Wq6ha33FinAgU0W/O8t8dD+uUmFKT129XBuDkYchGa /nAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wlzoG7oQRHBbI3gL8iwuPmGQOHTo9rMYaIJacXohg3U=; b=udUP6adqUE5YNiGE8/7LrU4XUYrtc5tlpklJfZ36S5uhn6oOfwWt1Px7szuZg9OUd6 J2vD6ZW73MSL+x8CEbAElsUyhXYh1UF/Bb+6wk7OMb8w9wfbdu9nbyRJIpipaOzghb5k hTI2WqWbCFXFgMObSGNjFrHZsUNn6ObhbmyPfQm2Za21oyY74RRA4NByI7UlRhRvSRCM F1+F7YKqT72DqVFI8yN1Ksq+skr4UU0+AMWADiTFGnD8X6/DMoOcsOgYoHSQucBG92P4 /zvKHEke8UKi18Edeh6bV0zoUpjc52eLJUZE7Hq1zzUVpBVHOWhYfzPUqPPaOGeqSV0D ERUQ== X-Gm-Message-State: AKS2vOzGHoJmfoOaakExVxwQRfhlT6cbR4vLBZU59ewCNIOzYsapSR4V oXRfATxyiYBMDQ== X-Received: by 10.99.250.69 with SMTP id g5mr14301320pgk.11.1498728175994; Thu, 29 Jun 2017 02:22:55 -0700 (PDT) Received: from linux.local ([47.247.15.37]) by smtp.gmail.com with ESMTPSA id u9sm11031203pfg.127.2017.06.29.02.22.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jun 2017 02:22:55 -0700 (PDT) From: Ashijeet Acharya To: famz@redhat.com Date: Thu, 29 Jun 2017 14:53:36 +0530 Message-Id: <1498728221-23979-4-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1498728221-23979-1-git-send-email-ashijeetacharya@gmail.com> References: <1498728221-23979-1-git-send-email-ashijeetacharya@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PATCH v7 3/8] vmdk: Rename get_cluster_offset() to vmdk_get_cluster_offset() 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, qemu-block@nongnu.org, stefanha@gmail.com, qemu-devel@nongnu.org, mreitz@redhat.com, Ashijeet Acharya , jsnow@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Rename the existing get_cluster_offset() to vmdk_get_cluster_offset() and update name in all the callers accordingly. Signed-off-by: Ashijeet Acharya Reviewed-by: Fam Zheng --- block/vmdk.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 73ae786..f403981 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1144,7 +1144,7 @@ static int vmdk_L2update(VmdkExtent *extent, VmdkMetaData *m_data, } /** - * get_cluster_offset + * vmdk_get_cluster_offset * * Look up cluster offset in extent file by sector number, and store in * @cluster_offset. @@ -1163,14 +1163,14 @@ static int vmdk_L2update(VmdkExtent *extent, VmdkMetaData *m_data, * VMDK_UNALLOC if cluster is not mapped and @allocate is false. * VMDK_ERROR if failed. */ -static int get_cluster_offset(BlockDriverState *bs, - VmdkExtent *extent, - VmdkMetaData *m_data, - uint64_t offset, - bool allocate, - uint64_t *cluster_offset, - uint64_t skip_start_bytes, - uint64_t skip_end_bytes) +static int vmdk_get_cluster_offset(BlockDriverState *bs, + VmdkExtent *extent, + VmdkMetaData *m_data, + uint64_t offset, + bool allocate, + uint64_t *cluster_offset, + uint64_t skip_start_bytes, + uint64_t skip_end_bytes) { unsigned int l1_index, l2_offset, l2_index; int min_index, i, j; @@ -1304,9 +1304,9 @@ static int64_t coroutine_fn vmdk_co_get_block_status(BlockDriverState *bs, return 0; } qemu_co_mutex_lock(&s->lock); - ret = get_cluster_offset(bs, extent, NULL, - sector_num * 512, false, &offset, - 0, 0); + ret = vmdk_get_cluster_offset(bs, extent, NULL, + sector_num * 512, false, &offset, + 0, 0); qemu_co_mutex_unlock(&s->lock); index_in_cluster = vmdk_find_index_in_cluster(extent, sector_num); @@ -1497,8 +1497,8 @@ vmdk_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, ret = -EIO; goto fail; } - ret = get_cluster_offset(bs, extent, NULL, - offset, false, &cluster_offset, 0, 0); + ret = vmdk_get_cluster_offset(bs, extent, NULL, + offset, false, &cluster_offset, 0, 0); offset_in_cluster = vmdk_find_offset_in_cluster(extent, offset); n_bytes = MIN(bytes, extent->cluster_sectors * BDRV_SECTOR_SIZE @@ -1584,10 +1584,10 @@ static int vmdk_pwritev(BlockDriverState *bs, uint64_t offset, n_bytes = MIN(bytes, extent->cluster_sectors * BDRV_SECTOR_SIZE - offset_in_cluster); - ret = get_cluster_offset(bs, extent, &m_data, offset, - !(extent->compressed || zeroed), - &cluster_offset, offset_in_cluster, - offset_in_cluster + n_bytes); + ret = vmdk_get_cluster_offset(bs, extent, &m_data, offset, + !(extent->compressed || zeroed), + &cluster_offset, offset_in_cluster, + offset_in_cluster + n_bytes); if (extent->compressed) { if (ret == VMDK_OK) { /* Refuse write to allocated cluster for streamOptimized */ @@ -1596,8 +1596,8 @@ static int vmdk_pwritev(BlockDriverState *bs, uint64_t offset, return -EIO; } else { /* allocate */ - ret = get_cluster_offset(bs, extent, &m_data, offset, - true, &cluster_offset, 0, 0); + ret = vmdk_get_cluster_offset(bs, extent, &m_data, offset, + true, &cluster_offset, 0, 0); } } if (ret == VMDK_ERROR) { @@ -2229,9 +2229,9 @@ static int vmdk_check(BlockDriverState *bs, BdrvCheckResult *result, sector_num); break; } - ret = get_cluster_offset(bs, extent, NULL, - sector_num << BDRV_SECTOR_BITS, - false, &cluster_offset, 0, 0); + ret = vmdk_get_cluster_offset(bs, extent, NULL, + sector_num << BDRV_SECTOR_BITS, + false, &cluster_offset, 0, 0); if (ret == VMDK_ERROR) { fprintf(stderr, "ERROR: could not get cluster_offset for sector %"