diff options
author | dyson <dyson@FreeBSD.org> | 1995-12-11 04:58:34 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1995-12-11 04:58:34 +0000 |
commit | 601ed1a4c089930a40f8f1dedb927f3b5b9f2d90 (patch) | |
tree | 2b7bb6b5f65218fdc977df2e1db5ccaf89d154c6 /sys/miscfs/specfs | |
parent | 0e4700269e1c805f7d7e0caae28fbaebf096ac31 (diff) | |
download | FreeBSD-src-601ed1a4c089930a40f8f1dedb927f3b5b9f2d90.zip FreeBSD-src-601ed1a4c089930a40f8f1dedb927f3b5b9f2d90.tar.gz |
Changes to support 1Tb filesizes. Pages are now named by an
(object,index) pair instead of (object,offset) pair.
Diffstat (limited to 'sys/miscfs/specfs')
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 37 | ||||
-rw-r--r-- | sys/miscfs/specfs/specdev.h | 5 |
2 files changed, 38 insertions, 4 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 3a04353..e3dbfaf 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94 - * $Id: spec_vnops.c,v 1.21 1995/12/07 12:47:17 davidg Exp $ + * $Id: spec_vnops.c,v 1.22 1995/12/08 11:17:52 julian Exp $ */ #include <sys/param.h> @@ -365,7 +365,8 @@ spec_write(ap) } error = uiomove((char *)bp->b_data + on, n, uio); if (n + on == bsize) { - bawrite(bp); + /* bawrite(bp); */ + cluster_write(bp, 0); } else bdwrite(bp); } while (error == 0 && uio->uio_resid > 0 && n != 0); @@ -750,7 +751,7 @@ spec_getpages(ap) /* * Calculate the size of the transfer. */ - blkno = (ap->a_m[0]->offset + ap->a_offset) / DEV_BSIZE; + blkno = (IDX_TO_OFF(ap->a_m[0]->pindex) + ap->a_offset) / DEV_BSIZE; /* * Round up physical size for real devices. @@ -839,3 +840,33 @@ spec_getpages(ap) printf("spec_getpages: I/O read error\n"); return (error ? VM_PAGER_ERROR : VM_PAGER_OK); } + +/* ARGSUSED */ +int +spec_getattr(ap) + struct vop_getattr_args /* { + struct vnode *a_vp; + struct vattr *a_vap; + struct ucred *a_cred; + struct proc *a_p; + } */ *ap; +{ + register struct vnode *vp = ap->a_vp; + register struct vattr *vap = ap->a_vap; + struct partinfo dpart; + + bzero(vap, sizeof (*vap)); + + if (vp->v_type == VBLK) + vap->va_blocksize = BLKDEV_IOSIZE; + else if (vp->v_type == VCHR) + vap->va_blocksize = MAXBSIZE; + + if ((*bdevsw[major(vp->v_rdev)].d_ioctl)(vp->v_rdev, DIOCGPART, + (caddr_t)&dpart, FREAD, ap->a_p) == 0) { + vap->va_bytes = (u_quad_t) dpart.disklab->d_partitions[minor(vp->v_rdev)].p_size * DEV_BSIZE; + vap->va_size = vap->va_bytes; + } + return (0); +} + diff --git a/sys/miscfs/specfs/specdev.h b/sys/miscfs/specfs/specdev.h index c10bf89..d5f3755 100644 --- a/sys/miscfs/specfs/specdev.h +++ b/sys/miscfs/specfs/specdev.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)specdev.h 8.2 (Berkeley) 2/2/94 - * $Id: specdev.h,v 1.5 1995/11/09 08:16:12 bde Exp $ + * $Id: specdev.h,v 1.6 1995/11/21 12:54:02 bde Exp $ */ /* @@ -89,7 +89,10 @@ int spec_lookup __P((struct vop_lookup_args *)); int spec_open __P((struct vop_open_args *)); int spec_close __P((struct vop_close_args *)); #define spec_access ((int (*) __P((struct vop_access_args *)))spec_ebadf) +/* #define spec_getattr ((int (*) __P((struct vop_getattr_args *)))spec_ebadf) +*/ +int spec_getattr __P((struct vop_getattr_args *)); #define spec_setattr ((int (*) __P((struct vop_setattr_args *)))spec_ebadf) int spec_read __P((struct vop_read_args *)); int spec_write __P((struct vop_write_args *)); |