From nobody Thu Aug 11 16:27:37 2022 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 4M3XK55PDBz4YrXq; Thu, 11 Aug 2022 16:27:37 +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 4M3XK54y0pz3pXv; Thu, 11 Aug 2022 16:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660235257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kmj8du5mBzWpAzLeJ+gByWEfQLDlzZgX0wIPnCr4zic=; b=rWLLbVYp9XCz7W6baniyHIoldkMpiTopbNKuxB82faAVGRhzJ+Q3GVzIqGeQaPyYWmbbAK oB0zF7yIGKGzMSHHfy7VbX3oyConfXGRBTAXJYrPPuyTAuo4K4GoI2V2K5AIBPOmtb/K1n APP+LJRrFfGmTNwQ7EBaH8RJwhS5/SuUrEHUNLuF8qNcmgVzyGWbrip5R92/7AshC8ekrS fL/TsjzVVRPTIsIGN7ZO9HNrrxmxto8GvuqiwFfq/PL9ZXXg7+vJIFtJcWJDlGWwZkNKOQ VDE4xcEUgoB4dC05br22gvmzYibvcURhNtqx2UiV3lOYhQxLrDIa5cvBnzmNFg== 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 4M3XK542cJzy95; Thu, 11 Aug 2022 16:27:37 +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 27BGRbPM055275; Thu, 11 Aug 2022 16:27:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27BGRbDo055274; Thu, 11 Aug 2022 16:27:37 GMT (envelope-from git) Date: Thu, 11 Aug 2022 16:27:37 GMT Message-Id: <202208111627.27BGRbDo055274@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: c32dde316692 - main - stand: Change disk_fmtdev to take a struct devdesc * 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: c32dde3166922f55927764464d13f1bc9640f5f6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660235257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kmj8du5mBzWpAzLeJ+gByWEfQLDlzZgX0wIPnCr4zic=; b=XyW23PFmNuKoE0R1ekZDl4faXwfbi8rM1ezub0PY0JCJKWI22oDZji0QK9MeLwo9/SI4SJ jFIaWpE8yPTeN/urggN8rtP9I276dZYskq+FMFuRbDzf7vaEXkzuOMk2+l0Tb/VPWVyLt5 efKO+RNcjsYkN7E18hV9HHYVR5nv3Yp1tvPZwONErjE2cDz8qILNYBBZHxq4H3C1PA8gci V1aHHn0jcmyyMSwQQHRwEus+q3b7SCDjSJpCeg16xUk4khvTUwBBtyMat7T0t8MGCtB7Tp 8ndvdpbQSoR0jPAzETY0JyK9WhDyqJ0x+rbUUylhge0JkyiowrXAAjprhg8mTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660235257; a=rsa-sha256; cv=none; b=vYhbdD8givUtKEDNECHdMdpitvb+0f33mY1GDUgyPBpHlsN0H1aCaKgrN0TXSG/TBtNN3A S8xwTMo++ejjaKBXDO61L8XUKo3czD7QnJk8pu21ZLm00xlpO5bM16L4qmhcyeE38l0Ezr tCNK1AL05Zf2OZz4nTHUSYnqTwuRn7dl51N81MVITcbF1fIYSEK9/PMEIcjBC/xbRgAE6w Z6AlR5j1dgdhUg1pCZ+1m6AD7ErplZCcMeY0v0DngsyMTOjpUBuXl44KwNGTMBLBy3DwPr sS5Z6DeZQqM2BG68d0ri1v52fLnMa+mhjhTZLsoK6+S3AzAK7TW7IZ1XUtooEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c32dde3166922f55927764464d13f1bc9640f5f6 commit c32dde3166922f55927764464d13f1bc9640f5f6 Author: Warner Losh AuthorDate: 2022-08-11 15:04:50 +0000 Commit: Warner Losh CommitDate: 2022-08-11 16:27:15 +0000 stand: Change disk_fmtdev to take a struct devdesc * We do a number of games with ploymorphism for different types struct *devdesc. Adjust one place that this affects to take the address of the base class (most others have void * at the moment). This is more type safe than a bare void *. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D35914 --- stand/common/disk.c | 5 ++++- stand/common/disk.h | 3 ++- stand/libsa/geli/gelidev.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/stand/common/disk.c b/stand/common/disk.c index 3ad147da0e5b..15daf7e358c6 100644 --- a/stand/common/disk.c +++ b/stand/common/disk.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "disk.h" @@ -386,11 +387,13 @@ disk_close(struct disk_devdesc *dev) } char * -disk_fmtdev(struct disk_devdesc *dev) +disk_fmtdev(struct devdesc *vdev) { + struct disk_devdesc *dev = (struct disk_devdesc *)vdev; static char buf[128]; char *cp; + assert(vdev->d_dev->dv_type == DEVT_DISK); cp = buf + sprintf(buf, "%s%d", dev->dd.d_dev->dv_name, dev->dd.d_unit); if (dev->d_slice > D_SLICENONE) { #ifdef LOADER_GPT_SUPPORT diff --git a/stand/common/disk.h b/stand/common/disk.h index 83109981e0a8..806673349cb8 100644 --- a/stand/common/disk.h +++ b/stand/common/disk.h @@ -116,7 +116,8 @@ extern int ptblread(void *, void *, size_t, uint64_t); * Print information about slices on a disk. */ extern int disk_print(struct disk_devdesc *, char *, int); -extern char* disk_fmtdev(struct disk_devdesc *); extern int disk_parsedev(struct disk_devdesc *, const char *, const char **); +char *disk_fmtdev(struct devdesc *vdev); + #endif /* _DISK_H */ diff --git a/stand/libsa/geli/gelidev.c b/stand/libsa/geli/gelidev.c index d312d7b17e0e..5dd122a4a681 100644 --- a/stand/libsa/geli/gelidev.c +++ b/stand/libsa/geli/gelidev.c @@ -305,7 +305,7 @@ geli_probe_and_attach(struct open_file *f) hlastblk = (hmediasize / DEV_BSIZE) - 1; /* Taste the host provider. If it's not geli-encrypted just return. */ - gdev = geli_taste(diskdev_read, hdesc, hlastblk, disk_fmtdev(hdesc)); + gdev = geli_taste(diskdev_read, hdesc, hlastblk, disk_fmtdev(&hdesc->dd)); if (gdev == NULL) return;