Set cache entry to dirty when timestamps are changed. Otherwise, it wouldn't be written back.

This commit is contained in:
Sebastian Messmer 2016-06-09 17:32:35 -07:00
parent da187e3142
commit c5ccd9c2d1
2 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,7 @@ CryOpenFile::~CryOpenFile() {
void CryOpenFile::flush() { void CryOpenFile::flush() {
_device->callFsActionCallbacks(); _device->callFsActionCallbacks();
_fileBlob->flush(); _fileBlob->flush();
_parent->flush();
} }
void CryOpenFile::stat(struct ::stat *result) const { void CryOpenFile::stat(struct ::stat *result) const {
@ -59,6 +60,7 @@ void CryOpenFile::write(const void *buf, size_t count, off_t offset) {
void CryOpenFile::fsync() { void CryOpenFile::fsync() {
_device->callFsActionCallbacks(); _device->callFsActionCallbacks();
_fileBlob->flush(); _fileBlob->flush();
_parent->flush();
} }
void CryOpenFile::fdatasync() { void CryOpenFile::fdatasync() {

View File

@ -161,11 +161,13 @@ void DirBlob::statChildExceptSize(const Key &key, struct ::stat *result) const {
void DirBlob::updateAccessTimestampForChild(const Key &key) { void DirBlob::updateAccessTimestampForChild(const Key &key) {
std::unique_lock<std::mutex> lock(_mutex); std::unique_lock<std::mutex> lock(_mutex);
_entries.updateAccessTimestampForChild(key); _entries.updateAccessTimestampForChild(key);
_changed = true;
} }
void DirBlob::updateModificationTimestampForChild(const Key &key) { void DirBlob::updateModificationTimestampForChild(const Key &key) {
std::unique_lock<std::mutex> lock(_mutex); std::unique_lock<std::mutex> lock(_mutex);
_entries.updateModificationTimestampForChild(key); _entries.updateModificationTimestampForChild(key);
_changed = true;
} }
void DirBlob::chmodChild(const Key &key, mode_t mode) { void DirBlob::chmodChild(const Key &key, mode_t mode) {