1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Use vfs_timestamp() instead of getnanotime().

Add magic stuff copied from ufs_setattr().

Instructed by:	bde
This commit is contained in:
Poul-Henning Kamp 2001-11-03 17:00:02 +00:00
parent 93432a92a4
commit 9607027339
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85980

View File

@ -656,11 +656,13 @@ devfs_setattr(ap)
{
struct devfs_dirent *de;
struct vattr *vap;
struct vnode *vp;
int c, error;
uid_t uid;
gid_t gid;
vap = ap->a_vap;
vp = ap->a_vp;
if ((vap->va_type != VNON) ||
(vap->va_nlink != VNOVAL) ||
(vap->va_fsid != VNOVAL) ||
@ -673,8 +675,8 @@ devfs_setattr(ap)
return (EINVAL);
}
de = ap->a_vp->v_data;
if (ap->a_vp->v_type == VDIR)
de = vp->v_data;
if (vp->v_type == VDIR)
de = de->de_dir;
error = c = 0;
@ -695,6 +697,13 @@ devfs_setattr(ap)
de->de_gid = gid;
c = 1;
}
/* see comment in ufs_vnops::ufs_setattr() */
if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td)) &&
((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
(error = VOP_ACCESS(vp, VWRITE, ap->a_cred, ap->a_td))))
return (error);
if (vap->va_mode != (mode_t)VNOVAL) {
if ((ap->a_cred->cr_uid != de->de_uid) &&
(error = suser(ap->a_td->td_proc)))
@ -718,7 +727,7 @@ devfs_setattr(ap)
}
if (c)
getnanotime(&de->de_ctime);
vfs_timestamp(&de->de_ctime);
return (0);
}