[ox/fs] More cleanup and bug fix from previous cleanup
This commit is contained in:
4
deps/ox/src/ox/fs/filesystem/directory.hpp
vendored
4
deps/ox/src/ox/fs/filesystem/directory.hpp
vendored
@ -44,6 +44,7 @@ struct OX_PACKED DirectoryEntry {
|
||||
constexpr DirectoryEntry() noexcept = default;
|
||||
|
||||
Error init(InodeId_t inode, ox::CRStringView name, size_t bufferSize) noexcept {
|
||||
oxTracef("ox.fs.DirectoryEntry.init", "inode: {}, name: {}, bufferSize: {}", inode, name, bufferSize);
|
||||
m_bufferSize = static_cast<InodeId_t>(bufferSize);
|
||||
auto d = data();
|
||||
if (d.valid()) {
|
||||
@ -190,10 +191,10 @@ template<typename FileStore, typename InodeId_t>
|
||||
Error Directory<FileStore, InodeId_t>::write(PathIterator path, uint64_t inode64) noexcept {
|
||||
const auto inode = static_cast<InodeId_t>(inode64);
|
||||
ox::StringView name;
|
||||
oxReturnError(path.next(name));
|
||||
if (path.next().hasNext()) { // not yet at target directory, recurse to next one
|
||||
oxTracef("ox.fs.Directory.write", "Attempting to write to next sub-Directory: {} of {}",
|
||||
name, path.fullPath());
|
||||
oxReturnError(path.get(name));
|
||||
oxRequire(nextChild, findEntry(name));
|
||||
oxTracef("ox.fs.Directory.write", "{}: {}", name, nextChild);
|
||||
if (nextChild) {
|
||||
@ -204,6 +205,7 @@ Error Directory<FileStore, InodeId_t>::write(PathIterator path, uint64_t inode64
|
||||
}
|
||||
} else {
|
||||
oxTrace("ox.fs.Directory.write", path.fullPath());
|
||||
oxReturnError(path.next(name));
|
||||
// insert the new entry on this directory
|
||||
// get the name
|
||||
// find existing version of directory
|
||||
|
Reference in New Issue
Block a user