From nobody Mon Oct 20 16:11:38 2025 X-Original-To: dev-commits-src-branches@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 4cr0mV3qNnz6Cgqy; Mon, 20 Oct 2025 16:11:38 +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 4cr0mV1wfFz3VHT; Mon, 20 Oct 2025 16:11:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760976698; 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=o4JMabZ/HeeDylS+eyWwKrJ7iRHy2vxS5uxivoqY02s=; b=mLQfZH8t+WHF/O/wZkXytK+RMcrlLu6s++5GRJPgY87Mf7Q0UscKem6LsbH6ywRIB+WRwq iZVa9fv/SPO73SDtHeAuvI0xcFszAkoBQlmV9JY5SvlrgLkMHLtqvL0JHes8sM2h5Hf92w rptuamKXfun6CHNwfF085qofm2G9tYN/78fuT2PXSQlUGI7FpG/GqkSeM5xRxgmG+4MarK OmmORDuGWfcEiYOYnbR9xwYP3/RFoX4sEuZ5In1CiZ+2JHPveEBqCXDiOmQAwiN6Q7q8xa 1pnS/z3k7zgF7/oNJdP3C/K1QsyRv+WSKJtrEd1bazZpz2I18GFpd3R0MmbGVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760976698; 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=o4JMabZ/HeeDylS+eyWwKrJ7iRHy2vxS5uxivoqY02s=; b=CLuGX1CxWQddIffemvQwWjA9D1gzwjFnN4sKVdbRoAVO+xOSqeVJUo+PFqCZ+DHtqeNTok 3/oeZ7Vrhf46UQb7Dwm2cJMHyRgoE3U5H4rN6PAc73LB5C1PJn9uwqZlwZsqR4VY8WYXWj ghhXWvQaOnYhWah/fNJJK512mcyGhT1noquLmq+FmLRCrJNT2Fpu5sJB/wRMtxnI/OwM37 UZWpmEh2+syI7PB25sIR95LbJSueLfs9SLRCeey+2MTLtmSKjgAFOG/oaRXKi1VGf1ekg3 pEti3vq5W+AGllZbSC2Jik53EPTPINcfF+pFQnkgdRgaRGJoPl0LUUtT87h3vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760976698; a=rsa-sha256; cv=none; b=JCDnYv55qYzd2LlYovKmiib0yTRGdaYlQ4MbJvdhfgxyvaFQwbzLtJr8os01zPY01NVloZ v5o15HKW1uvtgNmhPUYeD+BgFj4hEi0id8o291yC3DUmksGFh4+bda+SIKWYiu4ee82trK /EKErXasn7EVLrPCSau5mdRdECwyPRsr7spu9la1LKMzYj6vQV6SX4GB5wmEBdqAxEPLgg gFrcQuf6Ra0ReZBLdTV8LJWWcNha7BKIZj4sfKTnH4cSqDnqjhTYxQU2iNAVD8uWimMKVu dJod/jZn5koruJcbJMmW0+lB+TMikevon3mii0Hox3B0wy9Wi/XFVm4Mx3CuRA== 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 4cr0mV1V6vz4sK; Mon, 20 Oct 2025 16:11:38 +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 59KGBccC036383; Mon, 20 Oct 2025 16:11:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59KGBciR036380; Mon, 20 Oct 2025 16:11:38 GMT (envelope-from git) Date: Mon, 20 Oct 2025 16:11:38 GMT Message-Id: <202510201611.59KGBciR036380@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 9a7b48fef152 - stable/15 - quot: Drop the COMPAT version List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 9a7b48fef15230740cdf7b69e40e6ceb2bd2318e Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9a7b48fef15230740cdf7b69e40e6ceb2bd2318e commit 9a7b48fef15230740cdf7b69e40e6ceb2bd2318e Author: Dag-Erling Smørgrav AuthorDate: 2025-10-17 11:55:03 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-20 16:11:22 +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 (cherry picked from commit 0eaca4a24b97c02685532f86c121a4cf415942c5) --- 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;