diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2001-04-16 22:22:21 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2001-04-16 22:22:21 +0000 |
commit | 38375c40b8a306ea04b5a442334a0cafd6ac746d (patch) | |
tree | 165398aa772f09cf9780a9821c8bf75c76da2226 /sbin/fsck_ffs/pass5.c | |
parent | 7d6505e64eeb068562679202b3819962c99eaa76 (diff) | |
download | src-38375c40b8a306ea04b5a442334a0cafd6ac746d.tar.gz src-38375c40b8a306ea04b5a442334a0cafd6ac746d.zip |
Minor background cleanups:
1) Set the FS_NEEDSFSCK flag when unexpected problems are encountered.
2) Clear the FS_NEEDSFSCK flag after a successful foreground cleanup.
3) Refuse to run in background when the FS_NEEDSFSCK flag is set.
4) Avoid taking and removing a snapshot when the filesystem is already clean.
5) Properly implement the force cleaning (-f) flag when in preen mode.
Note that you need to have revision 1.21 (date: 2001/04/14 05:26:28) of
fs.h installed in <ufs/ffs/fs.h> defining FS_NEEDSFSCK for this to compile.
Notes
Notes:
svn path=/head/; revision=75557
Diffstat (limited to 'sbin/fsck_ffs/pass5.c')
-rw-r--r-- | sbin/fsck_ffs/pass5.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index 5d334f901284..58d706c59506 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -377,7 +377,12 @@ check_maps(map1, map2, mapsize, startvalue, name, opcode, skip, limit) char buf[BUFSIZE]; long i, j, k, l, m, n, size; int astart, aend, ustart, uend; + void (*msg) __P((const char *fmt, ...)); + if (bkgrdflag) + msg = pfatal; + else + msg = pwarn; astart = ustart = aend = uend = -1; for (i = 0; i < mapsize; i++) { j = *map1++; @@ -398,10 +403,10 @@ check_maps(map1, map2, mapsize, startvalue, name, opcode, skip, limit) continue; } if (astart == aend) - pfatal("ALLOCATED %s %d MARKED FREE\n", + (*msg)("ALLOCATED %s %d MARKED FREE\n", name, astart); else - pfatal("%s %sS %d-%d MARKED FREE\n", + (*msg)("%s %sS %d-%d MARKED FREE\n", "ALLOCATED", name, astart, aend); astart = aend = n; } else { @@ -452,9 +457,9 @@ check_maps(map1, map2, mapsize, startvalue, name, opcode, skip, limit) } if (astart != -1) if (astart == aend) - pfatal("ALLOCATED %s %d MARKED FREE\n", name, astart); + (*msg)("ALLOCATED %s %d MARKED FREE\n", name, astart); else - pfatal("ALLOCATED %sS %d-%d MARKED FREE\n", + (*msg)("ALLOCATED %sS %d-%d MARKED FREE\n", name, astart, aend); if (ustart != -1) { size = uend - ustart + 1; |