aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/fsutil.c
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2020-09-19 22:48:30 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2020-09-19 22:48:30 +0000
commit85ee267a3eb58f9aa1a73a1abcf033c5c460b324 (patch)
tree76560a561871fae0dc3150bedadc7fd8751ceb9c /sbin/fsck_ffs/fsutil.c
parenta29c0348f0653c25adb65e340e6f5a7edc86b8a2 (diff)
downloadsrc-85ee267a3eb58f9aa1a73a1abcf033c5c460b324.tar.gz
src-85ee267a3eb58f9aa1a73a1abcf033c5c460b324.zip
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
Notes
Notes: svn path=/head/; revision=365919
Diffstat (limited to 'sbin/fsck_ffs/fsutil.c')
-rw-r--r--sbin/fsck_ffs/fsutil.c5
1 files changed, 4 insertions, 1 deletions
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: