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.
This commit is contained in:
parent
0d61ca69bb
commit
0d2af52141
@ -1693,7 +1693,7 @@ coda_bmap(v)
|
||||
struct vnode *vp __attribute__((unused)) = ap->a_vp; /* file's vnode */
|
||||
daddr_t bn __attribute__((unused)) = ap->a_bn; /* fs block number */
|
||||
struct vnode **vpp = ap->a_vpp; /* RETURN vp of device */
|
||||
daddr_t *bnp __attribute__((unused)) = ap->a_bnp; /* RETURN device block number */
|
||||
daddr64_t *bnp __attribute__((unused)) = ap->a_bnp; /* RETURN device block number */
|
||||
struct thread *td __attribute__((unused)) = curthread;
|
||||
/* upcall decl */
|
||||
/* locals */
|
||||
@ -1706,7 +1706,7 @@ coda_bmap(v)
|
||||
return EINVAL;
|
||||
ret = VOP_BMAP(cp->c_ovp, bn, vpp, bnp, ap->a_runp, ap->a_runb);
|
||||
#if 0
|
||||
printf("VOP_BMAP(cp->c_ovp %p, bn %p, vpp %p, bnp %p, ap->a_runp %p, ap->a_runb %p) = %d\n",
|
||||
printf("VOP_BMAP(cp->c_ovp %p, bn %p, vpp %p, bnp %lld, ap->a_runp %p, ap->a_runb %p) = %d\n",
|
||||
cp->c_ovp, bn, vpp, bnp, ap->a_runp, ap->a_runb, ret);
|
||||
#endif
|
||||
return ret;
|
||||
|
@ -1173,7 +1173,7 @@ ccdiodone(struct bio *ibp)
|
||||
bp->bio_error = cbp->cb_buf.bio_error ?
|
||||
cbp->cb_buf.bio_error : EIO;
|
||||
}
|
||||
printf("ccd%d: error %d on component %d block %d (ccd block %d)%s\n",
|
||||
printf("ccd%d: error %d on component %d block %d (ccd block %lld)%s\n",
|
||||
unit, bp->bio_error, cbp->cb_comp,
|
||||
(int)cbp->cb_buf.bio_blkno, bp->bio_blkno, msg);
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ mdstrategy(struct bio *bp)
|
||||
int error;
|
||||
|
||||
if (md_debug > 1)
|
||||
printf("mdstrategy(%p) %s %x, %d, %ld, %p)\n",
|
||||
printf("mdstrategy(%p) %s %x, %lld, %ld, %p)\n",
|
||||
bp, devtoname(bp->bio_dev), bp->bio_flags, bp->bio_blkno,
|
||||
bp->bio_bcount / DEV_BSIZE, bp->bio_data);
|
||||
|
||||
|
@ -109,7 +109,7 @@ vinum_daemon(void)
|
||||
struct request *rq = request->info.rq;
|
||||
|
||||
log(LOG_WARNING,
|
||||
"vinum: recovering I/O request: %p\n%s dev %d.%d, offset 0x%x, length %ld\n",
|
||||
"vinum: recovering I/O request: %p\n%s dev %d.%d, offset 0x%llx, length %ld\n",
|
||||
rq,
|
||||
rq->bp->b_iocmd == BIO_READ ? "Read" : "Write",
|
||||
major(rq->bp->b_dev),
|
||||
|
@ -100,7 +100,7 @@ complete_rqe(struct buf *bp)
|
||||
set_sd_state(rqe->sdno, sd_crashed, setstate_force); /* subdisk is crashed */
|
||||
}
|
||||
log(LOG_ERR,
|
||||
"%s:%s read error, block %d for %ld bytes\n",
|
||||
"%s:%s read error, block %lld for %ld bytes\n",
|
||||
gravity,
|
||||
sd->name,
|
||||
bp->b_blkno,
|
||||
@ -111,20 +111,20 @@ complete_rqe(struct buf *bp)
|
||||
set_sd_state(rqe->sdno, sd_stale, setstate_force); /* subdisk is stale */
|
||||
}
|
||||
log(LOG_ERR,
|
||||
"%s:%s write error, block %d for %ld bytes\n",
|
||||
"%s:%s write error, block %lld for %ld bytes\n",
|
||||
gravity,
|
||||
sd->name,
|
||||
bp->b_blkno,
|
||||
bp->b_bcount);
|
||||
}
|
||||
log(LOG_ERR,
|
||||
"%s: user buffer block %d for %ld bytes\n",
|
||||
"%s: user buffer block %lld for %ld bytes\n",
|
||||
sd->name,
|
||||
ubp->b_blkno,
|
||||
ubp->b_bcount);
|
||||
if (rq->error == ENXIO) { /* the drive's down too */
|
||||
log(LOG_ERR,
|
||||
"%s: fatal drive I/O error, block %d for %ld bytes\n",
|
||||
"%s: fatal drive I/O error, block %lld for %ld bytes\n",
|
||||
DRIVE[rqe->driveno].label.name,
|
||||
bp->b_blkno,
|
||||
bp->b_bcount);
|
||||
@ -409,7 +409,7 @@ complete_raid5_write(struct rqelement *rqe)
|
||||
#ifdef VINUMDEBUG
|
||||
if (debug & DEBUG_ADDRESSES)
|
||||
log(LOG_DEBUG,
|
||||
" %s dev %d.%d, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
|
||||
" %s dev %d.%d, sd %d, offset 0x%x, devoffset 0x%llx, length %ld\n",
|
||||
rqe->b.b_iocmd == BIO_READ ? "Read" : "Write",
|
||||
major(rqe->b.b_dev),
|
||||
minor(rqe->b.b_dev),
|
||||
@ -448,7 +448,7 @@ complete_raid5_write(struct rqelement *rqe)
|
||||
#ifdef VINUMDEBUG
|
||||
if (debug & DEBUG_ADDRESSES)
|
||||
log(LOG_DEBUG,
|
||||
" %s dev %d.%d, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
|
||||
" %s dev %d.%d, sd %d, offset 0x%x, devoffset 0x%llx, length %ld\n",
|
||||
rqe->b.b_iocmd == BIO_READ ? "Read" : "Write",
|
||||
major(rqe->b.b_dev),
|
||||
minor(rqe->b.b_dev),
|
||||
|
@ -340,7 +340,7 @@ launch_requests(struct request *rq, int reviveok)
|
||||
#ifdef VINUMDEBUG
|
||||
if (debug & DEBUG_REVIVECONFLICT)
|
||||
log(LOG_DEBUG,
|
||||
"Revive conflict sd %d: %p\n%s dev %d.%d, offset 0x%x, length %ld\n",
|
||||
"Revive conflict sd %d: %p\n%s dev %d.%d, offset 0x%llx, length %ld\n",
|
||||
rq->sdno,
|
||||
rq,
|
||||
rq->bp->b_iocmd == BIO_READ ? "Read" : "Write",
|
||||
@ -355,7 +355,7 @@ launch_requests(struct request *rq, int reviveok)
|
||||
#ifdef VINUMDEBUG
|
||||
if (debug & DEBUG_ADDRESSES)
|
||||
log(LOG_DEBUG,
|
||||
"Request: %p\n%s dev %d.%d, offset 0x%x, length %ld\n",
|
||||
"Request: %p\n%s dev %d.%d, offset 0x%llx, length %ld\n",
|
||||
rq,
|
||||
rq->bp->b_iocmd == BIO_READ ? "Read" : "Write",
|
||||
major(rq->bp->b_dev),
|
||||
@ -427,7 +427,7 @@ launch_requests(struct request *rq, int reviveok)
|
||||
#ifdef VINUMDEBUG
|
||||
if (debug & DEBUG_ADDRESSES)
|
||||
log(LOG_DEBUG,
|
||||
" %s dev %d.%d, sd %d, offset 0x%x, devoffset 0x%x, length %ld\n",
|
||||
" %s dev %d.%d, sd %d, offset 0x%x, devoffset 0x%llx, length %ld\n",
|
||||
rqe->b.b_iocmd == BIO_READ ? "Read" : "Write",
|
||||
major(rqe->b.b_dev),
|
||||
minor(rqe->b.b_dev),
|
||||
@ -630,7 +630,7 @@ bre(struct request *rq,
|
||||
#ifdef VINUMDEBUG
|
||||
if (debug & DEBUG_EOFINFO) { /* tell on the request */
|
||||
log(LOG_DEBUG,
|
||||
"vinum: EOF on plex %s, sd %s offset %x (user offset %x)\n",
|
||||
"vinum: EOF on plex %s, sd %s offset %x (user offset %llx)\n",
|
||||
plex->name,
|
||||
sd->name,
|
||||
(u_int) sd->sectors,
|
||||
|
@ -201,7 +201,7 @@ revive_block(int sdno)
|
||||
|
||||
if (debug & DEBUG_REVIVECONFLICT)
|
||||
log(LOG_DEBUG,
|
||||
"Relaunch revive conflict sd %d: %p\n%s dev %d.%d, offset 0x%x, length %ld\n",
|
||||
"Relaunch revive conflict sd %d: %p\n%s dev %d.%d, offset 0x%llx, length %ld\n",
|
||||
rq->sdno,
|
||||
rq,
|
||||
rq->bp->b_iocmd == BIO_READ ? "Read" : "Write",
|
||||
|
@ -1693,7 +1693,7 @@ coda_bmap(v)
|
||||
struct vnode *vp __attribute__((unused)) = ap->a_vp; /* file's vnode */
|
||||
daddr_t bn __attribute__((unused)) = ap->a_bn; /* fs block number */
|
||||
struct vnode **vpp = ap->a_vpp; /* RETURN vp of device */
|
||||
daddr_t *bnp __attribute__((unused)) = ap->a_bnp; /* RETURN device block number */
|
||||
daddr64_t *bnp __attribute__((unused)) = ap->a_bnp; /* RETURN device block number */
|
||||
struct thread *td __attribute__((unused)) = curthread;
|
||||
/* upcall decl */
|
||||
/* locals */
|
||||
@ -1706,7 +1706,7 @@ coda_bmap(v)
|
||||
return EINVAL;
|
||||
ret = VOP_BMAP(cp->c_ovp, bn, vpp, bnp, ap->a_runp, ap->a_runb);
|
||||
#if 0
|
||||
printf("VOP_BMAP(cp->c_ovp %p, bn %p, vpp %p, bnp %p, ap->a_runp %p, ap->a_runb %p) = %d\n",
|
||||
printf("VOP_BMAP(cp->c_ovp %p, bn %p, vpp %p, bnp %lld, ap->a_runp %p, ap->a_runb %p) = %d\n",
|
||||
cp->c_ovp, bn, vpp, bnp, ap->a_runp, ap->a_runb, ret);
|
||||
#endif
|
||||
return ret;
|
||||
|
@ -275,6 +275,7 @@ hpfs_bmap(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
register struct hpfsnode *hp = VTOHP(ap->a_vp);
|
||||
daddr_t blkno;
|
||||
int error;
|
||||
|
||||
if (ap->a_vpp != NULL)
|
||||
@ -286,7 +287,8 @@ hpfs_bmap(ap)
|
||||
|
||||
dprintf(("hpfs_bmap(0x%x, 0x%x): ",hp->h_no, ap->a_bn));
|
||||
|
||||
error = hpfs_hpbmap (hp, ap->a_bn, ap->a_bnp, ap->a_runp);
|
||||
error = hpfs_hpbmap (hp, ap->a_bn, &blkno, ap->a_runp);
|
||||
*ap->a_bnp = blkno;
|
||||
|
||||
return (error);
|
||||
}
|
||||
@ -677,6 +679,7 @@ hpfs_strategy(ap)
|
||||
register struct buf *bp = ap->a_bp;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
register struct hpfsnode *hp = VTOHP(ap->a_vp);
|
||||
daddr_t blkno;
|
||||
int error;
|
||||
|
||||
dprintf(("hpfs_strategy(): \n"));
|
||||
@ -684,7 +687,8 @@ hpfs_strategy(ap)
|
||||
if (vp->v_type == VBLK || vp->v_type == VCHR)
|
||||
panic("hpfs_strategy: spec");
|
||||
if (bp->b_blkno == bp->b_lblkno) {
|
||||
error = hpfs_hpbmap (hp, bp->b_lblkno, &bp->b_blkno, NULL);
|
||||
error = hpfs_hpbmap (hp, bp->b_lblkno, &blkno, NULL);
|
||||
bp->b_blkno = blkno;
|
||||
if (error) {
|
||||
printf("hpfs_strategy: hpfs_bpbmap FAILED %d\n", error);
|
||||
bp->b_error = error;
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -1173,7 +1173,7 @@ ccdiodone(struct bio *ibp)
|
||||
bp->bio_error = cbp->cb_buf.bio_error ?
|
||||
cbp->cb_buf.bio_error : EIO;
|
||||
}
|
||||
printf("ccd%d: error %d on component %d block %d (ccd block %d)%s\n",
|
||||
printf("ccd%d: error %d on component %d block %d (ccd block %lld)%s\n",
|
||||
unit, bp->bio_error, cbp->cb_comp,
|
||||
(int)cbp->cb_buf.bio_blkno, bp->bio_blkno, msg);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -120,7 +120,7 @@ ext2_checkoverlap(bp, ip)
|
||||
ep->b_blkno + btodb(ep->b_bcount) <= start)
|
||||
continue;
|
||||
vprint("Disk overlap", vp);
|
||||
(void)printf("\tstart %d, end %d overlap start %d, end %ld\n",
|
||||
(void)printf("\tstart %d, end %d overlap start %lld, end %ld\n",
|
||||
start, last, ep->b_blkno,
|
||||
(long)(ep->b_blkno + btodb(ep->b_bcount) - 1));
|
||||
panic("Disk buffer overlap");
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -120,7 +120,7 @@ ext2_checkoverlap(bp, ip)
|
||||
ep->b_blkno + btodb(ep->b_bcount) <= start)
|
||||
continue;
|
||||
vprint("Disk overlap", vp);
|
||||
(void)printf("\tstart %d, end %d overlap start %d, end %ld\n",
|
||||
(void)printf("\tstart %d, end %d overlap start %lld, end %ld\n",
|
||||
start, last, ep->b_blkno,
|
||||
(long)(ep->b_blkno + btodb(ep->b_bcount) - 1));
|
||||
panic("Disk buffer overlap");
|
||||
|
@ -3349,7 +3349,7 @@ vm_hold_free_pages(struct buf * bp, vm_offset_t from, vm_offset_t to)
|
||||
p = bp->b_pages[index];
|
||||
if (p && (index < bp->b_npages)) {
|
||||
if (p->busy) {
|
||||
printf("vm_hold_free_pages: blkno: %d, lblkno: %d\n",
|
||||
printf("vm_hold_free_pages: blkno: %lld, lblkno: %lld\n",
|
||||
bp->b_blkno, bp->b_lblkno);
|
||||
}
|
||||
bp->b_pages[index] = NULL;
|
||||
@ -3381,7 +3381,7 @@ DB_SHOW_COMMAND(buffer, db_show_buffer)
|
||||
db_printf("b_flags = 0x%b\n", (u_int)bp->b_flags, PRINT_BUF_FLAGS);
|
||||
db_printf("b_error = %d, b_bufsize = %ld, b_bcount = %ld, "
|
||||
"b_resid = %ld\nb_dev = (%d,%d), b_data = %p, "
|
||||
"b_blkno = %d, b_pblkno = %d\n",
|
||||
"b_blkno = %lld, b_pblkno = %lld\n",
|
||||
bp->b_error, bp->b_bufsize, bp->b_bcount, bp->b_resid,
|
||||
major(bp->b_dev), minor(bp->b_dev),
|
||||
bp->b_data, bp->b_blkno, bp->b_pblkno);
|
||||
|
@ -67,7 +67,7 @@ static struct cluster_save *
|
||||
cluster_collectbufs __P((struct vnode *vp, struct buf *last_bp));
|
||||
static struct buf *
|
||||
cluster_rbuild __P((struct vnode *vp, u_quad_t filesize, daddr_t lbn,
|
||||
daddr_t blkno, long size, int run, struct buf *fbp));
|
||||
daddr64_t blkno, long size, int run, struct buf *fbp));
|
||||
|
||||
static int write_behind = 1;
|
||||
SYSCTL_INT(_vfs, OID_AUTO, write_behind, CTLFLAG_RW, &write_behind, 0,
|
||||
@ -103,7 +103,7 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
|
||||
struct buf **bpp;
|
||||
{
|
||||
struct buf *bp, *rbp, *reqbp;
|
||||
daddr_t blkno, origblkno;
|
||||
daddr64_t blkno, origblkno;
|
||||
int error, num_ra;
|
||||
int i;
|
||||
int maxra, racluster;
|
||||
@ -319,7 +319,7 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
|
||||
struct vnode *vp;
|
||||
u_quad_t filesize;
|
||||
daddr_t lbn;
|
||||
daddr_t blkno;
|
||||
daddr64_t blkno;
|
||||
long size;
|
||||
int run;
|
||||
struct buf *fbp;
|
||||
|
@ -378,9 +378,9 @@ vop_unlock {
|
||||
#
|
||||
vop_bmap {
|
||||
IN struct vnode *vp;
|
||||
IN daddr_t bn;
|
||||
IN daddr64_t bn;
|
||||
OUT struct vnode **vpp;
|
||||
IN daddr_t *bnp;
|
||||
IN daddr64_t *bnp;
|
||||
OUT int *runp;
|
||||
OUT int *runb;
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ struct iodone_chain {
|
||||
struct bio {
|
||||
u_int bio_cmd; /* I/O operation. */
|
||||
dev_t bio_dev; /* Device to do I/O on. */
|
||||
daddr_t bio_blkno; /* Underlying physical block number. */
|
||||
daddr64_t bio_blkno; /* Underlying physical block number. */
|
||||
off_t bio_offset; /* Offset into file. */
|
||||
long bio_bcount; /* Valid bytes in buffer. */
|
||||
caddr_t bio_data; /* Memory, superblocks, indirect etc. */
|
||||
@ -81,7 +81,7 @@ struct bio {
|
||||
TAILQ_ENTRY(bio) bio_queue; /* Disksort queue. */
|
||||
|
||||
/* XXX: these go away when bio chaining is introduced */
|
||||
daddr_t bio_pblkno; /* physical block number */
|
||||
daddr64_t bio_pblkno; /* physical block number */
|
||||
struct iodone_chain *bio_done_chain;
|
||||
struct bio *bio_linkage;
|
||||
off_t bio_length;
|
||||
@ -136,7 +136,7 @@ biofinish(struct bio *bp, struct devstat *stat, int error)
|
||||
|
||||
struct bio_queue_head {
|
||||
TAILQ_HEAD(bio_queue, bio) queue;
|
||||
daddr_t last_pblkno;
|
||||
daddr64_t last_pblkno;
|
||||
struct bio *insert_point;
|
||||
struct bio *switch_point;
|
||||
int busy;
|
||||
|
@ -127,7 +127,7 @@ struct buf {
|
||||
long b_runningbufspace; /* when I/O is running, pipelining */
|
||||
caddr_t b_kvabase; /* base kva for buffer */
|
||||
int b_kvasize; /* size of kva for buffer */
|
||||
daddr_t b_lblkno; /* Logical block number. */
|
||||
daddr64_t b_lblkno; /* Logical block number. */
|
||||
struct vnode *b_vp; /* Device vnode. */
|
||||
int b_dirtyoff; /* Offset in buffer of dirty region. */
|
||||
int b_dirtyend; /* Offset of end of dirty region. */
|
||||
@ -365,7 +365,7 @@ BUF_REFCNT(struct buf *bp)
|
||||
|
||||
struct buf_queue_head {
|
||||
TAILQ_HEAD(buf_queue, buf) queue;
|
||||
daddr_t last_pblkno;
|
||||
daddr64_t last_pblkno;
|
||||
struct buf *insert_point;
|
||||
struct buf *switch_point;
|
||||
};
|
||||
|
@ -71,6 +71,7 @@ typedef char * caddr_t; /* core address */
|
||||
typedef __const char * c_caddr_t; /* core address, pointer to const */
|
||||
typedef __volatile char *v_caddr_t; /* core address, pointer to volatile */
|
||||
typedef int32_t daddr_t; /* disk address */
|
||||
typedef int64_t daddr64_t; /* 64-bit disk address */
|
||||
typedef u_int32_t u_daddr_t; /* unsigned disk address */
|
||||
typedef u_int32_t fixpt_t; /* fixed point number */
|
||||
|
||||
|
@ -511,8 +511,8 @@ ffs_snapshot(mp, snapfile)
|
||||
/*
|
||||
* 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 @@ ffs_copyonwrite(devvp, bp)
|
||||
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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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;
|
||||
|
@ -193,7 +193,7 @@ vnode_pager_haspage(object, pindex, before, after)
|
||||
int *after;
|
||||
{
|
||||
struct vnode *vp = object->handle;
|
||||
daddr_t bn;
|
||||
daddr64_t bn;
|
||||
int err;
|
||||
daddr_t reqblock;
|
||||
int poff;
|
||||
@ -370,7 +370,7 @@ vnode_pager_addr(vp, address, run)
|
||||
{
|
||||
int rtaddress;
|
||||
int bsize;
|
||||
daddr_t block;
|
||||
daddr64_t block;
|
||||
struct vnode *rtvp;
|
||||
int err;
|
||||
daddr_t vblock;
|
||||
|
Loading…
Reference in New Issue
Block a user