Make auto expand loop if necessary
This commit is contained in:
parent
8e17515b27
commit
fea0a2e1c3
6
deps/ox/src/ox/fs/filesystem.hpp
vendored
6
deps/ox/src/ox/fs/filesystem.hpp
vendored
@ -551,8 +551,10 @@ int FileSystemTemplate<FileStore, FS_TYPE>::write(const char *path, void *buffer
|
|||||||
#endif
|
#endif
|
||||||
template<typename FileStore, FsType FS_TYPE>
|
template<typename FileStore, FsType FS_TYPE>
|
||||||
int FileSystemTemplate<FileStore, FS_TYPE>::write(uint64_t inode, void *buffer, uint64_t size, uint8_t fileType) {
|
int FileSystemTemplate<FileStore, FS_TYPE>::write(uint64_t inode, void *buffer, uint64_t size, uint8_t fileType) {
|
||||||
if (m_autoExpand && m_store->spaceNeeded(size) > m_store->available()) {
|
if (m_autoExpand) {
|
||||||
expand(this->size() * 2);
|
while (m_store->spaceNeeded(size) > m_store->available()) {
|
||||||
|
expand(this->size() * 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return m_store->write(inode, buffer, size, fileType);
|
return m_store->write(inode, buffer, size, fileType);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user