From a45a44a2bd495a4e4d145ff790111119719a4413 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 13 Aug 1999 10:56:07 +0000 Subject: Move the special-casing of stat(2)->st_blksize for device files from UFS to the generic level. For chr/blk devices we don't care about the blocksize of the filesystem, we want what the device asked for. --- sys/kern/vfs_vnops.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sys/kern/vfs_vnops.c') diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index c6663de..bb86490 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94 - * $Id: vfs_vnops.c,v 1.71 1999/07/26 06:25:18 alc Exp $ + * $Id: vfs_vnops.c,v 1.72 1999/08/04 18:53:49 green Exp $ */ #include @@ -428,7 +428,20 @@ vn_stat(vp, sb, p) sb->st_atimespec = vap->va_atime; sb->st_mtimespec = vap->va_mtime; sb->st_ctimespec = vap->va_ctime; - sb->st_blksize = vap->va_blocksize; + /* + * For block and char device nodes we don't really care + * about what the filesystem told us, we want to know + * what the device told us + */ + switch (vap->va_type) { + case VBLK: + sb->st_blksize = vp->v_rdev->si_bsize_best; + case VCHR: + sb->st_blksize = vp->v_rdev->si_bsize_max; + default: + sb->st_blksize = vap->va_blocksize; + break; + } sb->st_flags = vap->va_flags; if (suser_xxx(p->p_ucred, 0, 0)) sb->st_gen = 0; -- cgit v1.1