From 25cb27f0231af5b93706a91aca1040b7b804bf4e Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 17 Oct 1994 20:10:28 +0000 Subject: Formerly utilities.c.~7~ --- ufs-fsck/utilities.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'ufs-fsck') diff --git a/ufs-fsck/utilities.c b/ufs-fsck/utilities.c index db603831..f66204f9 100644 --- a/ufs-fsck/utilities.c +++ b/ufs-fsck/utilities.c @@ -57,13 +57,14 @@ getinode (ino_t ino, struct dinode *di) daddr_t iblk; if (!lastifrag) - lastifrag = malloc (sblock->fs_fsize); + lastifrag = malloc (sblock->fs_bsize); iblk = ino_to_fsba (sblock, ino); if (iblk != lastifragaddr) - readblock (fsbtodb (sblock, iblk), lastifrag, sblock->fs_fsize); + readblock (fsbtodb (sblock, iblk), lastifrag, sblock->fs_bsize); lastifragaddr = iblk; - bcopy (lastifrag + ino_to_fsbo (sblock, ino), di, sizeof (struct dinode)); + bcopy (lastifrag + ino_to_fsbo (sblock, ino) * sizeof (struct dinode), + di, sizeof (struct dinode)); } /* Write inode number INO from DINODE. */ @@ -74,10 +75,11 @@ write_inode (ino_t ino, struct dinode *di) iblk = ino_to_fsba (sblock, ino); if (iblk != lastifragaddr) - readblock (fsbtodb (sblock, iblk), lastifrag, sblock->fs_fsize); + readblock (fsbtodb (sblock, iblk), lastifrag, sblock->fs_bsize); lastifragaddr = iblk; - bcopy (di, lastifrag + ino_to_fsbo (sblock, ino), sizeof (struct dinode)); - writeblock (fsbtodb (sblock, iblk), lastifrag, sblock->fs_fsize); + bcopy (di, lastifrag + ino_to_fsbo (sblock, ino) * sizeof (struct dinode), + sizeof (struct dinode)); + writeblock (fsbtodb (sblock, iblk), lastifrag, sblock->fs_bsize); } /* Clear inode number INO and zero DI. */ -- cgit v1.2.3