diff options
author | sos <sos@FreeBSD.org> | 1997-05-01 19:12:22 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 1997-05-01 19:12:22 +0000 |
commit | 96427055167c825bade83b8b043feda743ec83a0 (patch) | |
tree | dbfc179d793ed6b24e7691166970fee0698b73f6 /sys/miscfs | |
parent | dded68c16d0aacdde8a9c62f5ad9fdc24292a974 (diff) | |
download | FreeBSD-src-96427055167c825bade83b8b043feda743ec83a0.zip FreeBSD-src-96427055167c825bade83b8b043feda743ec83a0.tar.gz |
Remove the dependancy on DEV_BSIZE, now specfs works on != 512byte
sector devices given that the fs uses a blocksize of at least a physical
sector size.
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 1efeedb..7a346f6 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.14 (Berkeley) 5/21/95 - * $Id: spec_vnops.c,v 1.37 1997/02/22 09:40:34 peter Exp $ + * $Id: spec_vnops.c,v 1.38 1997/03/24 11:24:44 bde Exp $ */ #include <sys/param.h> @@ -759,6 +759,8 @@ spec_getpages(ap) daddr_t blkno; struct buf *bp; vm_ooffset_t offset; + struct vnode *vp = ap->a_vp; + int blksiz; error = 0; pcount = round_page(ap->a_count) / PAGE_SIZE; @@ -783,9 +785,14 @@ spec_getpages(ap) blkno = btodb(offset); /* - * Round up physical size for real devices. + * Round up physical size for real devices, use the + * fundamental blocksize of the fs if possible. */ - size = (ap->a_count + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1); + if (vp && vp->v_mount) + blksiz = vp->v_mount->mnt_stat.f_bsize; + else + blksiz = DEV_BSIZE; + size = (ap->a_count + blksiz - 1) & ~(blksiz - 1); bp = getpbuf(); kva = (vm_offset_t)bp->b_data; |