diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2024-02-03 18:52:00 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2024-02-03 18:52:00 +0000 |
commit | 408fdd6bcb2d3745aa9662aa649fdb765f04b9a1 (patch) | |
tree | 41d03e8f5a389984c57ed54b3ab92b12e52a673e /sbin | |
parent | 2fa0d388000cf61b7432ce38ca7f41fd59a919d6 (diff) |
Remove Softdep.
Softdep has been a no-op for some time now, this removes it to get
it out of the way.
Flensing mostly done in Talinn, with some help from krw@
ok deraadt@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dump/traverse.c | 26 | ||||
-rw-r--r-- | sbin/dumpfs/dumpfs.c | 6 | ||||
-rw-r--r-- | sbin/fsck_ffs/dir.c | 6 | ||||
-rw-r--r-- | sbin/fsck_ffs/fsck.h | 3 | ||||
-rw-r--r-- | sbin/fsck_ffs/main.c | 5 | ||||
-rw-r--r-- | sbin/fsck_ffs/pass1.c | 27 | ||||
-rw-r--r-- | sbin/fsck_ffs/pass2.c | 15 | ||||
-rw-r--r-- | sbin/fsck_ffs/pass5.c | 30 | ||||
-rw-r--r-- | sbin/fsck_ffs/setup.c | 6 | ||||
-rw-r--r-- | sbin/growfs/growfs.c | 7 | ||||
-rw-r--r-- | sbin/quotacheck/quotacheck.c | 26 |
11 files changed, 19 insertions, 138 deletions
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index 5d3225d613f..7863794c84f 100644 --- a/sbin/dump/traverse.c +++ b/sbin/dump/traverse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traverse.c,v 1.41 2024/01/09 03:16:00 guenther Exp $ */ +/* $OpenBSD: traverse.c,v 1.42 2024/02/03 18:51:57 beck Exp $ */ /* $NetBSD: traverse.c,v 1.17 1997/06/05 11:13:27 lukem Exp $ */ /*- @@ -163,30 +163,6 @@ fs_mapinodes(ino_t maxino, int64_t *tapesize, int *anydirskipped) inosused = cgp->cg_initediblk; else inosused = sblock->fs_ipg; - /* - * If we are using soft updates, then we can trust the - * cylinder group inode allocation maps to tell us which - * inodes are allocated. We will scan the used inode map - * to find the inodes that are really in use, and then - * read only those inodes in from disk. - */ - if (sblock->fs_flags & FS_DOSOFTDEP) { - if (!cg_chkmagic(cgp)) - quit("mapfiles: cg %d: bad magic number\n", cg); - cp = &cg_inosused(cgp)[(inosused - 1) / CHAR_BIT]; - for ( ; inosused > 0; inosused -= CHAR_BIT, cp--) { - if (*cp == 0) - continue; - for (i = 1 << (CHAR_BIT - 1); i > 0; i >>= 1) { - if (*cp & i) - break; - inosused--; - } - break; - } - if (inosused <= 0) - continue; - } for (i = 0; i < inosused; i++, ino++) { if (ino < ROOTINO) continue; diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c index ec6da9dd3d1..481f5b41e95 100644 --- a/sbin/dumpfs/dumpfs.c +++ b/sbin/dumpfs/dumpfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dumpfs.c,v 1.37 2022/12/04 23:50:46 cheloha Exp $ */ +/* $OpenBSD: dumpfs.c,v 1.38 2024/02/03 18:51:57 beck Exp $ */ /* * Copyright (c) 2002 Networks Associates Technology, Inc. @@ -273,12 +273,10 @@ dumpfs(int fd, const char *name) printf("none"); if (fsflags & FS_UNCLEAN) printf("unclean "); - if (fsflags & FS_DOSOFTDEP) - printf("soft-updates "); if (fsflags & FS_FLAGS_UPDATED) printf("updated "); #if 0 - fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_FLAGS_UPDATED); + fsflags &= ~(FS_UNCLEAN | FS_FLAGS_UPDATED); if (fsflags != 0) printf("unknown flags (%#x)", fsflags); #endif diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index 150987a22ae..350989c5e3d 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.34 2024/01/09 03:16:00 guenther Exp $ */ +/* $OpenBSD: dir.c,v 1.35 2024/02/03 18:51:57 beck Exp $ */ /* $NetBSD: dir.c,v 1.20 1996/09/27 22:45:11 christos Exp $ */ /* @@ -265,7 +265,7 @@ adjust(struct inodesc *idesc, short lcnt) pinode(idesc->id_number); printf(" COUNT %d SHOULD BE %d", DIP(dp, di_nlink), DIP(dp, di_nlink) - lcnt); - if (preen || usedsoftdep) { + if (preen) { if (lcnt < 0) { printf("\n"); pfatal("LINK COUNT INCREASING"); @@ -332,7 +332,7 @@ linkup(ino_t orphan, ino_t parentdir) lostdir = (DIP(dp, di_mode) & IFMT) == IFDIR; pwarn("UNREF %s ", lostdir ? "DIR" : "FILE"); pinode(orphan); - if ((preen || usedsoftdep) && DIP(dp, di_size) == 0) + if (preen && DIP(dp, di_size) == 0) return (0); if (preen) printf(" (RECONNECTED)\n"); diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 981871cd851..8af2e0a7759 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fsck.h,v 1.34 2021/01/27 05:03:25 deraadt Exp $ */ +/* $OpenBSD: fsck.h,v 1.35 2024/02/03 18:51:57 beck Exp $ */ /* $NetBSD: fsck.h,v 1.13 1996/10/11 20:15:46 thorpej Exp $ */ /* @@ -229,7 +229,6 @@ extern char yflag; /* assume a yes response */ extern daddr_t bflag; /* location of alternate super block */ extern int debug; /* output debugging info */ extern int cvtlevel; /* convert to newer file system format */ -extern char usedsoftdep; /* just fix soft dependency inconsistencies */ extern int preen; /* just fix normal inconsistencies */ extern char resolved; /* cleared if unresolved changes => not clean */ extern char havesb; /* superblock has been read */ diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index a3978dbe1a9..a3d43d4950a 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.54 2023/03/08 04:43:06 guenther Exp $ */ +/* $OpenBSD: main.c,v 1.55 2024/02/03 18:51:57 beck Exp $ */ /* $NetBSD: main.c,v 1.22 1996/10/11 20:15:48 thorpej Exp $ */ /* @@ -77,7 +77,6 @@ char yflag; /* assume a yes response */ daddr_t bflag; /* location of alternate super block */ int debug; /* output debugging info */ int cvtlevel; /* convert to newer file system format */ -char usedsoftdep; /* just fix soft dependency inconsistencies */ int preen; /* just fix normal inconsistencies */ char resolved; /* cleared if unresolved changes => not clean */ char havesb; /* superblock has been read */ @@ -257,7 +256,7 @@ checkfilesys(char *filesys, char *mntpt, long auxdata, int child) * 1b: locate first references to duplicates, if any */ if (duplist) { - if (preen || usedsoftdep) + if (preen) pfatal("INTERNAL ERROR: dups with -p"); printf("** Phase 1b - Rescan For More DUPS\n"); pass1b(); diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index edeb370c713..05e0afe7542 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pass1.c,v 1.48 2024/01/09 03:16:00 guenther Exp $ */ +/* $OpenBSD: pass1.c,v 1.49 2024/02/03 18:51:57 beck Exp $ */ /* $NetBSD: pass1.c,v 1.16 1996/09/27 22:45:15 christos Exp $ */ /* @@ -111,31 +111,6 @@ pass1(void) inosused = sblock.fs_ipg; /* - * If we are using soft updates, then we can trust the - * cylinder group inode allocation maps to tell us which - * inodes are allocated. We will scan the used inode map - * to find the inodes that are really in use, and then - * read only those inodes in from disk. - */ - if (preen && usedsoftdep) { - cp = &cg_inosused(cgp)[(inosused - 1) / CHAR_BIT]; - for ( ; inosused != 0; cp--) { - if (*cp == 0) { - if (inosused > CHAR_BIT) - inosused -= CHAR_BIT; - else - inosused = 0; - continue; - } - for (i = 1 << (CHAR_BIT - 1); i > 0; i >>= 1) { - if (*cp & i) - break; - inosused--; - } - break; - } - } - /* * Allocate inoinfo structures for the allocated inodes. */ inostathead[c].il_numalloced = inosused; diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c index c048ba86f3b..04446c5cad1 100644 --- a/sbin/fsck_ffs/pass2.c +++ b/sbin/fsck_ffs/pass2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pass2.c,v 1.38 2024/01/09 03:16:00 guenther Exp $ */ +/* $OpenBSD: pass2.c,v 1.39 2024/02/03 18:51:57 beck Exp $ */ /* $NetBSD: pass2.c,v 1.17 1996/09/27 22:45:15 christos Exp $ */ /* @@ -162,14 +162,9 @@ pass2(void) } else if ((inp->i_isize & (DIRBLKSIZ - 1)) != 0) { getpathname(pathbuf, sizeof pathbuf, inp->i_number, inp->i_number); - if (usedsoftdep) - pfatal("%s %s: LENGTH %zu NOT MULTIPLE of %d", - "DIRECTORY", pathbuf, inp->i_isize, - DIRBLKSIZ); - else - pwarn("%s %s: LENGTH %zu NOT MULTIPLE OF %d", - "DIRECTORY", pathbuf, inp->i_isize, - DIRBLKSIZ); + pwarn("%s %s: LENGTH %zu NOT MULTIPLE OF %d", + "DIRECTORY", pathbuf, inp->i_isize, + DIRBLKSIZ); if (preen) printf(" (ADJUSTED)\n"); inp->i_isize = roundup(inp->i_isize, DIRBLKSIZ); @@ -403,7 +398,7 @@ again: break; if (GET_ISTATE(dirp->d_ino) == FCLEAR) errmsg = "DUP/BAD"; - else if (!preen && !usedsoftdep) + else if (!preen) errmsg = "ZERO LENGTH DIRECTORY"; else { n = 1; diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index c5e357d7c5d..81bdd9b7f27 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pass5.c,v 1.50 2020/07/13 06:52:53 otto Exp $ */ +/* $OpenBSD: pass5.c,v 1.51 2024/02/03 18:51:57 beck Exp $ */ /* $NetBSD: pass5.c,v 1.16 1996/09/27 22:45:18 christos Exp $ */ /* @@ -333,34 +333,6 @@ pass5(void) memcpy(cg, newcg, (size_t)basesize); dirty(cgbp); } - if (usedsoftdep) { - for (i = 0; i < inomapsize; i++) { - j = cg_inosused(newcg)[i]; - if ((cg_inosused(cg)[i] & j) == j) - continue; - for (k = 0; k < NBBY; k++) { - if ((j & (1 << k)) == 0) - continue; - if (cg_inosused(cg)[i] & (1 << k)) - continue; - pwarn("ALLOCATED INODE %llu MARKED FREE\n", - ((ino_t)c * fs->fs_ipg + i * 8) + k); - } - } - for (i = 0; i < blkmapsize; i++) { - j = cg_blksfree(cg)[i]; - if ((cg_blksfree(newcg)[i] & j) == j) - continue; - for (k = 0; k < NBBY; k++) { - if ((j & (1 << k)) == 0) - continue; - if (cg_blksfree(newcg)[i] & (1 << k)) - continue; - pwarn("ALLOCATED FRAG %lld MARKED FREE\n", - ((long long)c * fs->fs_fpg + i * 8) + k); - } - } - } if (memcmp(cg_inosused(newcg), cg_inosused(cg), mapsize) != 0 && dofix(&idesc[1], "BLK(S) MISSING IN BIT MAPS")) { diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 716609fddd3..f856c89c0cb 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setup.c,v 1.69 2022/09/01 13:37:57 krw Exp $ */ +/* $OpenBSD: setup.c,v 1.70 2024/02/03 18:51:57 beck Exp $ */ /* $NetBSD: setup.c,v 1.27 1996/09/27 22:45:19 christos Exp $ */ /* @@ -450,10 +450,6 @@ found: goto badsblabel; } bufinit(); - if (sblock.fs_flags & FS_DOSOFTDEP) - usedsoftdep = 1; - else - usedsoftdep = 0; return (1); badsblabel: diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index 73b849656bd..1f71d27ae31 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: growfs.c,v 1.55 2022/12/04 23:50:46 cheloha Exp $ */ +/* $OpenBSD: growfs.c,v 1.56 2024/02/03 18:51:57 beck Exp $ */ /* * Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz * Copyright (c) 1980, 1989, 1993 The Regents of the University of California. @@ -202,8 +202,6 @@ growfs(int fsi, int fso, unsigned int Nflag) printf("\tusing %u cylinder groups of %.2fMB, %d blks, %u inodes.\n", sblock.fs_ncg, (float)sblock.fs_fpg * sblock.fs_fsize * B2MBFACTOR, sblock.fs_fpg / sblock.fs_frag, sblock.fs_ipg); - if (sblock.fs_flags & FS_DOSOFTDEP) - printf("\twith soft updates\n"); #undef B2MBFACTOR /* @@ -282,9 +280,6 @@ growfs(int fsi, int fso, unsigned int Nflag) sblock.fs_cgrotor = 0; sblock.fs_state = 0; memset(&sblock.fs_fsmnt, 0, sizeof(sblock.fs_fsmnt)); - sblock.fs_flags &= FS_DOSOFTDEP; - if (sblock.fs_magic == FS_UFS1_MAGIC) - sblock.fs_ffs1_flags &= FS_DOSOFTDEP; /* * XXX diff --git a/sbin/quotacheck/quotacheck.c b/sbin/quotacheck/quotacheck.c index 427b1282293..6151963fcfe 100644 --- a/sbin/quotacheck/quotacheck.c +++ b/sbin/quotacheck/quotacheck.c @@ -1,4 +1,4 @@ -/* $OpenBSD: quotacheck.c,v 1.41 2019/06/28 13:32:45 deraadt Exp $ */ +/* $OpenBSD: quotacheck.c,v 1.42 2024/02/03 18:51:57 beck Exp $ */ /* $NetBSD: quotacheck.c,v 1.12 1996/03/30 22:34:25 mark Exp $ */ /* @@ -303,30 +303,6 @@ chkquota(const char *vfstype, const char *fsname, const char *mntpt, inosused = cgblk.cg_initediblk; else inosused = sblock.fs_ipg; - /* - * If we are using soft updates, then we can trust the - * cylinder group inode allocation maps to tell us which - * inodes are allocated. We will scan the used inode map - * to find the inodes that are really in use, and then - * read only those inodes in from disk. - */ - if (sblock.fs_flags & FS_DOSOFTDEP) { - if (!cg_chkmagic(&cgblk)) - errx(1, "CG %d: BAD MAGIC NUMBER\n", cg); - cp = &cg_inosused(&cgblk)[(inosused - 1) / CHAR_BIT]; - for ( ; inosused > 0; inosused -= CHAR_BIT, cp--) { - if (*cp == 0) - continue; - for (i = 1 << (CHAR_BIT - 1); i > 0; i >>= 1) { - if (*cp & i) - break; - inosused--; - } - break; - } - if (inosused <= 0) - continue; - } for (i = 0; i < inosused; i++, ino++) { if ((dp = getnextinode(ino)) == NULL || ino < ROOTINO || |