Initialize va_rdev to NODEV instead of 0 or VNOVAL in VOP_GETATTR().

NODEV is more appropriate when va_rdev doesn't have a meaningful value.

Submitted by:   Jaakko Heinonen <jh saunalahti fi>
Suggested by:   bde
Discussed on:   freebsd-fs
MFC after:	1 month
This commit is contained in:
Konstantin Belousov 2008-09-20 19:49:15 +00:00
parent 0fbbf2ea56
commit 4c5a20e3da
9 changed files with 9 additions and 9 deletions

View File

@ -407,7 +407,7 @@ fdesc_getattr(ap)
vap->va_ctime = vap->va_mtime;
vap->va_gen = 0;
vap->va_flags = 0;
vap->va_rdev = 0;
vap->va_rdev = NODEV;
vap->va_bytes = 0;
break;

View File

@ -424,7 +424,7 @@ hpfs_getattr(ap)
vap->va_nlink = 1;
vap->va_uid = hp->h_uid;
vap->va_gid = hp->h_gid;
vap->va_rdev = 0; /* XXX UNODEV ? */
vap->va_rdev = NODEV;
vap->va_size = hp->h_fn.fn_size;
vap->va_bytes = ((hp->h_fn.fn_size + DEV_BSIZE-1) & ~(DEV_BSIZE-1)) +
DEV_BSIZE;

View File

@ -334,7 +334,7 @@ msdosfs_getattr(ap)
vap->va_uid = pmp->pm_uid;
vap->va_gid = pmp->pm_gid;
vap->va_nlink = 1;
vap->va_rdev = 0;
vap->va_rdev = NODEV;
vap->va_size = dep->de_FileSize;
fattime2timespec(dep->de_MDate, dep->de_MTime, 0, 0, &vap->va_mtime);
vap->va_ctime = vap->va_mtime;

View File

@ -191,7 +191,7 @@ ntfs_getattr(ap)
vap->va_nlink = (ip->i_nlink || ip->i_flag & IN_LOADED ? ip->i_nlink : 1);
vap->va_uid = ip->i_mp->ntm_uid;
vap->va_gid = ip->i_mp->ntm_gid;
vap->va_rdev = 0; /* XXX UNODEV ? */
vap->va_rdev = NODEV;
vap->va_size = fp->f_size;
vap->va_bytes = fp->f_allocated;
vap->va_atime = ntfs_nttimetounix(fp->f_times.t_access);

View File

@ -463,7 +463,7 @@ portal_getattr(ap)
vap->va_ctime = vap->va_mtime;
vap->va_gen = 0;
vap->va_flags = 0;
vap->va_rdev = 0;
vap->va_rdev = NODEV;
/* vap->va_qbytes = 0; */
vap->va_bytes = 0;
/* vap->va_qsize = 0; */

View File

@ -438,7 +438,7 @@ smbfs_attr_cachelookup(struct vnode *vp, struct vattr *va)
va->va_atime = va->va_ctime = va->va_mtime; /* time file changed */
va->va_gen = VNOVAL; /* generation number of file */
va->va_flags = 0; /* flags defined for file */
va->va_rdev = VNOVAL; /* device the special file represents */
va->va_rdev = NODEV; /* device the special file represents */
va->va_bytes = va->va_size; /* bytes of disk space held by file */
va->va_filerev = 0; /* file modification number */
va->va_vaflags = 0; /* operations flags */

View File

@ -364,7 +364,7 @@ tmpfs_getattr(struct vop_getattr_args *v)
vap->va_gen = node->tn_gen;
vap->va_flags = node->tn_flags;
vap->va_rdev = (vp->v_type == VBLK || vp->v_type == VCHR) ?
node->tn_rdev : VNOVAL;
node->tn_rdev : NODEV;
vap->va_bytes = round_page(node->tn_size);
vap->va_filerev = 0;

View File

@ -291,7 +291,7 @@ udf_getattr(struct vop_getattr_args *a)
udf_timetotimespec(&fentry->atime, &vap->va_atime);
udf_timetotimespec(&fentry->mtime, &vap->va_mtime);
vap->va_ctime = vap->va_mtime; /* XXX Stored as an Extended Attribute */
vap->va_rdev = 0; /* XXX */
vap->va_rdev = NODEV;
if (vp->v_type & VDIR) {
/*
* Directories that are recorded within their ICB will show

View File

@ -1181,7 +1181,7 @@ mqfs_getattr(struct vop_getattr_args *ap)
vap->va_birthtime = pn->mn_birth;
vap->va_gen = 0;
vap->va_flags = 0;
vap->va_rdev = 0;
vap->va_rdev = NODEV;
vap->va_bytes = 0;
vap->va_filerev = 0;
return (error);