+ int ret;
+ char buf[8];
+
+ if (!lp_store_create_time(SNUM(conn))) {
+ return NT_STATUS_OK;
+ }
+
+ put_long_date_timespec(conn->ts_res, buf, create_time);
+ if (fsp && fsp->fh->fd != -1) {
+ ret = SMB_VFS_FSETXATTR(fsp,
+ SAMBA_XATTR_DOSTIMESTAMPS,
+ buf,
+ sizeof(buf),
+ 0);
+ } else {
+ ret = SMB_VFS_SETXATTR(conn,
+ smb_fname->base_name,
+ SAMBA_XATTR_DOSTIMESTAMPS,
+ buf,
+ sizeof(buf),
+ 0);
+ }
+
+ if (ret == -1) {
+ map_nt_error_from_unix(errno);
+ }
+ DEBUG(10,("set_create_timespec_ea: wrote create time EA for file %s\n",
+ smb_fname_str_dbg(smb_fname)));
+ return NT_STATUS_OK;
+}
+
+/******************************************************************
+ Returns an EA create timespec, or a zero timespec if fail.
+******************************************************************/
+
+static struct timespec get_create_timespec_ea(connection_struct *conn,
+ struct files_struct *fsp,
+ const struct smb_filename *smb_fname)
+{
+ ssize_t ret;
+ char buf[8];
+ struct timespec ts;
+
+ ZERO_STRUCT(ts);
+
+ if (!lp_store_create_time(SNUM(conn))) {
+ return ts;