Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/adosfs Support ADOS file systems with more then 512 byte...
details: https://anonhg.NetBSD.org/src/rev/e7a72db68a87
branches: trunk
changeset: 473420:e7a72db68a87
user: is <is%NetBSD.org@localhost>
date: Wed Jun 02 22:04:30 1999 +0000
description:
Support ADOS file systems with more then 512 bytes/sector.
Fixes contributed by Detlef W?rkner in PR 7653.
diffstat:
sys/adosfs/adutil.c | 8 ++++----
sys/adosfs/advfsops.c | 12 ++++++------
sys/adosfs/advnops.c | 16 ++++++++--------
3 files changed, 18 insertions(+), 18 deletions(-)
diffs (157 lines):
diff -r 07e6a07eda26 -r e7a72db68a87 sys/adosfs/adutil.c
--- a/sys/adosfs/adutil.c Wed Jun 02 21:23:08 1999 +0000
+++ b/sys/adosfs/adutil.c Wed Jun 02 22:04:30 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adutil.c,v 1.18 1999/05/29 17:14:27 kleink Exp $ */
+/* $NetBSD: adutil.c,v 1.19 1999/06/02 22:04:30 is Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -108,7 +108,7 @@
if (adoscksum(bp, amp->nwords)) {
#ifdef DIAGNOSTIC
printf("adosfs: aget: cksum of blk %ld failed\n",
- bp->b_blkno / amp->secsperblk);
+ bp->b_blkno / (amp->bsize / DEV_BSIZE));
#endif
return (-1);
}
@@ -119,7 +119,7 @@
if (adoswordn(bp, 0) != BPT_SHORT) {
#ifdef DIAGNOSTIC
printf("adosfs: aget: bad primary type blk %ld (type = %d)\n",
- bp->b_blkno / amp->secsperblk, adoswordn(bp,0));
+ bp->b_blkno / (amp->bsize / DEV_BSIZE), adoswordn(bp,0));
#endif
return (-1);
}
@@ -144,7 +144,7 @@
#ifdef DIAGNOSTIC
printf("adosfs: aget: bad secondary type blk %ld (type = %d)\n",
- bp->b_blkno / amp->secsperblk, adoswordn(bp, amp->nwords - 1));
+ bp->b_blkno / (amp->bsize / DEV_BSIZE), adoswordn(bp, amp->nwords - 1));
#endif
return (-1);
diff -r 07e6a07eda26 -r e7a72db68a87 sys/adosfs/advfsops.c
--- a/sys/adosfs/advfsops.c Wed Jun 02 21:23:08 1999 +0000
+++ b/sys/adosfs/advfsops.c Wed Jun 02 22:04:30 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: advfsops.c,v 1.35 1999/02/26 23:44:43 wrstuden Exp $ */
+/* $NetBSD: advfsops.c,v 1.36 1999/06/02 22:04:30 is Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -395,7 +395,7 @@
ap->nwords = amp->nwords;
adosfs_ainshash(amp, ap);
- if ((error = bread(amp->devvp, an * amp->secsperblk,
+ if ((error = bread(amp->devvp, an * amp->bsize / DEV_BSIZE,
amp->bsize, NOCRED, &bp)) != 0) {
brelse(bp);
vput(vp);
@@ -514,7 +514,7 @@
ap->lastindblk = ap->linkto;
brelse(bp);
bp = NULL;
- error = bread(amp->devvp, ap->linkto * amp->secsperblk,
+ error = bread(amp->devvp, ap->linkto * amp->bsize / DEV_BSIZE,
amp->bsize, NOCRED, &bp);
if (error) {
brelse(bp);
@@ -595,7 +595,7 @@
bp = mapbp = NULL;
bn = amp->rootb;
- if ((error = bread(amp->devvp, bn * amp->secsperblk, amp->bsize,
+ if ((error = bread(amp->devvp, bn * amp->bsize / DEV_BSIZE, amp->bsize,
NOCRED, &bp)) != 0) {
brelse(bp);
return (error);
@@ -613,7 +613,7 @@
if (mapbp != NULL)
brelse(mapbp);
if ((error = bread(amp->devvp,
- adoswordn(bp, blkix) * amp->secsperblk, amp->bsize,
+ adoswordn(bp, blkix) * amp->bsize / DEV_BSIZE, amp->bsize,
NOCRED, &mapbp)) != 0)
break;
if (adoscksum(mapbp, amp->nwords)) {
@@ -640,7 +640,7 @@
if (mapix < bmsize && blkix == endix) {
bn = adoswordn(bp, blkix);
brelse(bp);
- if ((error = bread(amp->devvp, bn * amp->secsperblk,
+ if ((error = bread(amp->devvp, bn * amp->bsize / DEV_BSIZE,
amp->bsize, NOCRED, &bp)) != 0)
break;
/*
diff -r 07e6a07eda26 -r e7a72db68a87 sys/adosfs/advnops.c
--- a/sys/adosfs/advnops.c Wed Jun 02 21:23:08 1999 +0000
+++ b/sys/adosfs/advnops.c Wed Jun 02 22:04:30 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: advnops.c,v 1.48 1999/03/22 19:21:07 kleink Exp $ */
+/* $NetBSD: advnops.c,v 1.49 1999/06/02 22:04:30 is Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -288,7 +288,7 @@
* but not much as ados makes little attempt to
* make things contigous
*/
- error = bread(sp->a_vp, lbn * amp->secsperblk,
+ error = bread(sp->a_vp, lbn * amp->bsize / DEV_BSIZE,
amp->bsize, NOCRED, &bp);
if (error) {
brelse(bp);
@@ -302,14 +302,14 @@
else if (adoswordn(bp, 0) != BPT_DATA) {
#ifdef DIAGNOSTIC
printf("adosfs: bad primary type blk %ld\n",
- bp->b_blkno / amp->secsperblk);
+ bp->b_blkno / (amp->bsize / DEV_BSIZE));
#endif
error=EINVAL;
}
else if ( adoscksum(bp, ap->nwords)) {
#ifdef DIAGNOSTIC
printf("adosfs: blk %ld failed cksum.\n",
- bp->b_blkno / amp->secsperblk);
+ bp->b_blkno / (amp->bsize / DEV_BSIZE));
#endif
error=EINVAL;
}
@@ -496,7 +496,7 @@
advopprint(sp);
#endif
ap = VTOA(sp->a_vp);
- bn = sp->a_bn / ap->amp->secsperblk;
+ bn = sp->a_bn / (ap->amp->bsize / DEV_BSIZE);
bnp = sp->a_bnp;
error = 0;
@@ -549,7 +549,7 @@
error = EINVAL;
goto reterr;
}
- error = bread(ap->amp->devvp, nb * ap->amp->secsperblk,
+ error = bread(ap->amp->devvp, nb * ap->amp->bsize / DEV_BSIZE,
ap->amp->bsize, NOCRED, &flbp);
if (error) {
brelse(flbp);
@@ -580,11 +580,11 @@
flblkoff = bn % ANODENDATBLKENT(ap);
if (flblkoff < adoswordn(flbp, 2 /* ADBI_NBLKTABENT */)) {
flblkoff = (ap->nwords - 51) - flblkoff;
- *bnp = adoswordn(flbp, flblkoff) * ap->amp->secsperblk;
+ *bnp = adoswordn(flbp, flblkoff) * ap->amp->bsize / DEV_BSIZE;
} else {
#ifdef DIAGNOSTIC
printf("flblk offset %ld too large in lblk %ld blk %d\n",
- flblkoff, bn / ap->amp->secsperblk , flbp->b_blkno);
+ flblkoff, bn / (ap->amp->bsize / DEV_BSIZE), flbp->b_blkno);
#endif
error = EINVAL;
}
Home |
Main Index |
Thread Index |
Old Index