diff options
| author | Matthew Dillon <dillon@FreeBSD.org> | 1999-02-25 05:35:53 +0000 |
|---|---|---|
| committer | Matthew Dillon <dillon@FreeBSD.org> | 1999-02-25 05:35:53 +0000 |
| commit | 06f7b4ebd107bd3efecfe08eb9e1ac3336d9c735 (patch) | |
| tree | 7a27a9c8297dd43a6c0f9f0095a942da5d183071 /sys | |
| parent | 155f87daf2927a5bb3aba921b3b48a1d1e23cbe7 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index e54f2b2b0742b..4c9c426f10a1f 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95 - * $Id: ufs_vnops.c,v 1.106 1999/01/28 00:57:56 dillon Exp $ + * $Id: ufs_vnops.c,v 1.107 1999/02/13 08:38:28 dillon Exp $ */ #include "opt_quota.h" @@ -396,13 +396,20 @@ ufs_getattr(ap) vap->va_ctime.tv_nsec = ip->i_ctimensec; vap->va_flags = ip->i_flags; vap->va_gen = ip->i_gen; - /* this doesn't belong here */ - if (vp->v_type == VBLK) - vap->va_blocksize = BLKDEV_IOSIZE; - else if (vp->v_type == VCHR) - vap->va_blocksize = MAXBSIZE; - else + + /* + * Use the information contained in v_specinfo for VBLK and VCHR + * vnodes, and in the underlying mount point for (typically) VREG + * vnodes. Note that vp->v_specmountpoint can be NULL. + */ + if (vp->v_type == VBLK) { + vap->va_blocksize = vp->v_specinfo->si_bsize_best; + } else if (vp->v_type == VCHR) { + vap->va_blocksize = vp->v_specinfo->si_bsize_max; + } else { vap->va_blocksize = vp->v_mount->mnt_stat.f_iosize; + } + vap->va_bytes = dbtob((u_quad_t)ip->i_blocks); vap->va_type = IFTOVT(ip->i_mode); vap->va_filerev = ip->i_modrev; |
