[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");
|
||||
}
|
||||
|
||||
// TODO: look for old version of this entry and delete it
|
||||
oxReturnError(cpy->setSize(newSize));
|
||||
auto val = cpy->malloc(entryDataSize).value;
|
||||
if (!val.valid()) {
|
||||
|
4
deps/ox/src/ox/fs/filesystem/filesystem.hpp
vendored
4
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) {
|
||||
oxRequire(generatedId, m_fs.generateInodeId());
|
||||
inode = generatedId;
|
||||
oxRequireM(rootDir, this->rootDir());
|
||||
oxReturnError(rootDir.write(path, inode));
|
||||
}
|
||||
oxRequireM(rootDir, this->rootDir());
|
||||
oxReturnError(rootDir.write(path, inode));
|
||||
oxReturnError(write(inode, buffer, size, fileType));
|
||||
return OxError(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user