Index: sys/cddl/compat/opensolaris/sys/vnode.h =================================================================== --- sys/cddl/compat/opensolaris/sys/vnode.h +++ sys/cddl/compat/opensolaris/sys/vnode.h @@ -141,6 +141,8 @@ vap->va_mask |= AT_ATIME; if (vap->va_mtime.tv_sec != VNOVAL) vap->va_mask |= AT_MTIME; + if (vap->va_birthtime.tv_sec != VNOVAL) + vap->va_mask |= AT_CRTIME; if (vap->va_mode != (u_short)VNOVAL) vap->va_mask |= AT_MODE; if (vap->va_flags != VNOVAL) Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -3009,7 +3009,7 @@ uint64_t new_mode; uint64_t new_uid, new_gid; uint64_t xattr_obj; - uint64_t mtime[2], ctime[2]; + uint64_t mtime[2], ctime[2], crtime[2]; znode_t *attrzp; int need_policy = FALSE; int err, err2; @@ -3085,9 +3085,10 @@ * handle times greater than 2039. This check should be removed * once large timestamps are fully supported. */ - if (mask & (AT_ATIME | AT_MTIME)) { + if (mask & (AT_ATIME | AT_MTIME | AT_CRTIME)) { if (((mask & AT_ATIME) && TIMESPEC_OVERFLOW(&vap->va_atime)) || - ((mask & AT_MTIME) && TIMESPEC_OVERFLOW(&vap->va_mtime))) { + ((mask & AT_MTIME) && TIMESPEC_OVERFLOW(&vap->va_mtime)) || + ((mask & AT_CRTIME) && TIMESPEC_OVERFLOW(&vap->va_birthtime))) { ZFS_EXIT(zfsvfs); return (SET_ERROR(EOVERFLOW)); } @@ -3122,7 +3123,7 @@ } } - if (mask & (AT_ATIME|AT_MTIME) || + if (mask & (AT_ATIME|AT_MTIME|AT_CRTIME) || ((mask & AT_XVATTR) && (XVA_ISSET_REQ(xvap, XAT_HIDDEN) || XVA_ISSET_REQ(xvap, XAT_READONLY) || XVA_ISSET_REQ(xvap, XAT_ARCHIVE) || @@ -3513,6 +3514,12 @@ mtime, sizeof (mtime)); } + if (mask & AT_CRTIME) { + ZFS_TIME_ENCODE(&vap->va_birthtime, crtime); + SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CRTIME(zfsvfs), NULL, + crtime, sizeof (crtime)); + } + /* XXX - shouldn't this be done *before* the ATIME/MTIME checks? */ if (mask & AT_SIZE && !(mask & AT_MTIME)) { SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MTIME(zfsvfs), Index: sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h +++ sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h @@ -162,7 +162,7 @@ #define AT_RDEV 0x00800 #define AT_BLKSIZE 0x01000 #define AT_NBLOCKS 0x02000 -/* 0x04000 */ /* unused */ +#define AT_CRTIME 0x04000 /* FreeBSD specific */ #define AT_SEQ 0x08000 /* * If AT_XVATTR is set then there are additional bits to process in