From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1klu1T-00043I-Eh for mharc-grub-devel@gnu.org; Sun, 06 Dec 2020 08:24:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klu1R-00042j-KC for grub-devel@gnu.org; Sun, 06 Dec 2020 08:24:17 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:45427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klu1O-0001TC-SI for grub-devel@gnu.org; Sun, 06 Dec 2020 08:24:17 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 5D4DE917; Sun, 6 Dec 2020 08:24:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 06 Dec 2020 08:24:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=HgE6CPh6BDWlOKnr9qT+3Mm50py WUkE9wfpNv9iBLUM=; b=IGEWy3Ep2ByFZ+eV2vnFLlX1CNX9lzTT/6+3XToRGA8 sKlISjUTQxToOVJyNynPlVQuh0lS1WIGv6rO5jsW3vtnBRAkqI5mW5OOs2jf4pqJ XQER+tPNZAXgyGyKKdnftdJKgnu32osFighEPa7YxdIpg/HzF+NAS6S1HB8uXf25 8gOz/+cYM6tMlnoyhm19UvGOFfHUFqJz9iv2chYzAwqICDoBWDER0RFfsOttLFbe 5zPo9G8djnJUcCqF1uy5cMDhAm0NcEqpkFnk2pOIfnwi6bExa94tyf33mCxuYR89 kJNQQjRdnj0nWGqCbGb8FXOrwRG1cIQzTaKa83KIfmQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=HgE6CP h6BDWlOKnr9qT+3Mm50pyWUkE9wfpNv9iBLUM=; b=eZsEn9O7LmKqS1+bNsSh4l PQolqM/cMtil3pM6tP5RsoCLaPqMu0+HKC26S7kHEEPltq5vKfU1hVRDAr+5SHWl 0X7Ni7K3pvtMa+47FoR4J8ueDJe58vLgZilFHI/Rrfl4BH6Kx/emvdXozsMRNrj8 aHORCvOptpcm2DJUV05mjQABlEOwQDwe491x9GW4xvh9+kU7x62/4kpI1rsVMdJP txtukf0rCL7kSVF8k4NfgMxd8qeJEjMaI/Eo5esuFPf580Zu6aFEp40maMdk/Jcp VF/cQFecCH9s3m+7uUYTizYhuwHLqD8tM/2p+lXc9qmhmwOJ4f133yMILAD5mvWA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudejvddghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepjeejrddukeefrddujedruddutdenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: from vm-mail (x4db7116e.dyn.telefonica.de [77.183.17.110]) by mail.messagingengine.com (Postfix) with ESMTPA id 413D6108005F; Sun, 6 Dec 2020 08:24:09 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail (OpenSMTPD) with ESMTPSA id 4caaacc0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 6 Dec 2020 13:24:06 +0000 (UTC) Date: Sun, 6 Dec 2020 14:24:05 +0100 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper , Daniel Kiper Subject: Re: [PATCH v7 01/17] disk: Rename grub_disk_get_size to grub_disk_native_sectors Message-ID: References: <7e79d6fb16f363cbf94807997cee6ee0cb2e8543.1607098915.git.development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tlNbWsKFLQc7Pq1u" Content-Disposition: inline In-Reply-To: <7e79d6fb16f363cbf94807997cee6ee0cb2e8543.1607098915.git.development@efficientek.com> Received-SPF: pass client-ip=64.147.123.24; envelope-from=ps@pks.im; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2020 13:24:17 -0000 --tlNbWsKFLQc7Pq1u Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 04, 2020 at 10:43:30AM -0600, Glenn Washburn wrote: > The function grub_disk_get_size is confusingly named because it actually > returns a sector count where the sectors are sized in the grub native sec= tor > size. Rename to something more appropriate. >=20 > Suggested-by: Daniel Kiper >=20 > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/diskfilter.c | 12 ++++++------ > grub-core/disk/dmraid_nvidia.c | 2 +- > grub-core/disk/efi/efidisk.c | 2 +- > grub-core/disk/geli.c | 6 +++--- > grub-core/disk/ldm.c | 4 ++-- > grub-core/disk/luks.c | 2 +- > grub-core/disk/mdraid1x_linux.c | 2 +- > grub-core/disk/mdraid_linux.c | 2 +- > grub-core/fs/cbfs.c | 16 ++++++++-------- > grub-core/fs/nilfs2.c | 2 +- > grub-core/fs/zfs/zfs.c | 4 ++-- > grub-core/kern/disk.c | 2 +- > grub-core/kern/mips/arc/init.c | 2 +- > grub-core/normal/misc.c | 6 +++--- > grub-core/osdep/windows/platform.c | 2 +- > include/grub/disk.h | 4 ++-- > util/grub-install.c | 2 +- > util/grub-probe.c | 2 +- > 18 files changed, 37 insertions(+), 37 deletions(-) >=20 > diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c > index 86557f923..032011566 100644 > --- a/grub-core/disk/diskfilter.c > +++ b/grub-core/disk/diskfilter.c > @@ -148,7 +148,7 @@ scan_disk_partition_iter (grub_disk_t disk, grub_part= ition_t p, void *data) > if (m->disk && m->disk->id =3D=3D disk->id > && m->disk->dev->id =3D=3D disk->dev->id > && m->part_start =3D=3D grub_partition_get_start (disk->partition) > - && m->part_size =3D=3D grub_disk_get_size (disk)) > + && m->part_size =3D=3D grub_disk_native_sectors (disk)) > return 0; > } > =20 > @@ -1190,13 +1190,13 @@ insert_array (grub_disk_t disk, const struct grub= _diskfilter_pv_id *id, > =20 > grub_dprintf ("diskfilter", "Inserting %s (+%lld,%lld) into %s (%s)\n"= , disk->name, > (unsigned long long) grub_partition_get_start (disk->partition), > - (unsigned long long) grub_disk_get_size (disk), > + (unsigned long long) grub_disk_native_sectors (disk), > array->name, diskfilter->name); > #ifdef GRUB_UTIL > grub_util_info ("Inserting %s (+%" GRUB_HOST_PRIuLONG_LONG ",%" > GRUB_HOST_PRIuLONG_LONG ") into %s (%s)\n", disk->name, > (unsigned long long) grub_partition_get_start (disk->partition), > - (unsigned long long) grub_disk_get_size (disk), > + (unsigned long long) grub_disk_native_sectors (disk), > array->name, diskfilter->name); > array->driver =3D diskfilter; > #endif > @@ -1210,7 +1210,7 @@ insert_array (grub_disk_t disk, const struct grub_d= iskfilter_pv_id *id, > struct grub_diskfilter_lv *lv; > /* FIXME: Check whether the update time of the superblocks are > the same. */ > - if (pv->disk && grub_disk_get_size (disk) >=3D pv->part_size) > + if (pv->disk && grub_disk_native_sectors (disk) >=3D pv->part_size) > return GRUB_ERR_NONE; > pv->disk =3D grub_disk_open (disk->name); > if (!pv->disk) > @@ -1219,7 +1219,7 @@ insert_array (grub_disk_t disk, const struct grub_d= iskfilter_pv_id *id, > raid device, we shouldn't change it. */ > pv->start_sector -=3D pv->part_start; > pv->part_start =3D grub_partition_get_start (disk->partition); > - pv->part_size =3D grub_disk_get_size (disk); > + pv->part_size =3D grub_disk_native_sectors (disk); > =20 > #ifdef GRUB_UTIL > { > @@ -1311,7 +1311,7 @@ grub_diskfilter_get_pv_from_disk (grub_disk_t disk, > if (pv->disk && pv->disk->id =3D=3D disk->id > && pv->disk->dev->id =3D=3D disk->dev->id > && pv->part_start =3D=3D grub_partition_get_start (disk->partition) > - && pv->part_size =3D=3D grub_disk_get_size (disk)) > + && pv->part_size =3D=3D grub_disk_native_sectors (disk)) > { > if (vg_out) > *vg_out =3D vg; > diff --git a/grub-core/disk/dmraid_nvidia.c b/grub-core/disk/dmraid_nvidi= a.c > index 060279124..4d2fb04d1 100644 > --- a/grub-core/disk/dmraid_nvidia.c > +++ b/grub-core/disk/dmraid_nvidia.c > @@ -107,7 +107,7 @@ grub_dmraid_nv_detect (grub_disk_t disk, > /* Skip partition. */ > return NULL; > =20 > - sector =3D grub_disk_get_size (disk); > + sector =3D grub_disk_native_sectors (disk); > if (sector =3D=3D GRUB_DISK_SIZE_UNKNOWN) > /* Not raid. */ > return NULL; > diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c > index 9e20af70e..f077b5f55 100644 > --- a/grub-core/disk/efi/efidisk.c > +++ b/grub-core/disk/efi/efidisk.c > @@ -867,7 +867,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *hand= le) > if (ctx.hd->partition_start =3D=3D 0 > && (ctx.hd->partition_size << (parent->log_sector_size > - GRUB_DISK_SECTOR_BITS)) > - =3D=3D grub_disk_get_size (parent)) > + =3D=3D grub_disk_native_sectors (parent)) > { > dev_name =3D grub_strdup (parent->name); > } > diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c > index 0175ce4c4..2f34a35e6 100644 > --- a/grub-core/disk/geli.c > +++ b/grub-core/disk/geli.c > @@ -258,7 +258,7 @@ configure_ciphers (grub_disk_t disk, const char *chec= k_uuid, > if (2 * GRUB_MD_SHA256->mdlen + 1 > GRUB_CRYPTODISK_MAX_UUID_LENGTH) > return NULL; > =20 > - sector =3D grub_disk_get_size (disk); > + sector =3D grub_disk_native_sectors (disk); > if (sector =3D=3D GRUB_DISK_SIZE_UNKNOWN || sector =3D=3D 0) > return NULL; > =20 > @@ -391,7 +391,7 @@ configure_ciphers (grub_disk_t disk, const char *chec= k_uuid, > =20 > newdev->modname =3D "geli"; > =20 > - newdev->total_sectors =3D grub_disk_get_size (disk) - 1; > + newdev->total_sectors =3D grub_disk_native_sectors (disk) - 1; > grub_memcpy (newdev->uuid, uuid, sizeof (newdev->uuid)); > COMPILE_TIME_ASSERT (sizeof (newdev->uuid) >=3D 32 * 2 + 1); > return newdev; > @@ -420,7 +420,7 @@ recover_key (grub_disk_t source, grub_cryptodisk_t de= v) > if (dev->hash->mdlen > GRUB_CRYPTO_MAX_MDLEN) > return grub_error (GRUB_ERR_BUG, "mdlen is too long"); > =20 > - sector =3D grub_disk_get_size (source); > + sector =3D grub_disk_native_sectors (source); > if (sector =3D=3D GRUB_DISK_SIZE_UNKNOWN || sector =3D=3D 0) > return grub_error (GRUB_ERR_BUG, "not a geli"); > =20 > diff --git a/grub-core/disk/ldm.c b/grub-core/disk/ldm.c > index 58f8a53e1..912e88255 100644 > --- a/grub-core/disk/ldm.c > +++ b/grub-core/disk/ldm.c > @@ -821,7 +821,7 @@ grub_ldm_detect (grub_disk_t disk, > /* LDM is never inside a partition. */ > if (!has_ldm || disk->partition) > continue; > - sector =3D grub_disk_get_size (disk); > + sector =3D grub_disk_native_sectors (disk); > if (sector =3D=3D GRUB_DISK_SIZE_UNKNOWN) > continue; > sector--; > @@ -938,7 +938,7 @@ grub_util_is_ldm (grub_disk_t disk) > /* LDM is never inside a partition. */ > if (!has_ldm || disk->partition) > continue; > - sector =3D grub_disk_get_size (disk); > + sector =3D grub_disk_native_sectors (disk); > if (sector =3D=3D GRUB_DISK_SIZE_UNKNOWN) > continue; > sector--; > diff --git a/grub-core/disk/luks.c b/grub-core/disk/luks.c > index aa9877b68..5fc79d880 100644 > --- a/grub-core/disk/luks.c > +++ b/grub-core/disk/luks.c > @@ -125,7 +125,7 @@ configure_ciphers (grub_disk_t disk, const char *chec= k_uuid, > newdev->offset_sectors =3D grub_be_to_cpu32 (header.payloadOffset); > newdev->source_disk =3D NULL; > newdev->log_sector_size =3D 9; > - newdev->total_sectors =3D grub_disk_get_size (disk) - newdev->offset_s= ectors; > + newdev->total_sectors =3D grub_disk_native_sectors (disk) - newdev->of= fset_sectors; > grub_memcpy (newdev->uuid, uuid, sizeof (uuid)); > newdev->modname =3D "luks"; > =20 > diff --git a/grub-core/disk/mdraid1x_linux.c b/grub-core/disk/mdraid1x_li= nux.c > index c980feba4..38444b02c 100644 > --- a/grub-core/disk/mdraid1x_linux.c > +++ b/grub-core/disk/mdraid1x_linux.c > @@ -111,7 +111,7 @@ grub_mdraid_detect (grub_disk_t disk, > grub_uint64_t size; > grub_uint8_t minor_version; > =20 > - size =3D grub_disk_get_size (disk); > + size =3D grub_disk_native_sectors (disk); > =20 > /* Check for an 1.x superblock. > * It's always aligned to a 4K boundary > diff --git a/grub-core/disk/mdraid_linux.c b/grub-core/disk/mdraid_linux.c > index 11024ae31..e40216f51 100644 > --- a/grub-core/disk/mdraid_linux.c > +++ b/grub-core/disk/mdraid_linux.c > @@ -190,7 +190,7 @@ grub_mdraid_detect (grub_disk_t disk, > struct grub_diskfilter_vg *ret; > =20 > /* The sector where the mdraid 0.90 superblock is stored, if available= =2E */ > - size =3D grub_disk_get_size (disk); > + size =3D grub_disk_native_sectors (disk); > if (size =3D=3D GRUB_DISK_SIZE_UNKNOWN) > /* not 0.9x raid. */ > return NULL; > diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c > index 857bea991..581215ef1 100644 > --- a/grub-core/fs/cbfs.c > +++ b/grub-core/fs/cbfs.c > @@ -148,16 +148,16 @@ grub_cbfs_mount (grub_disk_t disk) > grub_off_t header_off; > struct cbfs_header head; > =20 > - if (grub_disk_get_size (disk) =3D=3D GRUB_DISK_SIZE_UNKNOWN) > + if (grub_disk_native_sectors (disk) =3D=3D GRUB_DISK_SIZE_UNKNOWN) > goto fail; > =20 > - if (grub_disk_read (disk, grub_disk_get_size (disk) - 1, > + if (grub_disk_read (disk, grub_disk_native_sectors (disk) - 1, > GRUB_DISK_SECTOR_SIZE - sizeof (ptr), > sizeof (ptr), &ptr)) > goto fail; > =20 > ptr =3D grub_cpu_to_le32 (ptr); > - header_off =3D (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BITS) > + header_off =3D (grub_disk_native_sectors (disk) << GRUB_DISK_SECTOR_BI= TS) > + (grub_int32_t) ptr; > =20 > if (grub_disk_read (disk, 0, header_off, > @@ -171,16 +171,16 @@ grub_cbfs_mount (grub_disk_t disk) > if (!data) > goto fail; > =20 > - data->cbfs_start =3D (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BI= TS) > + data->cbfs_start =3D (grub_disk_native_sectors (disk) << GRUB_DISK_SEC= TOR_BITS) > - (grub_be_to_cpu32 (head.romsize) - grub_be_to_cpu32 (head.offset)); > - data->cbfs_end =3D (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BITS) > + data->cbfs_end =3D (grub_disk_native_sectors (disk) << GRUB_DISK_SECTO= R_BITS) > - grub_be_to_cpu32 (head.bootblocksize); > data->cbfs_align =3D grub_be_to_cpu32 (head.align); > =20 > - if (data->cbfs_start >=3D (grub_disk_get_size (disk) << GRUB_DISK_SECT= OR_BITS)) > + if (data->cbfs_start >=3D (grub_disk_native_sectors (disk) << GRUB_DIS= K_SECTOR_BITS)) > goto fail; > - if (data->cbfs_end > (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BI= TS)) > - data->cbfs_end =3D (grub_disk_get_size (disk) << GRUB_DISK_SECTOR_BI= TS); > + if (data->cbfs_end > (grub_disk_native_sectors (disk) << GRUB_DISK_SEC= TOR_BITS)) > + data->cbfs_end =3D (grub_disk_native_sectors (disk) << GRUB_DISK_SEC= TOR_BITS); > =20 > data->next_hofs =3D data->cbfs_start; > =20 > diff --git a/grub-core/fs/nilfs2.c b/grub-core/fs/nilfs2.c > index 7ed148d3b..082326f38 100644 > --- a/grub-core/fs/nilfs2.c > +++ b/grub-core/fs/nilfs2.c > @@ -753,7 +753,7 @@ grub_nilfs2_load_sb (struct grub_nilfs2_data *data) > partition_size =3D (grub_le_to_cpu64 (data->sblock.s_dev_size) > >> GRUB_DISK_SECTOR_BITS); > else > - partition_size =3D grub_disk_get_size (disk); > + partition_size =3D grub_disk_native_sectors (disk); > if (partition_size !=3D GRUB_DISK_SIZE_UNKNOWN) > { > /* Read second super block. */ > diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c > index 41ef0ff57..b6e1e178d 100644 > --- a/grub-core/fs/zfs/zfs.c > +++ b/grub-core/fs/zfs/zfs.c > @@ -1175,7 +1175,7 @@ scan_disk (grub_device_t dev, struct grub_zfs_data = *data, > desc.original =3D original; > =20 > /* Don't check back labels on CDROM. */ > - if (grub_disk_get_size (dev->disk) =3D=3D GRUB_DISK_SIZE_UNKNOWN) > + if (grub_disk_native_sectors (dev->disk) =3D=3D GRUB_DISK_SIZE_UNKNOWN) > vdevnum =3D VDEV_LABELS / 2; > =20 > for (label =3D 0; ubbest =3D=3D NULL && label < vdevnum; label++) > @@ -1184,7 +1184,7 @@ scan_disk (grub_device_t dev, struct grub_zfs_data = *data, > =3D label * (sizeof (vdev_label_t) >> SPA_MINBLOCKSHIFT) > + ((VDEV_SKIP_SIZE + VDEV_BOOT_HEADER_SIZE) >> SPA_MINBLOCKSHIFT) > + (label < VDEV_LABELS / 2 ? 0 :=20 > - ALIGN_DOWN (grub_disk_get_size (dev->disk), sizeof (vdev_label_t)) > + ALIGN_DOWN (grub_disk_native_sectors (dev->disk), sizeof (vdev_label= _t)) > - VDEV_LABELS * (sizeof (vdev_label_t) >> SPA_MINBLOCKSHIFT)); > =20 > /* Read in the uberblock ring (128K). */ > diff --git a/grub-core/kern/disk.c b/grub-core/kern/disk.c > index ffb09c8ee..e1b0e073e 100644 > --- a/grub-core/kern/disk.c > +++ b/grub-core/kern/disk.c > @@ -533,7 +533,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t se= ctor, > } > =20 > grub_uint64_t > -grub_disk_get_size (grub_disk_t disk) > +grub_disk_native_sectors (grub_disk_t disk) > { > if (disk->partition) > return grub_partition_get_len (disk->partition); > diff --git a/grub-core/kern/mips/arc/init.c b/grub-core/kern/mips/arc/ini= t.c > index 3834a1490..2ed3ff319 100644 > --- a/grub-core/kern/mips/arc/init.c > +++ b/grub-core/kern/mips/arc/init.c > @@ -430,7 +430,7 @@ grub_machine_get_bootlocation (char **device, char **= path) > } > =20 > if (poff =3D=3D 0 > - && pend =3D=3D grub_disk_get_size (parent)) > + && pend =3D=3D grub_disk_native_sectors (parent)) > { > grub_disk_close (parent); > *device =3D dname; > diff --git a/grub-core/normal/misc.c b/grub-core/normal/misc.c > index 435cd9234..8bb6da31f 100644 > --- a/grub-core/normal/misc.c > +++ b/grub-core/normal/misc.c > @@ -176,14 +176,14 @@ grub_normal_print_device_info (const char *name) > (grub_partition_get_start (dev->disk->partition) & 1) ? ".5" : ""= ); > else > grub_printf_ (N_(" - Sector size %uB"), 1 << dev->disk->log_sector_size= ); > - if (grub_disk_get_size (dev->disk) =3D=3D GRUB_DISK_SIZE_UNKNOWN) > + if (grub_disk_native_sectors (dev->disk) =3D=3D GRUB_DISK_SIZE_UNK= NOWN) > grub_puts_ (N_(" - Total size unknown")); > else > grub_printf (_(" - Total size %llu%sKiB"), > - (unsigned long long) (grub_disk_get_size (dev->disk) >> 1), > + (unsigned long long) (grub_disk_native_sectors (dev->disk) >> 1), > /* TRANSLATORS: Replace dot with appropriate decimal separator for > your language. */ > - (grub_disk_get_size (dev->disk) & 1) ? _(".5") : ""); > + (grub_disk_native_sectors (dev->disk) & 1) ? _(".5") : ""); > } > =20 > if (dev) > diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows= /platform.c > index 1ef86bf58..253f8d101 100644 > --- a/grub-core/osdep/windows/platform.c > +++ b/grub-core/osdep/windows/platform.c > @@ -371,7 +371,7 @@ grub_install_register_efi (grub_device_t efidir_grub_= dev, > =20 > hddp->partition_start =3D grub_partition_get_start (efidir_grub_dev->d= isk->partition) > >> (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); > - hddp->partition_size =3D grub_disk_get_size (efidir_grub_dev->disk) > + hddp->partition_size =3D grub_disk_native_sectors (efidir_grub_dev->di= sk) > >> (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); > =20 > pathptr =3D hddp + 1; > diff --git a/include/grub/disk.h b/include/grub/disk.h > index 132a1bb75..0fb727d3d 100644 > --- a/include/grub/disk.h > +++ b/include/grub/disk.h > @@ -171,7 +171,7 @@ typedef struct grub_disk_memberlist *grub_disk_member= list_t; > =20 > #define GRUB_DISK_MAX_MAX_AGGLOMERATE ((1 << (30 - GRUB_DISK_CACHE_BITS = - GRUB_DISK_SECTOR_BITS)) - 1) > =20 > -/* Return value of grub_disk_get_size() in case disk size is unknown. */ > +/* Return value of grub_disk_native_sectors() in case disk size is unkno= wn. */ > #define GRUB_DISK_SIZE_UNKNOWN 0xffffffffffffffffULL > =20 > /* Convert to GRUB native disk sized sector from disk sized sector. */ > @@ -219,7 +219,7 @@ extern grub_err_t (*EXPORT_VAR(grub_disk_write_weak))= (grub_disk_t disk, > const void *buf); > =20 > =20 > -grub_uint64_t EXPORT_FUNC(grub_disk_get_size) (grub_disk_t disk); > +grub_uint64_t EXPORT_FUNC(grub_disk_native_sectors) (grub_disk_t disk); > =20 > #if DISK_CACHE_STATS > void > diff --git a/util/grub-install.c b/util/grub-install.c > index a35a2e2e8..f9f8ee7b2 100644 > --- a/util/grub-install.c > +++ b/util/grub-install.c > @@ -748,7 +748,7 @@ is_prep_empty (grub_device_t dev) > grub_disk_addr_t dsize, addr; > grub_uint32_t buffer[32768]; > =20 > - dsize =3D grub_disk_get_size (dev->disk); > + dsize =3D grub_disk_native_sectors (dev->disk); > for (addr =3D 0; addr < dsize; > addr +=3D sizeof (buffer) / GRUB_DISK_SECTOR_SIZE) > { > diff --git a/util/grub-probe.c b/util/grub-probe.c > index cbe6ed94c..c08e46bbb 100644 > --- a/util/grub-probe.c > +++ b/util/grub-probe.c > @@ -398,7 +398,7 @@ probe (const char *path, char **device_names, char de= lim) > if (! dev || !dev->disk) > grub_util_error ("%s", grub_errmsg); > =20 > - dsize =3D grub_disk_get_size (dev->disk); > + dsize =3D grub_disk_native_sectors (dev->disk); > for (addr =3D 0; addr < dsize; > addr +=3D sizeof (buffer) / GRUB_DISK_SECTOR_SIZE) > { > --=20 > 2.27.0 >=20 --tlNbWsKFLQc7Pq1u Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl/M23UACgkQVbJhu7ck PpQVmg/9EtTTS6vUuT512q0Cw/ULLHs+6hLj9yJUh2tfO/81Uk7fTRTnC2x16x4G IVh8azKwO06cS3tq0VkWVARujDSAUrlGNvBIOi1HcLgQR1BFqcZfHymvEzxcx+gC FCRbg52SW9ilu3rhXDlBNvx64xkKn2Llry2FUyKb1Ktks/gppMQx8TYM9XshBOBQ S8Ai8wvcIlWsVuh2SWOUyr7CL4FOnbIaviABg0S7fFAlCjsyWGTt9y3GfmgX30W+ hZdR7rbLkod3189tVgLDWoSU3+5cbhzxb/oHWH/gQtbdFaQ1yGREo7Y9oUOMcn4+ 4foxmMEloxaGCsqeuNmtdmLxnfbwp8jpSsOOkp4DmloCCTTEos7iNLCkc/0q2Erd SqdcmkWaZ/NYGaZWnkFGkRfEhWr4hsHpAQiwsem/dVhU+FtjdM3wySDN9ImNat61 Lszh+e9qJTQLSnwiY74KIfm3mWckFOGuGttqgt0Mky+dwf2rWy2l2QVbLH2iJQHJ jIPriFAxld+tMsbaKLBIXXK1zugS6rsJgYACzTbNXoqv3Z0GtE1E/QAgBrdjucPm oBXdaPWEVZmgsg4xOyEbmjLKD3pPnCF6shdZtPHrkFnkD30vshECrZ3NDr0a2rbf MF4zoHpoCPOboBe8ilogKsvbCjkh1+4t1hrlJvb1ERhZYbzV86w= =tkpf -----END PGP SIGNATURE----- --tlNbWsKFLQc7Pq1u--