From nobody Tue Nov 02 23:09:41 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0D0361842F89; Tue, 2 Nov 2021 23:09:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HkQb96Kxfz4lFg; Tue, 2 Nov 2021 23:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1D8A5D74; Tue, 2 Nov 2021 23:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A2N9fq0025592; Tue, 2 Nov 2021 23:09:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A2N9fmP025591; Tue, 2 Nov 2021 23:09:41 GMT (envelope-from git) Date: Tue, 2 Nov 2021 23:09:41 GMT Message-Id: <202111022309.1A2N9fmP025591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: edfbbfd541ab - main - gpart: Move MBR efimedia reporting to a separate routine List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: edfbbfd541ab9f7ba13b246d86bd0c36757ec660 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=edfbbfd541ab9f7ba13b246d86bd0c36757ec660 commit edfbbfd541ab9f7ba13b246d86bd0c36757ec660 Author: Warner Losh AuthorDate: 2021-11-02 23:08:48 +0000 Commit: Warner Losh CommitDate: 2021-11-02 23:09:17 +0000 gpart: Move MBR efimedia reporting to a separate routine Move the efimedia reporting to g_part_mbr_efimedia and use that from g_part_mbr_dumpconf to report it. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D32781 --- sys/geom/part/g_part_mbr.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c index 750d417bba5d..d5d18e52456d 100644 --- a/sys/geom/part/g_part_mbr.c +++ b/sys/geom/part/g_part_mbr.c @@ -308,13 +308,24 @@ g_part_mbr_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) return (0); } +static void +g_part_mbr_efimedia(struct g_part_mbr_table *table, struct g_part_mbr_entry *entry, + struct sbuf *sb) +{ + uint32_t dsn; + + dsn = le32dec(table->mbr + DOSDSNOFF); + sbuf_printf(sb, "HD(%d,MBR,%#08x,%#jx,%#jx)", + entry->base.gpe_index, dsn, (intmax_t)entry->base.gpe_start, + (intmax_t)(entry->base.gpe_end - entry->base.gpe_start + 1)); +} + static void g_part_mbr_dumpconf(struct g_part_table *basetable, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { struct g_part_mbr_entry *entry; struct g_part_mbr_table *table; - uint32_t dsn; table = (struct g_part_mbr_table *)basetable; entry = (struct g_part_mbr_entry *)baseentry; @@ -327,10 +338,8 @@ g_part_mbr_dumpconf(struct g_part_table *basetable, struct g_part_entry *baseent entry->ent.dp_typ); if (entry->ent.dp_flag & 0x80) sbuf_printf(sb, "%sactive\n", indent); - dsn = le32dec(table->mbr + DOSDSNOFF); - sbuf_printf(sb, "%sHD(%d,MBR,%#08x,%#jx,%#jx)", indent, - entry->base.gpe_index, dsn, (intmax_t)entry->base.gpe_start, - (intmax_t)(entry->base.gpe_end - entry->base.gpe_start + 1)); + sbuf_printf(sb, "%s", indent); + g_part_mbr_efimedia(table, entry, sb); sbuf_cat(sb, "\n"); } else { /* confxml: scheme information */