int rc = rgwlib.get_fe()->execute_req(&req);
if ((rc == 0) &&
(req.get_ret() == 0)) {
+ rgw_fh->set_atime(real_clock::to_timespec(real_clock::now()));
*bytes_read = req.nread;
}
assert(!nfh);
#endif
+ if (! rc) {
+ real_time t = real_clock::now();
+ parent->set_mtime(real_clock::to_timespec(t));
+ parent->set_ctime(real_clock::to_timespec(t));
+ }
+
rgw_fh->mtx.unlock();
unref(rgw_fh);
if (!rc)
rc = rc2;
} else {
+ real_time t = real_clock::now();
+ parent->set_mtime(real_clock::to_timespec(t));
+ parent->set_ctime(real_clock::to_timespec(t));
rgw_fh->mtx.unlock(); /* !LOCKED */
}
if (rgw_fh) {
if (get<1>(fhr) & RGWFileHandle::FLAG_CREATE) {
/* fill in stat data */
+ real_time t = real_clock::now();
rgw_fh->create_stat(st, mask);
- rgw_fh->set_times(real_clock::now());
+ rgw_fh->set_times(t);
rgw_fh->open_for_create(); // XXX needed?
+
+ parent->set_mtime(real_clock::to_timespec(t));
+ parent->set_ctime(real_clock::to_timespec(t));
}
(void) rgw_fh->stat(st);
get<0>(mkr) = rgw_fh;
rc2 = req.get_ret();
}
- return (((rc == 0) && (rc2 == 0)) ? 0 : -EIO);
+ if ((rc != 0) || (rc2 != 0)) {
+ return -EIO;
+ }
+
+ rgw_fh->set_ctime(real_clock::to_timespec(real_clock::now()));
+
+ return 0;
} /* RGWLibFS::setattr */
void RGWLibFS::close()
if (! op_ret) {
/* update stats */
rgw_fh->set_mtime(real_clock::to_timespec(mtime));
+ rgw_fh->set_ctime(real_clock::to_timespec(mtime));
rgw_fh->set_size(bytes_written);
}
break;
}
}
+
+ if (mask & RGW_SETATTR_ATIME)
+ state.atime = st->st_atim;
+ if (mask & RGW_SETATTR_MTIME)
+ state.mtime = st->st_mtim;
+ if (mask & RGW_SETATTR_CTIME)
+ state.ctime = st->st_ctim;
}
int stat(struct stat* st) {