diff options
author | msmith <msmith@FreeBSD.org> | 1998-03-03 02:50:24 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-03-03 02:50:24 +0000 |
commit | 8acfb4f2c51b23fb6afd9a5460c3e5747c9f4a82 (patch) | |
tree | 07dee84bb368376968a042d4c8635d573a6fa60c /sys/msdosfs | |
parent | 149cf90af175c90add97b1c3b8c6642b02584e17 (diff) | |
download | FreeBSD-src-8acfb4f2c51b23fb6afd9a5460c3e5747c9f4a82.zip FreeBSD-src-8acfb4f2c51b23fb6afd9a5460c3e5747c9f4a82.tar.gz |
Patch to the last commit; attempt to unspam stuff from NetBSD.
Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
Diffstat (limited to 'sys/msdosfs')
-rw-r--r-- | sys/msdosfs/msdosfs_vnops.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index e92b24b..9441053 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.62 1998/02/26 06:45:46 msmith Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.63 1998/03/01 21:26:09 msmith Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -552,7 +552,7 @@ msdosfs_read(ap) long n; long on; daddr_t lbn; - daddr_t rablock, rablock1; + daddr_t rablock; int rasize; struct buf *bp; struct vnode *vp = ap->a_vp; @@ -602,14 +602,12 @@ msdosfs_read(ap) #endif if (vp->v_lastr + 1 == lbn && de_cn2off(pmp, rablock) < dep->de_FileSize) { - rablock1 = de_cn2bn(pmp, rablock); rasize = pmp->pm_bpcluster; - error = breadn(vp, de_cn2bn(pmp, lbn), - pmp->pm_bpcluster, &rablock1, &rasize, 1, - NOCRED, &bp); + error = breadn(vp, lbn, pmp->pm_bpcluster, + &rablock, &rasize, 1, NOCRED, &bp); } else - error = bread(vp, de_cn2bn(pmp, lbn), - pmp->pm_bpcluster, NOCRED, &bp); + error = bread(vp, lbn, pmp->pm_bpcluster, + NOCRED, &bp); vp->v_lastr = lbn; } n = min(n, pmp->pm_bpcluster - bp->b_resid); @@ -742,9 +740,10 @@ msdosfs_write(ap) vnode_pager_setsize(vp, dep->de_FileSize); } - bn = de_blk(pmp, uio->uio_offset); + bn = de_cluster(pmp, uio->uio_offset); if ((uio->uio_offset & pmp->pm_crbomask) == 0 - && (de_blk(pmp, uio->uio_offset + uio->uio_resid) > de_blk(pmp, uio->uio_offset) + && (de_cluster(pmp, uio->uio_offset + uio->uio_resid) + > de_cluster(pmp, uio->uio_offset) || uio->uio_offset + uio->uio_resid >= dep->de_FileSize)) { /* * If either the whole cluster gets written, @@ -758,9 +757,8 @@ msdosfs_write(ap) * for the fat table. (see msdosfs_strategy) */ if (bp->b_blkno == bp->b_lblkno) { - error = pcbmap(dep, - de_bn2cn(pmp, bp->b_lblkno), - &bp->b_blkno, 0, 0); + error = pcbmap(dep, bp->b_lblkno, &bp->b_blkno, + 0, 0); if (error) bp->b_blkno = -1; } |