summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-08-13 10:56:07 +0000
committerphk <phk@FreeBSD.org>1999-08-13 10:56:07 +0000
commita45a44a2bd495a4e4d145ff790111119719a4413 (patch)
tree68ad522dac531790986216c13cd96429a80dc48b /sys/kern/vfs_vnops.c
parent32e3f043bb6d389bf3e42da37b08431f98758c0c (diff)
downloadFreeBSD-src-a45a44a2bd495a4e4d145ff790111119719a4413.zip
FreeBSD-src-a45a44a2bd495a4e4d145ff790111119719a4413.tar.gz
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.
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c17
1 files changed, 15 insertions, 2 deletions
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 <sys/param.h>
@@ -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;
OpenPOWER on IntegriCloud