diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-06-02 00:45:22 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-06-02 00:45:22 +0000 |
commit | 7cc9559d2d92503806396b6cde39283a6b94fcf3 (patch) | |
tree | 7fa95ab7f00a048e20f77b68512b4ed2acfa9fcd | |
parent | e826feabf36f1df8734f6d092157868a88a2838d (diff) |
daddr_t -> daddr64_t for specfs. convert some variables
to proper types along the way (ints), fixes a subtle bug
wich otto@ pointed me at.
ok deraadt@
-rw-r--r-- | sys/kern/spec_vnops.c | 20 | ||||
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 20 | ||||
-rw-r--r-- | sys/miscfs/specfs/specdev.h | 4 | ||||
-rw-r--r-- | sys/sys/specdev.h | 4 |
4 files changed, 24 insertions, 24 deletions
diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c index 139cef8871a..906a9422a13 100644 --- a/sys/kern/spec_vnops.c +++ b/sys/kern/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.41 2007/06/01 23:47:57 deraadt Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.42 2007/06/02 00:45:21 thib Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -221,8 +221,8 @@ spec_read(v) register struct uio *uio = ap->a_uio; struct proc *p = uio->uio_procp; struct buf *bp; - daddr64_t bn, nextbn; - long bsize, bscale; + daddr64_t bn, nextbn, bscale; + int bsize; struct partinfo dpart; int n, on, majordev; int (*ioctl)(dev_t, u_long, caddr_t, int, struct proc *); @@ -265,13 +265,13 @@ spec_read(v) do { bn = btodb(uio->uio_offset) & ~(bscale - 1); on = uio->uio_offset % bsize; - n = min((unsigned)(bsize - on), uio->uio_resid); + n = min((bsize - on), uio->uio_resid); if (vp->v_lastr + bscale == bn) { nextbn = bn + bscale; - error = breadn(vp, bn, (int)bsize, &nextbn, - (int *)&bsize, 1, NOCRED, &bp); + error = breadn(vp, bn, bsize, &nextbn, &bsize, + 1, NOCRED, &bp); } else - error = bread(vp, bn, (int)bsize, NOCRED, &bp); + error = bread(vp, bn, bsize, NOCRED, &bp); vp->v_lastr = bn; n = min(n, bsize - bp->b_resid); if (error) { @@ -312,8 +312,8 @@ spec_write(v) register struct uio *uio = ap->a_uio; struct proc *p = uio->uio_procp; struct buf *bp; - daddr_t bn; - long bsize, bscale; + daddr64_t bn, bscale; + int bsize; struct partinfo dpart; int n, on, majordev; int (*ioctl)(dev_t, u_long, caddr_t, int, struct proc *); @@ -356,7 +356,7 @@ spec_write(v) do { bn = btodb(uio->uio_offset) & ~(bscale - 1); on = uio->uio_offset % bsize; - n = min((unsigned)(bsize - on), uio->uio_resid); + n = min((bsize - on), uio->uio_resid); error = bread(vp, bn, bsize, NOCRED, &bp); n = min(n, bsize - bp->b_resid); if (error) { diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 139cef8871a..906a9422a13 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.41 2007/06/01 23:47:57 deraadt Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.42 2007/06/02 00:45:21 thib Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -221,8 +221,8 @@ spec_read(v) register struct uio *uio = ap->a_uio; struct proc *p = uio->uio_procp; struct buf *bp; - daddr64_t bn, nextbn; - long bsize, bscale; + daddr64_t bn, nextbn, bscale; + int bsize; struct partinfo dpart; int n, on, majordev; int (*ioctl)(dev_t, u_long, caddr_t, int, struct proc *); @@ -265,13 +265,13 @@ spec_read(v) do { bn = btodb(uio->uio_offset) & ~(bscale - 1); on = uio->uio_offset % bsize; - n = min((unsigned)(bsize - on), uio->uio_resid); + n = min((bsize - on), uio->uio_resid); if (vp->v_lastr + bscale == bn) { nextbn = bn + bscale; - error = breadn(vp, bn, (int)bsize, &nextbn, - (int *)&bsize, 1, NOCRED, &bp); + error = breadn(vp, bn, bsize, &nextbn, &bsize, + 1, NOCRED, &bp); } else - error = bread(vp, bn, (int)bsize, NOCRED, &bp); + error = bread(vp, bn, bsize, NOCRED, &bp); vp->v_lastr = bn; n = min(n, bsize - bp->b_resid); if (error) { @@ -312,8 +312,8 @@ spec_write(v) register struct uio *uio = ap->a_uio; struct proc *p = uio->uio_procp; struct buf *bp; - daddr_t bn; - long bsize, bscale; + daddr64_t bn, bscale; + int bsize; struct partinfo dpart; int n, on, majordev; int (*ioctl)(dev_t, u_long, caddr_t, int, struct proc *); @@ -356,7 +356,7 @@ spec_write(v) do { bn = btodb(uio->uio_offset) & ~(bscale - 1); on = uio->uio_offset % bsize; - n = min((unsigned)(bsize - on), uio->uio_resid); + n = min((bsize - on), uio->uio_resid); error = bread(vp, bn, bsize, NOCRED, &bp); n = min(n, bsize - bp->b_resid); if (error) { diff --git a/sys/miscfs/specfs/specdev.h b/sys/miscfs/specfs/specdev.h index c95b18393d4..24db8d31f1a 100644 --- a/sys/miscfs/specfs/specdev.h +++ b/sys/miscfs/specfs/specdev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specdev.h,v 1.19 2007/01/16 17:52:18 thib Exp $ */ +/* $OpenBSD: specdev.h,v 1.20 2007/06/02 00:45:21 thib Exp $ */ /* $NetBSD: specdev.h,v 1.12 1996/02/13 13:13:01 mycroft Exp $ */ /* @@ -43,7 +43,7 @@ struct specinfo { struct mount *si_mountpoint; dev_t si_rdev; struct lockf *si_lockf; - daddr_t si_lastr; + daddr64_t si_lastr; union { struct vnode *ci_parent; /* pointer back to parent device */ u_int8_t ci_bitmap[8]; /* bitmap of devices cloned off us */ diff --git a/sys/sys/specdev.h b/sys/sys/specdev.h index c95b18393d4..24db8d31f1a 100644 --- a/sys/sys/specdev.h +++ b/sys/sys/specdev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specdev.h,v 1.19 2007/01/16 17:52:18 thib Exp $ */ +/* $OpenBSD: specdev.h,v 1.20 2007/06/02 00:45:21 thib Exp $ */ /* $NetBSD: specdev.h,v 1.12 1996/02/13 13:13:01 mycroft Exp $ */ /* @@ -43,7 +43,7 @@ struct specinfo { struct mount *si_mountpoint; dev_t si_rdev; struct lockf *si_lockf; - daddr_t si_lastr; + daddr64_t si_lastr; union { struct vnode *ci_parent; /* pointer back to parent device */ u_int8_t ci_bitmap[8]; /* bitmap of devices cloned off us */ |