diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-10-13 00:04:51 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-10-13 00:04:51 +0000 |
commit | 53ff1915c818303419c75432ac13c1f0019c5f2f (patch) | |
tree | c3ab0965e5a624e0f9f4bcdf2eea31c50e79543d /ufs-fsck | |
parent | f55765cdcd345d8ad3b0c8b755662be6f58c0b3e (diff) |
Formerly pass5.c.~3~
Diffstat (limited to 'ufs-fsck')
-rw-r--r-- | ufs-fsck/pass5.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ufs-fsck/pass5.c b/ufs-fsck/pass5.c index 631e634c..47086cff 100644 --- a/ufs-fsck/pass5.c +++ b/ufs-fsck/pass5.c @@ -18,6 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "fsck.h" pass5 () { @@ -44,7 +45,7 @@ pass5 () writecsum = 0; readblock (fsbtodb (&sblock, sblock.fs_csaddr), csumbuf, - fsbtodb (&sblock, howmany (sblock->fs_cssize, sblock->fs_fsize))); + fragroundup (sizeof (struct csum) * sblock.fs_ncg)); /* Construct a CG structure; initialize everything that's the same in each cylinder group. */ @@ -100,8 +101,7 @@ pass5 () int dbase, dmax; /* Read the cylinder group structure */ - readblock (fsbtodb (cgtod (&sblock, c)), cg, - sblock.fs_cgsize / DEV_BSIZE); + readblock (fsbtodb (cgtod (&sblock, c)), cg, sblock.fs_cgsize); writecg = 0; if (!cg_chkmagic (cg)) @@ -187,7 +187,7 @@ pass5 () case DIR | DIR_REF: newcg->cg_cs.cs_ndir++; /* Fall through... */ - case FILE: + case REG: newcg->cg_cs.cs_nifree--; setbit (cg_inosused (newcg), i); } @@ -295,8 +295,7 @@ pass5 () } if (writecg) - writeblock (fsbtodb (cgtod (&sblock, c)), cg, - sblock.fs_cgsize / DEV_BSIZE); + writeblock (fsbtodb (cgtod (&sblock, c)), cg, sblock.fs_cgsize); } /* Restore nrpos */ @@ -318,9 +317,8 @@ pass5 () } if (writesb) - writeblock (SBLOCK, &sblock, btodb (SBSIZE)); + writeblock (SBLOCK, &sblock, SBSIZE); if (writecsum) writeblock (fsbtodb (&sblock, sblock.fs_csaddr), csumbuf, - fsbtodb (&sblock, howmany (sblock->fs_cssize, - sblock->fs_fsize))); + fragroundup (sizeof (struct csum) * sblock.fs_ncg)); } |