aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck_ffs/gjournal.c11
-rw-r--r--sbin/fsck_ffs/suj.c3
2 files changed, 5 insertions, 9 deletions
diff --git a/sbin/fsck_ffs/gjournal.c b/sbin/fsck_ffs/gjournal.c
index ea972dafe916..06505f250f87 100644
--- a/sbin/fsck_ffs/gjournal.c
+++ b/sbin/fsck_ffs/gjournal.c
@@ -134,9 +134,8 @@ getcg(int cg)
if (cgc == NULL)
err(1, "malloc(%zu)", sizeof(*cgc));
}
- if (cgread1(disk, cg) == -1)
- err(1, "cgread1(%d)", cg);
- bcopy(&disk->d_cg, &cgc->cgc_cg, sizeof(cgc->cgc_union));
+ if (cgget(disk, cg, &cgc->cgc_cg) == -1)
+ err(1, "cgget(%d)", cg);
cgc->cgc_busy = 0;
cgc->cgc_dirty = 0;
LIST_INSERT_HEAD(&cglist, cgc, cgc_next);
@@ -191,10 +190,8 @@ putcgs(void)
LIST_REMOVE(cgc, cgc_next);
ncgs--;
if (cgc->cgc_dirty) {
- bcopy(&cgc->cgc_cg, &disk->d_cg,
- sizeof(cgc->cgc_union));
- if (cgwrite1(disk, cgc->cgc_cg.cg_cgx) == -1)
- err(1, "cgwrite1(%d)", cgc->cgc_cg.cg_cgx);
+ if (cgput(disk, &cgc->cgc_cg) == -1)
+ err(1, "cgput(%d)", cgc->cgc_cg.cg_cgx);
//printf("%s: Wrote cg=%d\n", __func__,
// cgc->cgc_cg.cg_cgx);
}
diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c
index 69ed3d5e59ac..186697c03103 100644
--- a/sbin/fsck_ffs/suj.c
+++ b/sbin/fsck_ffs/suj.c
@@ -1892,8 +1892,7 @@ cg_write(struct suj_cg *sc)
* before writing the block.
*/
fs->fs_cs(fs, sc->sc_cgx) = cgp->cg_cs;
- if (bwrite(disk, fsbtodb(fs, cgtod(fs, sc->sc_cgx)), sc->sc_cgbuf,
- fs->fs_bsize) == -1)
+ if (cgput(disk, cgp) == -1)
err_suj("Unable to write cylinder group %d\n", sc->sc_cgx);
}