Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1k1AVI-0003tm-UY for mharc-grub-devel@gnu.org; Thu, 30 Jul 2020 11:29:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1AVC-0003qS-Py for grub-devel@gnu.org; Thu, 30 Jul 2020 11:29:50 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:47117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1AVA-0000XN-JQ for grub-devel@gnu.org; Thu, 30 Jul 2020 11:29:50 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id F2E98C60; Thu, 30 Jul 2020 11:29:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 30 Jul 2020 11:29:47 -0400 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=fm1; bh=Ki4ZMMbES99iLlBv/aeNv+d7LXb FG3oSYsG2JCRk5Wg=; b=n+jmZ3bYD+fQ0g/eTAfsxZvj3zCjRdavq907XSPnAsN 5/uRr2xaHP6r4nTnaLPLaNaxx5da86jFbc/4tAEOGgPR/Dg7FJLTEtJad/N7mgtz /pnFpS96fnOxr/vsLAKgRdFZDm9tP2tzl1lYXYlCZqWdD/tAVETPtGCHro2zoQ8V W+OiGvmyHdEKo3C4/+kMxcgch3y9YrtuHmZLAZYIY8JTtdQAqDs5wS49c4BLhjPN u7polYwMbkRlMB+AQ5jsP+fFEjzUmZUCciTnxB8ltDHBF1rIN/JrVlHQv9hf6Pd1 JPGM/teChhLn9QpDrVs/3bu+T5tqu0DtecgVDd1GeYw== 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=fm3; bh=Ki4ZMM bES99iLlBv/aeNv+d7LXbFG3oSYsG2JCRk5Wg=; b=fhabGaH2B8Wti51HdSGOMY kkgwTbIR6sdbwQj4mTfNG/15mW0K/8ItHYALocFego4z4Z8qA7ez0uYSlDXV6OFU aRCl3u7ZH+zgPImpEe2TS/xnHE7/RPaWySyFtXu9hHBt+5FFt60odlCjDXzf6GhG SwrXvvpYSovYwRXHloUney5SfwCxPtX6XHDZGA2X3Ac5DMe4PkmuTcifos3OLiGb B9m55hqDntDT4mLZY6VSSvUXMLbgWF+0lVmYC/vXr4y6LInxjBTKE0MyyUUyvN1m vhnEuItzk4LJTqcCeWSJmgChomNJUaBQMw6thv5GjqeZlaUJQiOsnw2hZuzf5GNQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrieeigdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhrihgt khcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnh epheeghfdtfeeuffehkefgffduleffjedthfdvjeektdfhhedvlefgtefgvdettdfhnecu kfhppeekledrudegrdeffedrtdenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmh epmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: from vm-mail.pks.im (x590e2100.dyn.telefonica.de [89.14.33.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 84E48328005A; Thu, 30 Jul 2020 11:29:45 -0400 (EDT) Received: from localhost (tanuki [10.192.0.23]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 65bcf039 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 30 Jul 2020 15:29:42 +0000 (UTC) Date: Thu, 30 Jul 2020 17:29:58 +0200 From: Patrick Steinhardt To: development@efficientek.com Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH 11/17] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors. Message-ID: <20200730152958.GE39309@tanuki.pks.im> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Lb0e7rgc7IsuDeGj" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=64.147.123.25; envelope-from=ps@pks.im; helo=wout2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/30 11:14:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: Thu, 30 Jul 2020 15:29:51 -0000 --Lb0e7rgc7IsuDeGj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 29, 2020 at 04:50:16PM -0500, development@efficientek.com wrote: > From: Glenn Washburn >=20 > This makes the creates an alignment with grub_disk_t naming of the same > field and is more intuitive as to how it should be used. >=20 > Signed-off-by: Glenn Washburn > --- > grub-core/disk/cryptodisk.c | 2 +- > grub-core/disk/geli.c | 2 +- > grub-core/disk/luks.c | 2 +- > grub-core/disk/luks2.c | 4 ++-- > include/grub/cryptodisk.h | 2 +- > 5 files changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c > index c30fb0e16..fc53ab491 100644 > --- a/grub-core/disk/cryptodisk.c > +++ b/grub-core/disk/cryptodisk.c > @@ -705,7 +705,7 @@ grub_cryptodisk_open (const char *name, grub_disk_t d= isk) > } > =20 > disk->data =3D dev; > - disk->total_sectors =3D dev->total_length; > + disk->total_sectors =3D dev->total_sectors; > disk->max_agglomerate =3D GRUB_DISK_MAX_MAX_AGGLOMERATE; > disk->id =3D dev->id; > dev->ref++; > diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c > index e9d23299a..4ec875821 100644 > --- a/grub-core/disk/geli.c > +++ b/grub-core/disk/geli.c > @@ -391,7 +391,7 @@ configure_ciphers (grub_disk_t disk, const char *chec= k_uuid, > =20 > newdev->modname =3D "geli"; > =20 > - newdev->total_length =3D grub_disk_get_size (disk) - 1; > + newdev->total_sectors =3D grub_disk_get_size (disk) - 1; > grub_memcpy (newdev->uuid, uuid, sizeof (newdev->uuid)); > COMPILE_TIME_ASSERT (sizeof (newdev->uuid) >=3D 32 * 2 + 1); > return newdev; > diff --git a/grub-core/disk/luks.c b/grub-core/disk/luks.c > index a1ac078d1..b1db3d137 100644 > --- a/grub-core/disk/luks.c > +++ b/grub-core/disk/luks.c > @@ -113,7 +113,7 @@ configure_ciphers (grub_disk_t disk, const char *chec= k_uuid, > newdev->offset =3D grub_be_to_cpu32 (header.payloadOffset); > newdev->source_disk =3D NULL; > newdev->log_sector_size =3D LOG_SECTOR_SIZE; > - newdev->total_length =3D grub_disk_get_size (disk) - newdev->offset; > + newdev->total_sectors =3D grub_disk_get_size (disk) - newdev->offset; Oh, yes please. Care to add in another patch that does the same for offset? `offset_sectors` would also be much clearer to me. > grub_memcpy (newdev->uuid, header.uuid, sizeof (newdev->uuid)); > newdev->modname =3D "luks"; > =20 > diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c > index 1ba5044f6..0089d169c 100644 > --- a/grub-core/disk/luks2.c > +++ b/grub-core/disk/luks2.c > @@ -606,10 +606,10 @@ luks2_recover_key (grub_disk_t disk, > crypt->log_sector_size =3D sizeof (unsigned int) * 8 > - __builtin_clz ((unsigned int) segment.sector_size) - 1; > if (grub_strcmp (segment.size, "dynamic") =3D=3D 0) > - crypt->total_length =3D (grub_disk_get_size (disk) >> (crypt->log_secto= r_size - disk->log_sector_size))=20 > + crypt->total_sectors =3D (grub_disk_get_size (disk) >> (crypt->log_sect= or_size - disk->log_sector_size)) > - crypt->offset; > else > - crypt->total_length =3D grub_strtoull (segment.size, NULL, 10) >> crypt= ->log_sector_size; > + crypt->total_sectors =3D grub_strtoull (segment.size, NULL, 10) >> cryp= t->log_sector_size; > =20 > ret =3D luks2_decrypt_key (candidate_key, disk, crypt, &keyslot, > (const grub_uint8_t *) passphrase, grub_strlen (passphrase)); > diff --git a/include/grub/cryptodisk.h b/include/grub/cryptodisk.h > index 06653a622..f9e42796e 100644 > --- a/include/grub/cryptodisk.h > +++ b/include/grub/cryptodisk.h > @@ -67,7 +67,7 @@ struct grub_cryptodisk > =20 > char *source; > grub_disk_addr_t offset; > - grub_disk_addr_t total_length; > + grub_disk_addr_t total_sectors; > grub_disk_t source_disk; > int ref; > grub_crypto_cipher_handle_t cipher; > --=20 > 2.25.1 >=20 --Lb0e7rgc7IsuDeGj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl8i53UACgkQVbJhu7ck PpSQuQ//aGaGgp5LpgBOdqebTW6FBrF6O2idWQ/CdRAe5nznLBFZo4koEMVvuwjM 5QQzqjzNRbr64meApqAHGHITCJxzOeq0b+jqx1BKu2h0RkFJkjM8zMRlMdsfMu1Y lG2TuMqMO7UOlr6INzXpodtQEhgQzDuYJY6idIiArC3LaPYDaEGsUctFotvi92+S V3rY0jQu13sB+n14Ez9OCGkMi20V4QcCWV4GdyqSTZUht1ORL1kzwtS83f/rbDJ6 KH6B0NiM8gLQDtkzg9v1dhNsbWrlR9XdG57VrY+dyExPqy0baValmNUQfGQy717Y 3rqemDGC3auKqKRZiyNTXWWDVqjoY50hdld3w/N5prM1aSruqnK64isZovbiSpgk 3eSHBPMhI3DwHCZgBAAPcfr+zdC0rW8tP35B714rL1hICmWfl+ViezrDMcLduE8P kjTGaQkxDTPHi/JhGxjzLwRc9mYLCx91MD3OlS5PrFb+K3YgZnmhCuwmVUXy03hs PNPTT0l4sj3Q6xfLVBsWFjrnV2pxKdk1o7EYF5z6HUd2wBeEnf5CSbHOPg4yJyL1 pq9VJmtj3wQanW234TQHlO3i/Dh4psWNPTYUZRAJAgT97ApdHTQsC/mV1EryTcdk nkSIPL+jk9s2P3gt0b8JUOfSsO0SHBCPex/4csk06TO0Wuo7/gM= =j5JZ -----END PGP SIGNATURE----- --Lb0e7rgc7IsuDeGj--