[ox/fs] Fix duplication of dir entries on update of file
This commit is contained in:
parent
2be5b0f6bc
commit
f10373864d
1
deps/ox/src/ox/fs/filesystem/directory.hpp
vendored
1
deps/ox/src/ox/fs/filesystem/directory.hpp
vendored
@ -240,7 +240,6 @@ Error Directory<FileStore, InodeId_t>::write(PathIterator path, InodeId_t inode,
|
|||||||
return OxError(1, "Could not allocate memory for copy of Directory");
|
return OxError(1, "Could not allocate memory for copy of Directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: look for old version of this entry and delete it
|
|
||||||
oxReturnError(cpy->setSize(newSize));
|
oxReturnError(cpy->setSize(newSize));
|
||||||
auto val = cpy->malloc(entryDataSize).value;
|
auto val = cpy->malloc(entryDataSize).value;
|
||||||
if (!val.valid()) {
|
if (!val.valid()) {
|
||||||
|
2
deps/ox/src/ox/fs/filesystem/filesystem.hpp
vendored
2
deps/ox/src/ox/fs/filesystem/filesystem.hpp
vendored
@ -333,9 +333,9 @@ Error FileSystemTemplate<FileStore, Directory>::write(const char *path, const vo
|
|||||||
if (err) {
|
if (err) {
|
||||||
oxRequire(generatedId, m_fs.generateInodeId());
|
oxRequire(generatedId, m_fs.generateInodeId());
|
||||||
inode = generatedId;
|
inode = generatedId;
|
||||||
}
|
|
||||||
oxRequireM(rootDir, this->rootDir());
|
oxRequireM(rootDir, this->rootDir());
|
||||||
oxReturnError(rootDir.write(path, inode));
|
oxReturnError(rootDir.write(path, inode));
|
||||||
|
}
|
||||||
oxReturnError(write(inode, buffer, size, fileType));
|
oxReturnError(write(inode, buffer, size, fileType));
|
||||||
return OxError(0);
|
return OxError(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user