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 <jh saunalahti fi>
Reviewed by:	bde
Discussed on:   freebsd-fs
MFC after:	1 month
This commit is contained in:
Konstantin Belousov 2008-09-20 19:46:45 +00:00
parent ea60a5f526
commit 86dacdfe2b
4 changed files with 1 additions and 12 deletions

View File

@ -366,9 +366,7 @@ tmpfs_getattr(struct vop_getattr_args *v)
vap->va_rdev = (vp->v_type == VBLK || vp->v_type == VCHR) ? vap->va_rdev = (vp->v_type == VBLK || vp->v_type == VCHR) ?
node->tn_rdev : VNOVAL; node->tn_rdev : VNOVAL;
vap->va_bytes = round_page(node->tn_size); vap->va_bytes = round_page(node->tn_size);
vap->va_filerev = VNOVAL; vap->va_filerev = 0;
vap->va_vaflags = 0;
vap->va_spare = VNOVAL; /* XXX */
return 0; return 0;
} }

View File

@ -273,15 +273,9 @@ _xfs_getattr(
/* /*
* Fields with no direct equivalent in XFS * Fields with no direct equivalent in XFS
* leave initialized by VATTR_NULL
*/ */
#if 0
vap->va_filerev = 0; vap->va_filerev = 0;
vap->va_birthtime = va.va_ctime;
vap->va_vaflags = 0;
vap->va_flags = 0; vap->va_flags = 0;
vap->va_spare = 0;
#endif
return (0); return (0);
} }

View File

@ -1184,7 +1184,6 @@ mqfs_getattr(struct vop_getattr_args *ap)
vap->va_rdev = 0; vap->va_rdev = 0;
vap->va_bytes = 0; vap->va_bytes = 0;
vap->va_filerev = 0; vap->va_filerev = 0;
vap->va_vaflags = 0;
return (error); return (error);
} }

View File

@ -433,8 +433,6 @@ ufs_getattr(ap)
vap->va_mtime.tv_nsec = ip->i_din1->di_mtimensec; vap->va_mtime.tv_nsec = ip->i_din1->di_mtimensec;
vap->va_ctime.tv_sec = ip->i_din1->di_ctime; vap->va_ctime.tv_sec = ip->i_din1->di_ctime;
vap->va_ctime.tv_nsec = ip->i_din1->di_ctimensec; 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); vap->va_bytes = dbtob((u_quad_t)ip->i_din1->di_blocks);
} else { } else {
vap->va_rdev = ip->i_din2->di_rdev; vap->va_rdev = ip->i_din2->di_rdev;