From nobody Fri Oct 17 11:55:23 2025 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 4cp3DD1X7wz6D9wW; Fri, 17 Oct 2025 11:55:24 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cp3DC6wxyz3PqK; Fri, 17 Oct 2025 11:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760702124; 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=2gwkwb19+azoUfKg++vfqTjTyKFpqv1cDRxJJG4/70c=; b=CR1+82KYaohBQv3tWElZbXOgbBIZ2TwXlpdMOZa1QFKFlaEHjRJOahTVpKFBhw3juh7VK/ oSnIrIzrfUOAMoFGm8hALXO58nV3soZPpUd4WAGyiX0q7eIXSVDOuED97qglGKj5d/KF/D NNd77W/ep5JwHGMDb6hh6Tj0zuQybW92VM1/U48mrMlWWwIDz2NRzkY6wRSvqYQvyB3UEv aBxxe6v/wqAplErSdW1XTrhKqwJOvoIPIwbA932rBD/D8rc21ruR0Ckx5j5sYDiYhB/Rv2 5VMkTNR6ykgla6WCiuQuuG/LwQmoeLEuVd1O4DGvY02HVHwxtP8yCOlgQfOPjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760702124; 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=2gwkwb19+azoUfKg++vfqTjTyKFpqv1cDRxJJG4/70c=; b=vh1Y7DuiEfVRhlp5nbbY5iZ8DlV1J1KuvSyxDc1usEFrIj/H6lZUCvIBSxAdKbHVzDPSer pNduDDfvlmIijSD+1yHFnJOSsuK2p19de3Tk3i+VDZGgAuvfM2lNTgGBrEzUMQDw1AoteY FScts5l6fGAL45eRygm6Ooif91Ba4b+U0cdUK/M8AnEarPeJCHb/S0zT9f0ABPDSJD/Ijb OT2zSTiA4ALTWoZxgaTTtg4mtEtvkCK+Gtj+TWAqabnLTHAOe1U/vONqt2y8aaBWK/1pdg Tg3wkWcm4xl1sMQ5FVUMrscPCJWIrXiAsSMkCYfRVphosPCpjeuLCMcBo0aqqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760702124; a=rsa-sha256; cv=none; b=AZ8sTNA7mKM8VzNJxM4iSaUuwDJZwPYvznsklnH+eEAVqFaijhLwKRCL67tYG7iYMRn9io CORJ20sxnYJ/PDZ4Crv5Sg9q4lor8MOLrBrd/st09C68o3kdJp8pHHEifJWEcw64O7s6xD oRrdK/GJgca5eZRqX2Gl1ssYgmm+pkdJUpVgVCry9jex/UqI7rAvg1s+hIJIah8HCqBlbG njnJlo0rrFs9CHTaAYqlQ3QmEKmjo8V+WvB5GE+eSi875afxOyqCi0biSy+mmkUB/5VHla UMQ75vJB4fpkNKrw1zSjOL6DhTRsGQm5CJmoDpEbS/Y+WVoQM7H9mX3F46nerQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cp3DC6XPsztgK; Fri, 17 Oct 2025 11:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59HBtNNp004697; Fri, 17 Oct 2025 11:55:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59HBtNDn004694; Fri, 17 Oct 2025 11:55:23 GMT (envelope-from git) Date: Fri, 17 Oct 2025 11:55:23 GMT Message-Id: <202510171155.59HBtNDn004694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 0eaca4a24b97 - main - quot: Drop the COMPAT version 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0eaca4a24b97c02685532f86c121a4cf415942c5 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0eaca4a24b97c02685532f86c121a4cf415942c5 commit 0eaca4a24b97c02685532f86c121a4cf415942c5 Author: Dag-Erling Smørgrav AuthorDate: 2025-10-17 11:55:03 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-17 11:55:03 +0000 quot: Drop the COMPAT version We've had this code for 30 years, but there has never been a way to build it. We have no idea if it still works, or if it ever worked. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D53131 --- usr.sbin/quot/quot.c | 54 ---------------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c index 0a3e3094d940..ad9f65c94877 100644 --- a/usr.sbin/quot/quot.c +++ b/usr.sbin/quot/quot.c @@ -88,11 +88,7 @@ static void quot(char *, char *); * Due to the size of modern disks, we must cast intermediate * values to 64 bits to prevent potential overflows. */ -#ifdef COMPAT -#define SIZE(n) (n) -#else #define SIZE(n) ((int)(((intmax_t)(n) * 512 + blocksize - 1) / blocksize)) -#endif #define INOCNT(fs) ((fs)->fs_ipg) #define INOSZ(fs) \ @@ -153,27 +149,13 @@ get_inode(int fd, struct fs *super, ino_t ino) return ((union dinode *)di2); } -#ifdef COMPAT -#define actualblocks(fs, dp) (DIP(fs, dp, di_blocks) / 2) -#else #define actualblocks(fs, dp) DIP(fs, dp, di_blocks) -#endif static int virtualblocks(struct fs *super, union dinode *dp) { off_t nblk, sz; sz = DIP(super, dp, di_size); -#ifdef COMPAT - if (lblkno(super, sz) >= UFS_NDADDR) { - nblk = blkroundup(super, sz); - if (sz == nblk) - nblk += super->fs_bsize; - } - - return sz / 1024; - -#else /* COMPAT */ if (lblkno(super, sz) >= UFS_NDADDR) { nblk = blkroundup(super, sz); @@ -188,15 +170,11 @@ static int virtualblocks(struct fs *super, union dinode *dp) nblk = fragroundup(super, sz); return nblk / 512; -#endif /* COMPAT */ } static int isfree(struct fs *super, union dinode *dp) { -#ifdef COMPAT - return (DIP(super, dp, di_mode) & IFMT) == 0; -#else /* COMPAT */ switch (DIP(super, dp, di_mode) & IFMT) { case IFIFO: @@ -213,7 +191,6 @@ isfree(struct fs *super, union dinode *dp) default: errx(1, "unknown IFMT 0%o", DIP(super, dp, di_mode) & IFMT); } -#endif } static struct user { @@ -324,11 +301,7 @@ uses(uid_t uid, daddr_t blks, time_t act) usr->spc30 += blks; } -#ifdef COMPAT -#define FSZCNT 500 -#else #define FSZCNT 512 -#endif static struct fsizes { struct fsizes *fsz_next; daddr_t fsz_first, fsz_last; @@ -360,30 +333,12 @@ dofsizes(int fd, struct fs *super) int i; maxino = super->fs_ncg * super->fs_ipg - 1; -#ifdef COMPAT - if (!(fsizes = (struct fsizes *)malloc(sizeof(struct fsizes)))) - errx(1, "allocate fsize structure"); -#endif /* COMPAT */ for (inode = 0; inode < maxino; inode++) { if ((dp = get_inode(fd, super, inode)) != NULL && -#ifdef COMPAT - ((DIP(super, dp, di_mode) & IFMT) == IFREG || - (DIP(super, dp, di_mode) & IFMT) == IFDIR) -#else /* COMPAT */ !isfree(super, dp) -#endif /* COMPAT */ ) { sz = estimate ? virtualblocks(super, dp) : actualblocks(super, dp); -#ifdef COMPAT - if (sz >= FSZCNT) { - fsizes->fsz_count[FSZCNT-1]++; - fsizes->fsz_sz[FSZCNT-1] += sz; - } else { - fsizes->fsz_count[sz]++; - fsizes->fsz_sz[sz] += sz; - } -#else /* COMPAT */ ksz = SIZE(sz); for (fsp = &fsizes; (fp = *fsp); fsp = &fp->fsz_next) { if (ksz < fp->fsz_last) @@ -403,7 +358,6 @@ dofsizes(int fd, struct fs *super) } fp->fsz_count[ksz % FSZCNT]++; fp->fsz_sz[ksz % FSZCNT] += sz; -#endif /* COMPAT */ } } sz = 0; @@ -500,11 +454,7 @@ donames(int fd, struct fs *super) static void usage(void) { -#ifdef COMPAT - fprintf(stderr, "usage: quot [-cfhnv] [-a | filesystem ...]\n"); -#else /* COMPAT */ fprintf(stderr, "usage: quot [-cfhknv] [-a | filesystem ...]\n"); -#endif /* COMPAT */ exit(1); } @@ -551,9 +501,7 @@ main(int argc, char *argv[]) int ch, cnt; func = douser; -#ifndef COMPAT header = getbsize(&headerlen, &blocksize); -#endif while ((ch = getopt(argc, argv, "acfhknv")) != -1) { switch (ch) { case 'a': @@ -568,11 +516,9 @@ main(int argc, char *argv[]) case 'h': estimate = true; break; -#ifndef COMPAT case 'k': blocksize = 1024; break; -#endif /* COMPAT */ case 'n': func = donames; break;