From 86dacdfe2b2ec55ab6386053534f87149162b433 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 20 Sep 2008 19:46:45 +0000 Subject: [PATCH] Initialize va_flags and va_filerev properly in VOP_GETATTR(). Don't initialize va_vaflags and va_spare because they are not part of the VOP_GETATTR() API. Also don't initialize birthtime to ctime or zero. Submitted by: Jaakko Heinonen Reviewed by: bde Discussed on: freebsd-fs MFC after: 1 month --- sys/fs/tmpfs/tmpfs_vnops.c | 4 +--- sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c | 6 ------ sys/kern/uipc_mqueue.c | 1 - sys/ufs/ufs/ufs_vnops.c | 2 -- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index a7eadad4429b..3eb44decc276 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -366,9 +366,7 @@ tmpfs_getattr(struct vop_getattr_args *v) vap->va_rdev = (vp->v_type == VBLK || vp->v_type == VCHR) ? node->tn_rdev : VNOVAL; vap->va_bytes = round_page(node->tn_size); - vap->va_filerev = VNOVAL; - vap->va_vaflags = 0; - vap->va_spare = VNOVAL; /* XXX */ + vap->va_filerev = 0; return 0; } diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c b/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c index f09e9ce282a6..0ef2e91ab65d 100644 --- a/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c +++ b/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c @@ -273,15 +273,9 @@ _xfs_getattr( /* * Fields with no direct equivalent in XFS - * leave initialized by VATTR_NULL */ -#if 0 vap->va_filerev = 0; - vap->va_birthtime = va.va_ctime; - vap->va_vaflags = 0; vap->va_flags = 0; - vap->va_spare = 0; -#endif return (0); } diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index 3b73f400e53d..fc8a20f4cbcd 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -1184,7 +1184,6 @@ mqfs_getattr(struct vop_getattr_args *ap) vap->va_rdev = 0; vap->va_bytes = 0; vap->va_filerev = 0; - vap->va_vaflags = 0; return (error); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 904f553b6b22..12fd13bbadb3 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -433,8 +433,6 @@ ufs_getattr(ap) vap->va_mtime.tv_nsec = ip->i_din1->di_mtimensec; vap->va_ctime.tv_sec = ip->i_din1->di_ctime; vap->va_ctime.tv_nsec = ip->i_din1->di_ctimensec; - vap->va_birthtime.tv_sec = 0; - vap->va_birthtime.tv_nsec = 0; vap->va_bytes = dbtob((u_quad_t)ip->i_din1->di_blocks); } else { vap->va_rdev = ip->i_din2->di_rdev;