diff options
author | mckusick <mckusick@FreeBSD.org> | 2002-03-15 18:49:47 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2002-03-15 18:49:47 +0000 |
commit | e929f2e4f07e568333e15d0f9fd992f632858bb0 (patch) | |
tree | 51f556e616d556c2c643350a9ffc80fda73ab27c /sys/fs/msdosfs | |
parent | fdd4d414b43758fe722809b27f610baa0b0607e1 (diff) | |
download | FreeBSD-src-e929f2e4f07e568333e15d0f9fd992f632858bb0.zip FreeBSD-src-e929f2e4f07e568333e15d0f9fd992f632858bb0.tar.gz |
Introduce the new 64-bit size disk block, daddr64_t. Change
the bio and buffer structures to have daddr64_t bio_pblkno,
b_blkno, and b_lblkno fields which allows access to disks
larger than a Terabyte in size. This change also requires
that the VOP_BMAP vnode operation accept and return daddr64_t
blocks. This delta should not affect system operation in
any way. It merely sets up the necessary interfaces to allow
the development of disk drivers that work with these larger
disk block addresses. It also allows for the development of
UFS2 which will use 64-bit block addresses.
Diffstat (limited to 'sys/fs/msdosfs')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_fat.c | 5 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vnops.c | 19 |
2 files changed, 17 insertions, 7 deletions
diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index 828edb70..7c4f6c9 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -994,6 +994,7 @@ extendfile(dep, count, bpp, ncp, flags) u_long cn, got; struct msdosfsmount *pmp = dep->de_pmp; struct buf *bp; + daddr_t blkno; /* * Don't try to extend the root directory @@ -1083,10 +1084,12 @@ extendfile(dep, count, bpp, ncp, flags) */ if (pcbmap(dep, de_bn2cn(pmp, bp->b_lblkno), - &bp->b_blkno, 0, 0)) + &blkno, 0, 0)) bp->b_blkno = -1; if (bp->b_blkno == -1) panic("extendfile: pcbmap"); + else + bp->b_blkno = blkno; } clrbuf(bp); if (bpp) { diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index d506937..51e541f 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -711,10 +711,11 @@ msdosfs_write(ap) * for the fat table. (see msdosfs_strategy) */ if (bp->b_blkno == bp->b_lblkno) { - error = pcbmap(dep, bp->b_lblkno, &bp->b_blkno, - 0, 0); + error = pcbmap(dep, bp->b_lblkno, &bn, 0, 0); if (error) bp->b_blkno = -1; + else + bp->b_blkno = bn; } if (bp->b_blkno == -1) { brelse(bp); @@ -1733,14 +1734,16 @@ static int msdosfs_bmap(ap) struct vop_bmap_args /* { struct vnode *a_vp; - daddr_t a_bn; + daddr64_t a_bn; struct vnode **a_vpp; - daddr_t *a_bnp; + daddr64_t *a_bnp; int *a_runp; int *a_runb; } */ *ap; { struct denode *dep = VTODE(ap->a_vp); + daddr_t blkno; + int error; if (ap->a_vpp != NULL) *ap->a_vpp = dep->de_devvp; @@ -1755,7 +1758,9 @@ msdosfs_bmap(ap) if (ap->a_runb) { *ap->a_runb = 0; } - return (pcbmap(dep, ap->a_bn, ap->a_bnp, 0, 0)); + error = pcbmap(dep, ap->a_bn, &blkno, 0, 0); + *ap->a_bnp = blkno; + return (error); } static int @@ -1769,6 +1774,7 @@ msdosfs_strategy(ap) struct denode *dep = VTODE(bp->b_vp); struct vnode *vp; int error = 0; + daddr_t blkno; if (bp->b_vp->v_type == VBLK || bp->b_vp->v_type == VCHR) panic("msdosfs_strategy: spec"); @@ -1779,7 +1785,8 @@ msdosfs_strategy(ap) * don't allow files with holes, so we shouldn't ever see this. */ if (bp->b_blkno == bp->b_lblkno) { - error = pcbmap(dep, bp->b_lblkno, &bp->b_blkno, 0, 0); + error = pcbmap(dep, bp->b_lblkno, &blkno, 0, 0); + bp->b_blkno = blkno; if (error) { bp->b_error = error; bp->b_ioflags |= BIO_ERROR; |