From nobody Wed Sep 27 16:00:50 2023 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 4RwhD23xfQz4vd83; Wed, 27 Sep 2023 16:00:50 +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 4RwhD23W2Mz3LkJ; Wed, 27 Sep 2023 16:00:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695830450; 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=W108wX+3g7M8f6tKmzV4p1DH2OdoLVMKQq+LygdeCAw=; b=nNGPa3/x123LkUENBzCLRp13wom/y6ftNDQy6e0ywDVJ7F3dBuHWKGQYAwUkPtcBGY3kPZ Ji+cAgk8nFUb7fB9W67Wo5WQNsWdIK5+IpCKS9r4tl8zJwyc6w93GkGoL7RQL+0HDQnsPw 3l6R3eTiWPjsslappWWWjQv0NkQyBAs9R/JdlHS9J/MWVG6ngLqOLU4QssldgWrk6Ms5lM YovrdhiDS9UCt5idIUAjn6y8sIjpZDC5y+iewQ3U6EAKHR2uwL2FF1l6FMW0Yzllo2iOOa MtQRSvLTzaLw1gfqfBzAT74v7RV6qey6K28mxpuxyNR0tmdYcE3gLvqQ9Za9XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695830450; a=rsa-sha256; cv=none; b=tNrYTXUE4OS0FgTd9ic67gSaNb72nIzqhsuLr1I1RmrIxPIQ6l6Drw3IM/vWieWqwSi8It vn5ardxSnfDrN28Bze+PghLc41khplVrPZmcsgenvdm/VTNMFFuAMoVNP0UUphXv3XPQLj ksjF7PJGo/d46Y1Tm960OlGIovltvGROTFA7tygtVu5Q1ph8RQrOc9Fv2BhGye0cmc4geu r6NseG9Fk7+sACLv1SGYEoMyaAxk4wPCk4Y0fzujeGaDEtGopJj0SYo2wSDxm9fesDHH8q TYuVnV1MMF2grIf8ijIpQQBgmcDR8I+DQUPdTdNNu3K6Qire3VCn5hQYyBc+zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695830450; 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=W108wX+3g7M8f6tKmzV4p1DH2OdoLVMKQq+LygdeCAw=; b=nt+neqOJUfXOL8nYHFTCSaJQqu4b00U7YUeGxTzwszAbvm4TNFwTdVyL98nsStCnoyUVAB hDstQnBmf7tqEbf7pryfajBqR0BdybXuwMNiwmpHEhMVjfl4p0wdFgA5qJWhbCuf1MGX41 4OWOciKn/S0sMFeqNt3STizPgkdWL1Y4LTMwckY9O+PKlIaRiG6HcDgVB1ifSPe5YjKi6R deu3S50qmDzwc3w0xshZwtdoTh1+jC/qyQSLZ7XnMe6pM6M9CVYiQ91o7nJ0IDTaD9/gF2 Wc+oVDykADgJCNF9hGC2rFQ7DHmUPApX3buSmMBm5ibU2hqmrhQ+dg2DI9i4UA== 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 4RwhD22YTGzlkk; Wed, 27 Sep 2023 16:00:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38RG0ode036396; Wed, 27 Sep 2023 16:00:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38RG0oDF036394; Wed, 27 Sep 2023 16:00:50 GMT (envelope-from git) Date: Wed, 27 Sep 2023 16:00:50 GMT Message-Id: <202309271600.38RG0oDF036394@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b5a2bf512dbe - main - makefs/zfs: Use unsigned integers for indirect block level counts 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: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5a2bf512dbe5bc8535e28e9f584a08444965426 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b5a2bf512dbe5bc8535e28e9f584a08444965426 commit b5a2bf512dbe5bc8535e28e9f584a08444965426 Author: Mark Johnston AuthorDate: 2023-09-27 15:47:26 +0000 Commit: Mark Johnston CommitDate: 2023-09-27 16:00:00 +0000 makefs/zfs: Use unsigned integers for indirect block level counts No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- usr.sbin/makefs/zfs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/makefs/zfs.c b/usr.sbin/makefs/zfs.c index 4d45926fb33f..db302fe1e760 100644 --- a/usr.sbin/makefs/zfs.c +++ b/usr.sbin/makefs/zfs.c @@ -673,7 +673,7 @@ dnode_cursor_init(zfs_opt_t *zfs, zfs_objset_t *os, dnode_phys_t *dnode, } static void -_dnode_cursor_flush(zfs_opt_t *zfs, struct dnode_cursor *c, int levels) +_dnode_cursor_flush(zfs_opt_t *zfs, struct dnode_cursor *c, unsigned int levels) { blkptr_t *bp, *pbp; void *buf; @@ -685,7 +685,7 @@ _dnode_cursor_flush(zfs_opt_t *zfs, struct dnode_cursor *c, int levels) blksz = MAXBLOCKSIZE; blkid = (c->dataoff / c->datablksz) / BLKPTR_PER_INDIR; - for (int level = 1; level <= levels; level++) { + for (unsigned int level = 1; level <= levels; level++) { buf = c->inddir[level - 1]; if (level == c->dnode->dn_nlevels - 1) { @@ -724,7 +724,7 @@ blkptr_t * dnode_cursor_next(zfs_opt_t *zfs, struct dnode_cursor *c, off_t off) { off_t blkid, l1id; - int levels; + unsigned int levels; if (c->dnode->dn_nlevels == 1) { assert(off < MAXBLOCKSIZE); @@ -753,8 +753,9 @@ dnode_cursor_next(zfs_opt_t *zfs, struct dnode_cursor *c, off_t off) void dnode_cursor_finish(zfs_opt_t *zfs, struct dnode_cursor *c) { - int levels; + unsigned int levels; + assert(c->dnode->dn_nlevels > 0); levels = c->dnode->dn_nlevels - 1; if (levels > 0) _dnode_cursor_flush(zfs, c, levels);