From nobody Thu Aug 11 23:47:43 2022 X-Original-To: dev-commits-src-main@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 4M3k506lDwz4YqHH; Thu, 11 Aug 2022 23:47:48 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M3k505vFpz3pSW; Thu, 11 Aug 2022 23:47:48 +0000 (UTC) (envelope-from rpokala@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660261668; 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: in-reply-to:in-reply-to:references:references; bh=G3qfl4L0BXHeYt1jgG8WuWPEDjBE49QgbzMr6kNekPE=; b=eHPyP/xeZOjHaJWvJLw0U3fRZf9AtY0Cop/zKeFbozOprA71q4vbQQy+6xS7pTgn3b3Nd+ zbmbs0gCkrOMZBVwIxVi8CHBkI9HZ3k+EV2ob+ntUBB/DNvV+TGK7YvWQsH07WchfoJtUl 4YiBCas+geTqLuMSzLqkLVbJap/JY/yXpnOFoApyMbs8F4/mn4N7hUpkUilyI6nPoP6rJm jK4X/zUMw5WOLliOfDdQjlh77LH6rUsvypzpF8/AsiCplLmSxYv+x7G2CBU41JQz4GwVpu KelGLhnYS9++sOtVKCIQKDTSfBl4XYr4pR7mS4KI4L095j6Nm2AXRwFQlu07gA== Received: from [192.168.1.10] (unknown [98.42.164.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 4M3k50129Dz15BV; Thu, 11 Aug 2022 23:47:48 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.63.22070801 Date: Thu, 11 Aug 2022 16:47:43 -0700 Subject: Re: d2d4e1271b33 - main - stand: Change zfs_fmtdev to take a struct devdesc * From: Ravi Pokala To: Warner Losh , , , Message-ID: <92FCDDE0-A87F-46B6-A6AF-7101355A2E81@panasas.com> Thread-Topic: d2d4e1271b33 - main - stand: Change zfs_fmtdev to take a struct devdesc * References: <202208111627.27BGRcsM055305@gitrepo.freebsd.org> In-Reply-To: <202208111627.27BGRcsM055305@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660261668; 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: in-reply-to:in-reply-to:references:references; bh=G3qfl4L0BXHeYt1jgG8WuWPEDjBE49QgbzMr6kNekPE=; b=G15d0pVx4QeVcO40qgKc8cleYqMG6CWpyGenQsunEQ2fw4pJTgtoWbFWmEpyajtlrSiqlz 4ZiIW0vAdZfb1KM+LLPZMRE8L9H5BK1V+oZNjTMP8E+8rRbJ1YDanaP7urm6blmyKwzoZx 5RFzPi5W4eaqpMP1ucbYMDzdQEZfhagUr+flO9c9wN9dfwyqBoCKuIF6lM02pIqQUk24Ex 723DtdHJdkvXrUq1I/gKhq7HmfxaBilp2qCWxGnVx0y/2nD6ST/Z/ilWGXTDXLV/J3ZNo/ I2cnGVYuFaSlpTgvn7Ir4XwNUWj8BCkfgQtXW3f7OkzaTOmHBr1YHlPpDUBluQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660261668; a=rsa-sha256; cv=none; b=VIojYmpLxokl8OBE9xaa9Vh64U8tQNLXhuTyuzVcEpY6HZk57o+7JC/ynXdfRmAAeE9dE6 9pvyeqLoyZkcFsdFgRFyS74VvbInPxG/GSg06rYILnatS/pUEsV6mChUikj1TBPGaPoeIG 6RTLaqE1c5ShxB8eLS4p8rxCMH2t95gD945ANOG//rG7HiZo0G6Gf7oFZNCTyfUVkdXaYf bA1kvV6Zic+kxg3OdpUZ1xap/Ki6WGCa6UJjoptTz49xKbAi6Cqsi8+zT3NhDzN0UEatAv s+UbEbnbFlwahjwV158sY+mT1c/wuqiWV+kQ/7h2MpgkPEtv4IF/Cr47qy9Pbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N -----Original Message----- From: on behalf of Warner Losh Date: 2022-08-11, Thursday at 09:27 To: , , Subject: git: d2d4e1271b33 - main - stand: Change zfs_fmtdev to take a struct devdesc * The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d2d4e1271b33b233f57fd18a61a1b5c1b0aeb355 commit d2d4e1271b33b233f57fd18a61a1b5c1b0aeb355 Author: Warner Losh AuthorDate: 2022-08-11 15:05:15 +0000 Commit: Warner Losh CommitDate: 2022-08-11 16:27:15 +0000 stand: Change zfs_fmtdev to take a struct devdesc * Yes, but why? Also, shouldn't the other places in zfs_fmtdev() that use 'dev->dd.' be updated to use 'vdev->'? Thanks, Ravi (rpokala@) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D35974 --- stand/i386/loader/main.c | 2 +- stand/i386/zfsboot/zfsboot.c | 2 +- stand/libsa/zfs/devicename_stubs.c | 2 +- stand/libsa/zfs/libzfs.h | 2 +- stand/libsa/zfs/zfs.c | 6 +++--- stand/userboot/userboot/main.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c index 29c40921a85a..4d5a0a98a08e 100644 --- a/stand/i386/loader/main.c +++ b/stand/i386/loader/main.c @@ -387,7 +387,7 @@ extract_currdev(void) #ifdef LOADER_ZFS_SUPPORT if (new_currdev.dd.d_dev->dv_type == DEVT_ZFS) - init_zfs_boot_options(zfs_fmtdev(&new_currdev)); + init_zfs_boot_options(zfs_fmtdev(&new_currdev.dd)); #endif env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), diff --git a/stand/i386/zfsboot/zfsboot.c b/stand/i386/zfsboot/zfsboot.c index b68d80e802c2..52fd41688a17 100644 --- a/stand/i386/zfsboot/zfsboot.c +++ b/stand/i386/zfsboot/zfsboot.c @@ -226,7 +226,7 @@ main(void) */ if (bdev != NULL && bdev->dd.d_dev->dv_type == DEVT_ZFS) { /* set up proper device name string for ZFS */ - strncpy(boot_devname, zfs_fmtdev(bdev), sizeof (boot_devname)); + strncpy(boot_devname, zfs_fmtdev(&bdev->dd), sizeof (boot_devname)); if (zfs_get_bootonce(bdev, OS_BOOTONCE, cmd, sizeof(cmd)) == 0) { nvlist_t *benv; diff --git a/stand/libsa/zfs/devicename_stubs.c b/stand/libsa/zfs/devicename_stubs.c index 41bf907e0cf1..e58bc9c40e35 100644 --- a/stand/libsa/zfs/devicename_stubs.c +++ b/stand/libsa/zfs/devicename_stubs.c @@ -39,7 +39,7 @@ zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, const char **path) __attribute__((weak)) char * -zfs_fmtdev(void *vdev) +zfs_fmtdev(struct devdesc *vdev) { static char buf[128]; diff --git a/stand/libsa/zfs/libzfs.h b/stand/libsa/zfs/libzfs.h index e8676c0d53b8..2f0dfd8afc86 100644 --- a/stand/libsa/zfs/libzfs.h +++ b/stand/libsa/zfs/libzfs.h @@ -50,7 +50,7 @@ struct zfs_devdesc { int zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, const char **path); -char *zfs_fmtdev(void *vdev); +char *zfs_fmtdev(struct devdesc *); int zfs_probe_dev(const char *devname, uint64_t *pool_guid); int zfs_list(const char *name); int zfs_get_bootonce(void *, const char *, char *, size_t); diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c index 71e3a49c2929..5392bcaa4fb1 100644 --- a/stand/libsa/zfs/zfs.c +++ b/stand/libsa/zfs/zfs.c @@ -1583,7 +1583,7 @@ zfs_dev_open(struct open_file *f, ...) rv = 0; /* This device is not set as currdev, mount us private copy. */ if (mount == NULL) - rv = zfs_mount(zfs_fmtdev(dev), NULL, (void **)&mount); + rv = zfs_mount(zfs_fmtdev(&dev->dd), NULL, (void **)&mount); if (rv == 0) { f->f_devdata = mount; @@ -1681,7 +1681,7 @@ zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, const char **path) } char * -zfs_fmtdev(void *vdev) +zfs_fmtdev(struct devdesc *vdev) { static char rootname[ZFS_MAXNAMELEN]; static char buf[2 * ZFS_MAXNAMELEN + 8]; @@ -1689,7 +1689,7 @@ zfs_fmtdev(void *vdev) spa_t *spa; buf[0] = '\0'; - if (dev->dd.d_dev->dv_type != DEVT_ZFS) + if (vdev->d_dev->dv_type != DEVT_ZFS) return (buf); /* Do we have any pools? */ diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c index 07630945cf80..d3f12ab1675e 100644 --- a/stand/userboot/userboot/main.c +++ b/stand/userboot/userboot/main.c @@ -260,7 +260,7 @@ extract_currdev(void) bzero(&zdev, sizeof(zdev)); zdev.dd.d_dev = &zfs_dev; - init_zfs_boot_options(zfs_fmtdev(&zdev)); + init_zfs_boot_options(zfs_fmtdev(&zdev.dd)); dd = &zdev.dd; } else #endif