aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/fsutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/fsck_ffs/fsutil.c')
-rw-r--r--sbin/fsck_ffs/fsutil.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c
index 5cf17e22fe80..2acf825b159f 100644
--- a/sbin/fsck_ffs/fsutil.c
+++ b/sbin/fsck_ffs/fsutil.c
@@ -29,12 +29,6 @@
* SUCH DAMAGE.
*/
-#if 0
-#ifndef lint
-static const char sccsid[] = "@(#)utilities.c 8.6 (Berkeley) 5/19/95";
-#endif /* not lint */
-#endif
-#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -58,7 +52,6 @@ static const char sccsid[] = "@(#)utilities.c 8.6 (Berkeley) 5/19/95";
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
-#include <libufs.h>
#include "fsck.h"
@@ -189,7 +182,7 @@ bufinit(void)
initbarea(&failedbuf, BT_UNKNOWN);
failedbuf.b_errs = -1;
failedbuf.b_un.b_buf = NULL;
- if ((cgblk.b_un.b_buf = Malloc((unsigned int)sblock.fs_bsize)) == NULL)
+ if ((cgblk.b_un.b_buf = Balloc((unsigned int)sblock.fs_bsize)) == NULL)
errx(EEXIT, "Initial malloc(%d) failed", sblock.fs_bsize);
initbarea(&cgblk, BT_CYLGRP);
numbufs = cachelookups = cachereads = 0;
@@ -211,7 +204,7 @@ allocbuf(const char *failreason)
char *bufp;
bp = (struct bufarea *)Malloc(sizeof(struct bufarea));
- bufp = Malloc((unsigned int)sblock.fs_bsize);
+ bufp = Balloc((unsigned int)sblock.fs_bsize);
if (bp == NULL || bufp == NULL) {
errx(EEXIT, "%s", failreason);
/* NOTREACHED */
@@ -241,7 +234,7 @@ cglookup(int cg)
if ((unsigned) cg >= sblock.fs_ncg)
errx(EEXIT, "cglookup: out of range cylinder group %d", cg);
if (cgbufs == NULL) {
- cgbufs = calloc(sblock.fs_ncg, sizeof(struct bufarea));
+ cgbufs = Calloc(sblock.fs_ncg, sizeof(struct bufarea));
if (cgbufs == NULL)
errx(EEXIT, "Cannot allocate cylinder group buffers");
}
@@ -250,7 +243,7 @@ cglookup(int cg)
return (cgbp);
cgp = NULL;
if (flushtries == 0)
- cgp = Malloc((unsigned int)sblock.fs_cgsize);
+ cgp = Balloc((unsigned int)sblock.fs_cgsize);
if (cgp == NULL) {
if (sujrecovery)
errx(EEXIT,"Ran out of memory during journal recovery");
@@ -616,7 +609,6 @@ ckfini(int markclean)
int ofsmodified, cnt, cg;
if (bkgrdflag) {
- unlink(snapname);
if ((!(sblock.fs_flags & FS_UNCLEAN)) != markclean) {
cmd.value = FS_UNCLEAN;
cmd.size = markclean ? -1 : 1;
@@ -967,7 +959,7 @@ blzero(int fd, ufs2_daddr_t blk, long size)
if (fd < 0)
return;
if (zero == NULL) {
- zero = calloc(ZEROBUFSIZE, 1);
+ zero = Balloc(ZEROBUFSIZE);
if (zero == NULL)
errx(EEXIT, "cannot allocate buffer pool");
}
@@ -1025,7 +1017,6 @@ check_cgmagic(int cg, struct bufarea *cgbp)
CHK(cgp->cg_ndblk, >, sblock.fs_fpg, "%jd");
if (sblock.fs_magic == FS_UFS1_MAGIC) {
CHK(cgp->cg_old_niblk, !=, sblock.fs_ipg, "%jd");
- CHK(cgp->cg_old_ncyl, >, sblock.fs_old_cpg, "%jd");
} else if (sblock.fs_magic == FS_UFS2_MAGIC) {
CHK(cgp->cg_niblk, !=, sblock.fs_ipg, "%jd");
CHK(cgp->cg_initediblk, >, sblock.fs_ipg, "%jd");
@@ -1042,7 +1033,6 @@ check_cgmagic(int cg, struct bufarea *cgbp)
} else if (sblock.fs_magic == FS_UFS1_MAGIC) {
CHK(cgp->cg_niblk, !=, 0, "%jd");
CHK(cgp->cg_initediblk, !=, 0, "%jd");
- CHK(cgp->cg_old_ncyl, !=, sblock.fs_old_cpg, "%jd");
CHK(cgp->cg_old_niblk, !=, sblock.fs_ipg, "%jd");
CHK(cgp->cg_old_btotoff, !=, start, "%jd");
CHK(cgp->cg_old_boff, !=, cgp->cg_old_btotoff +