Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/devfs/devfs_vnops.c
Show First 20 Lines • Show All 701 Lines • ▼ Show 20 Lines | devfs_fsync(struct vop_fsync_args *ap) | ||||
return (vop_stdfsync(ap)); | return (vop_stdfsync(ap)); | ||||
} | } | ||||
static int | static int | ||||
devfs_getattr(struct vop_getattr_args *ap) | devfs_getattr(struct vop_getattr_args *ap) | ||||
{ | { | ||||
struct vnode *vp = ap->a_vp; | struct vnode *vp = ap->a_vp; | ||||
struct vattr *vap = ap->a_vap; | struct vattr *vap = ap->a_vap; | ||||
int error; | |||||
struct devfs_dirent *de; | struct devfs_dirent *de; | ||||
struct devfs_mount *dmp; | struct devfs_mount *dmp; | ||||
struct cdev *dev; | struct cdev *dev; | ||||
struct timeval boottime; | |||||
int error; | |||||
error = devfs_populate_vp(vp); | error = devfs_populate_vp(vp); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
dmp = VFSTODEVFS(vp->v_mount); | dmp = VFSTODEVFS(vp->v_mount); | ||||
sx_xunlock(&dmp->dm_lock); | sx_xunlock(&dmp->dm_lock); | ||||
Show All 13 Lines | else if (vp->v_type == VDIR) | ||||
vap->va_size = vap->va_bytes = DEV_BSIZE; | vap->va_size = vap->va_bytes = DEV_BSIZE; | ||||
else | else | ||||
vap->va_size = 0; | vap->va_size = 0; | ||||
if (vp->v_type != VDIR) | if (vp->v_type != VDIR) | ||||
vap->va_bytes = 0; | vap->va_bytes = 0; | ||||
vap->va_blocksize = DEV_BSIZE; | vap->va_blocksize = DEV_BSIZE; | ||||
vap->va_type = vp->v_type; | vap->va_type = vp->v_type; | ||||
getboottime(&boottime); | |||||
#define fix(aa) \ | #define fix(aa) \ | ||||
do { \ | do { \ | ||||
if ((aa).tv_sec <= 3600) { \ | if ((aa).tv_sec <= 3600) { \ | ||||
(aa).tv_sec = boottime.tv_sec; \ | (aa).tv_sec = boottime.tv_sec; \ | ||||
(aa).tv_nsec = boottime.tv_usec * 1000; \ | (aa).tv_nsec = boottime.tv_usec * 1000; \ | ||||
} \ | } \ | ||||
} while (0) | } while (0) | ||||
▲ Show 20 Lines • Show All 1,184 Lines • Show Last 20 Lines |