From nobody Wed Nov 5 17:59:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496642192144596.3700317676684; Sun, 4 Jun 2017 22:56:32 -0700 (PDT) Received: from localhost ([::1]:59730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHl0A-0000Gt-JO for importer@patchew.org; Mon, 05 Jun 2017 01:56:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHkwe-0006AQ-76 for qemu-devel@nongnu.org; Mon, 05 Jun 2017 01:52:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHkwd-0007tz-6l for qemu-devel@nongnu.org; Mon, 05 Jun 2017 01:52:52 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:33977) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHkwc-0007t2-VE; Mon, 05 Jun 2017 01:52:51 -0400 Received: by mail-pf0-x241.google.com with SMTP id w69so19511593pfk.1; Sun, 04 Jun 2017 22:52:50 -0700 (PDT) Received: from linux.local ([47.247.8.225]) by smtp.gmail.com with ESMTPSA id s68sm961639pfj.33.2017.06.04.22.52.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Jun 2017 22:52:49 -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=UbvhKAlw6KajgZTK1bh66brxAzpPyakf/4X4KT42orz99I2ishwvQDdAKI2YCrZq1j nmDp9gR8/P+YNWdCbaKQ13iXt1VLrx5vMIPZBMkBTN6S9YrjjzkdLwRbdep0IuDIOJWJ TB3DisWQEq6brHtAg9M2V7ixfTytkusMJQoUM2Qk3Ehd0dFjqSbRXA3m8g+QmXGgroIo AYyh6JyTy6kY+Hq0buXohJDUNljzZ/L9SQvhDzEm3zor8Fkj1CTYBMxHTz6THyiH6wFx jcimsVC0TDYhOsD7WGXvPnq/IR8wGn/hqISsbkPpePTBpCYwN+p/oifTs4MlyLa1/P8U TS8g== 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=juBh6EF7Bt1omHZJamddM3dYjIMrB7eP/L5Pn5Y/pk2XIBetmM62YzT+ElUClghQle pkzLx1q74W6A5f0uWvosIv5j6C+ORuxEYQ7dr3H94J0hVIvUhNiiQTlTe0MpVTIFM+i5 Zkj3bIJ9wM289vFAp7DNrMl6OLtgEDn2TeYKLcLabqn8YI8XCawQZzboIdzINzr+Ekuy 7sOZ5WdUqd5YNmEUrcQC11aMvlL/aQlZrTvSMtF4mNy6OH2qB0+pA19MVezwv9r9yNHm nXRhw0cmjw0oXuHSaWUedkODm1YGXqm9LJYb5024jBrILurhZGOAm35qKQ6FAx/emK0d 2Sag== X-Gm-Message-State: AODbwcADiMa4HSA33aiRfd8UcAm+GAu0PNb4B8zdNAWnAWLngIyewbEY LXZTb/zAoDWMpbYnBdQ= X-Received: by 10.84.217.149 with SMTP id p21mr13115656pli.121.1496641969993; Sun, 04 Jun 2017 22:52:49 -0700 (PDT) From: Ashijeet Acharya To: famz@redhat.com Date: Mon, 5 Jun 2017 11:23:22 +0530 Message-Id: <1496642007-8309-4-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1496642007-8309-1-git-send-email-ashijeetacharya@gmail.com> References: <1496642007-8309-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 v5 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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, VmdkMeta= Data *m_data, } =20 /** - * 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, VmdkMe= taData *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 =3D get_cluster_offset(bs, extent, NULL, - sector_num * 512, false, &offset, - 0, 0); + ret =3D vmdk_get_cluster_offset(bs, extent, NULL, + sector_num * 512, false, &offset, + 0, 0); qemu_co_mutex_unlock(&s->lock); =20 index_in_cluster =3D vmdk_find_index_in_cluster(extent, sector_num); @@ -1497,8 +1497,8 @@ vmdk_co_preadv(BlockDriverState *bs, uint64_t offset,= uint64_t bytes, ret =3D -EIO; goto fail; } - ret =3D get_cluster_offset(bs, extent, NULL, - offset, false, &cluster_offset, 0, 0); + ret =3D vmdk_get_cluster_offset(bs, extent, NULL, + offset, false, &cluster_offset, 0, 0= ); offset_in_cluster =3D vmdk_find_offset_in_cluster(extent, offset); =20 n_bytes =3D MIN(bytes, extent->cluster_sectors * BDRV_SECTOR_SIZE @@ -1584,10 +1584,10 @@ static int vmdk_pwritev(BlockDriverState *bs, uint6= 4_t offset, n_bytes =3D MIN(bytes, extent->cluster_sectors * BDRV_SECTOR_SIZE - offset_in_cluster); =20 - ret =3D get_cluster_offset(bs, extent, &m_data, offset, - !(extent->compressed || zeroed), - &cluster_offset, offset_in_cluster, - offset_in_cluster + n_bytes); + ret =3D 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 =3D=3D 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 =3D get_cluster_offset(bs, extent, &m_data, offset, - true, &cluster_offset, 0, 0); + ret =3D vmdk_get_cluster_offset(bs, extent, &m_data, offse= t, + true, &cluster_offset, 0, 0); } } if (ret =3D=3D VMDK_ERROR) { @@ -2229,9 +2229,9 @@ static int vmdk_check(BlockDriverState *bs, BdrvCheck= Result *result, sector_num); break; } - ret =3D get_cluster_offset(bs, extent, NULL, - sector_num << BDRV_SECTOR_BITS, - false, &cluster_offset, 0, 0); + ret =3D vmdk_get_cluster_offset(bs, extent, NULL, + sector_num << BDRV_SECTOR_BITS, + false, &cluster_offset, 0, 0); if (ret =3D=3D VMDK_ERROR) { fprintf(stderr, "ERROR: could not get cluster_offset for sector %" --=20 2.6.2