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/ufs | |
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/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_snapshot.c | 8 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 7 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_bmap.c | 13 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 4 |
4 files changed, 21 insertions, 11 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index fd47219..faca50f 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -511,8 +511,8 @@ out: /* * Copy a cylinder group map. All the unallocated blocks are marked * BLK_NOCOPY so that the snapshot knows that it need not copy them - * if they are later written. If how is one, then this is a first - * pass, so only setting needs to be done. If how is 2, then this + * if they are later written. If passno is one, then this is a first + * pass, so only setting needs to be done. If passno is 2, then this * is a revision to a previous pass which must be undone as the * replacement pass is done. */ @@ -1102,7 +1102,7 @@ ffs_snapblkfree(fs, devvp, bno, size, inum) } #ifdef DEBUG if (snapdebug) - printf("%s%d lbn %d for inum %d size %ld to blkno %d\n", + printf("%s%d lbn %d for inum %d size %ld to blkno %lld\n", "Copyonremove: snapino ", ip->i_number, lbn, inum, size, cbp->b_blkno); #endif @@ -1319,7 +1319,7 @@ retry: printf("fs metadata"); else printf("inum %d", VTOI(bp->b_vp)->i_number); - printf(" lblkno %d to blkno %d\n", bp->b_lblkno, + printf(" lblkno %lld to blkno %lld\n", bp->b_lblkno, cbp->b_blkno); } #endif diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index b07a356..475ba17 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1654,6 +1654,7 @@ setup_allocindir_phase2(bp, ip, aip) struct allocindir *oldaip; struct freefrag *freefrag; struct newblk *newblk; + daddr_t blkno; if (bp->b_lblkno >= 0) panic("setup_allocindir_phase2: not indir blk"); @@ -1733,8 +1734,10 @@ setup_allocindir_phase2(bp, ip, aip) newindirdep->ir_state = ATTACHED; LIST_INIT(&newindirdep->ir_deplisthd); LIST_INIT(&newindirdep->ir_donehd); - if (bp->b_blkno == bp->b_lblkno) - ufs_bmaparray(bp->b_vp, bp->b_lblkno, &bp->b_blkno, NULL, NULL); + if (bp->b_blkno == bp->b_lblkno) { + ufs_bmaparray(bp->b_vp, bp->b_lblkno, &blkno, NULL, NULL); + bp->b_blkno = blkno; + } newindirdep->ir_savebp = getblk(ip->i_devvp, bp->b_blkno, bp->b_bcount, 0, 0); BUF_KERNPROC(newindirdep->ir_savebp); diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c index ce4ddb8..fa8ea01 100644 --- a/sys/ufs/ufs/ufs_bmap.c +++ b/sys/ufs/ufs/ufs_bmap.c @@ -64,13 +64,16 @@ int ufs_bmap(ap) struct vop_bmap_args /* { struct vnode *a_vp; - ufs_daddr_t a_bn; + daddr64_t a_bn; struct vnode **a_vpp; - ufs_daddr_t *a_bnp; + daddr64_t *a_bnp; int *a_runp; int *a_runb; } */ *ap; { + daddr_t blkno; + int error; + /* * Check for underlying vnode requests and ensure that logical * to physical mapping is requested. @@ -80,8 +83,10 @@ ufs_bmap(ap) if (ap->a_bnp == NULL) return (0); - return (ufs_bmaparray(ap->a_vp, ap->a_bn, ap->a_bnp, - ap->a_runp, ap->a_runb)); + error = ufs_bmaparray(ap->a_vp, ap->a_bn, &blkno, + ap->a_runp, ap->a_runb); + *ap->a_bnp = blkno; + return (error); } /* diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index cc66243..bf05ff3 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1916,13 +1916,15 @@ ufs_strategy(ap) register struct buf *bp = ap->a_bp; register struct vnode *vp = ap->a_vp; register struct inode *ip; + daddr_t blkno; int error; ip = VTOI(vp); if (vp->v_type == VBLK || vp->v_type == VCHR) panic("ufs_strategy: spec"); if (bp->b_blkno == bp->b_lblkno) { - error = ufs_bmaparray(vp, bp->b_lblkno, &bp->b_blkno, NULL, NULL); + error = ufs_bmaparray(vp, bp->b_lblkno, &blkno, NULL, NULL); + bp->b_blkno = blkno; if (error) { bp->b_error = error; bp->b_ioflags |= BIO_ERROR; |