mufs: add find_dirent_size() to determine how many bytes are used within a directory bin

This commit is contained in:
S.J.R. van Schaik 2017-06-14 06:20:11 +02:00
parent 7107daa4b5
commit f2d4d60c01
3 changed files with 37 additions and 0 deletions

View file

@ -53,6 +53,8 @@ int mufs_mkpath(struct mufs *fs, const char *path, unsigned type)
dirent.tree.root = 0;
dirent.tree.depth = 0;
tree->file_size = find_dirent_size(fs, tree, tree->file_size);
if (!is_aligned(tree->file_size, fs->dev->log2_block_size) &&
write_dirent(tree, tree->file_size, &dirent) > 0)
return 0;