aboutsummaryrefslogtreecommitdiff
path: root/sys/miscfs/specfs
diff options
context:
space:
mode:
authorJohn Dyson <dyson@FreeBSD.org>1995-12-11 04:58:34 +0000
committerJohn Dyson <dyson@FreeBSD.org>1995-12-11 04:58:34 +0000
commita316d390bda3e185e04632e807a012a345492935 (patch)
tree2b7bb6b5f65218fdc977df2e1db5ccaf89d154c6 /sys/miscfs/specfs
parentc3fda50ba5d12fa986a82de7b66138d317516393 (diff)
downloadsrc-a316d390bda3e185e04632e807a012a345492935.tar.gz
src-a316d390bda3e185e04632e807a012a345492935.zip
Changes to support 1Tb filesizes. Pages are now named by an
(object,index) pair instead of (object,offset) pair.
Notes
Notes: svn path=/head/; revision=12767
Diffstat (limited to 'sys/miscfs/specfs')
-rw-r--r--sys/miscfs/specfs/spec_vnops.c37
-rw-r--r--sys/miscfs/specfs/specdev.h5
2 files changed, 38 insertions, 4 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c
index 3a04353b578e..e3dbfafd682a 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 c10bf8916488..d5f37553d154 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 *));