diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-10-17 20:10:28 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-10-17 20:10:28 +0000 |
commit | 25cb27f0231af5b93706a91aca1040b7b804bf4e (patch) | |
tree | f46a0a6aa0f50288d3cb3b0b543350675c57b435 /ufs-fsck | |
parent | ef61bdb6324be34aa073ad7480f03c43b43af573 (diff) |
Formerly utilities.c.~7~
Diffstat (limited to 'ufs-fsck')
-rw-r--r-- | ufs-fsck/utilities.c | 14 |
1 files changed, 8 insertions, 6 deletions
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. */ |