From 85ee267a3eb58f9aa1a73a1abcf033c5c460b324 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Sat, 19 Sep 2020 22:48:30 +0000 Subject: Update the libufs cgget() and cgput() interfaces to have a similar API to the sbget() and sbput() interfaces. Specifically they take a file descriptor pointer rather than the struct uufsd *disk pointer used by the libufs cgread() and cgwrite() interfaces. Update fsck_ffs to use these revised interfaces. No functional changes intended. Sponsored by: Netflix --- sbin/fsck_ffs/fsutil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sbin/fsck_ffs/fsutil.c') diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index 98db9e2d50f5..94ea2cf792bf 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -217,6 +217,9 @@ bufinit(void) /* * Manage cylinder group buffers. + * + * Use getblk() here rather than cgget() because the cylinder group + * may be corrupted but we want it anyway so we can fix it. */ static struct bufarea *cgbufs; /* header for cylinder group cache */ static int flushtries; /* number of tries to reclaim memory */ @@ -370,7 +373,7 @@ flush(int fd, struct bufarea *bp) fsmodified = 1; break; case BT_CYLGRP: - if (cgput(&disk, bp->b_un.b_cg) == 0) + if (cgput(fswritefd, &sblock, bp->b_un.b_cg) == 0) fsmodified = 1; break; default: -- cgit v1.2.3