summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2007-05-03 20:11:56 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2007-05-03 20:11:56 +0000
commitac3df562c9131e454c0d2be63e8e0e9fa269fc63 (patch)
tree4a33eee319050742f598644306250025c08dabc9 /sys/ufs/ffs
parent1d129884bc49d41d473d6f2decdc90e6cab9d6ee (diff)
Update CGSIZE macro so that it is no longer based on fs_cpg.
This was part of the ffs2 changes but was not committed earlier in order to make the userland and kernel changes independent. NOTE: the change to newfs require an updated fs.h; building an updated newfs with the old fs.h may result in a broken filesystem. OK otto@
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/fs.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h
index 545b7f15d72..0c056b2f052 100644
--- a/sys/ufs/ffs/fs.h
+++ b/sys/ufs/ffs/fs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fs.h,v 1.29 2007/04/23 10:18:30 pedro Exp $ */
+/* $OpenBSD: fs.h,v 1.30 2007/05/03 20:11:55 millert Exp $ */
/* $NetBSD: fs.h,v 1.6 1995/04/12 21:21:02 mycroft Exp $ */
/*
@@ -357,10 +357,10 @@ struct fs {
/* blktot size */ (fs)->fs_cpg * sizeof(int32_t) + \
/* blks size */ (fs)->fs_cpg * (fs)->fs_nrpos * sizeof(int16_t) + \
/* inode map */ howmany((fs)->fs_ipg, NBBY) + \
- /* block map */ howmany((fs)->fs_cpg * (fs)->fs_spc / NSPF(fs), NBBY) +\
+ /* block map */ howmany((fs)->fs_fpg, NBBY) + \
/* if present */ ((fs)->fs_contigsumsize <= 0 ? 0 : \
/* cluster sum */ (fs)->fs_contigsumsize * sizeof(int32_t) + \
- /* cluster map */ howmany((fs)->fs_cpg * (fs)->fs_spc / NSPB(fs), NBBY)))
+ /* cluster map */ howmany(fragstoblks(fs, (fs)->fs_fpg), NBBY)))
/*
* Convert cylinder group to base address of its global summary info.
@@ -497,10 +497,11 @@ struct ocg {
#define blkmap(fs, map, loc) \
(((map)[(loc) / NBBY] >> ((loc) % NBBY)) & (0xff >> (NBBY - (fs)->fs_frag)))
#define cbtocylno(fs, bno) \
- ((bno) * NSPF(fs) / (fs)->fs_spc)
+ (fsbtodb(fs, bno) / (fs)->fs_spc)
#define cbtorpos(fs, bno) \
- (((bno) * NSPF(fs) % (fs)->fs_spc / (fs)->fs_nsect * (fs)->fs_trackskew + \
- (bno) * NSPF(fs) % (fs)->fs_spc % (fs)->fs_nsect * (fs)->fs_interleave) % \
+ ((fs)->fs_nrpos <= 1 ? 0 : \
+ (fsbtodb(fs, bno) % (fs)->fs_spc / (fs)->fs_nsect * (fs)->fs_trackskew + \
+ fsbtodb(fs, bno) % (fs)->fs_spc % (fs)->fs_nsect * (fs)->fs_interleave) % \
(fs)->fs_nsect * (fs)->fs_nrpos / (fs)->fs_npsect)
/*