diff --git a/lfs.c b/lfs.c index 4a320187..79f48205 100644 --- a/lfs.c +++ b/lfs.c @@ -9834,8 +9834,8 @@ int lfsr_file_opencfg(lfs_t *lfs, lfsr_file_t *file, } } - // mark as unsync and uncreat, we need to convert to reg file - // first sync + // mark as unsynced and orphaned, we need to convert to reg file + // on first sync file->o.flags |= LFS_F_UNSYNC | LFS_F_ORPHAN; } else { @@ -11478,7 +11478,7 @@ int lfsr_file_sync(lfs_t *lfs, lfsr_file_t *file) { // small files must be inlined entirely in our buffer LFS_ASSERT(!lfsr_f_isunflush(file->o.flags) || file->buffer.size <= lfsr_file_inlinesize(lfs, file)); - // uncreat files must be unsync + // orphaned files must be unsynced LFS_ASSERT(!lfsr_f_isorphan(file->o.flags) || lfsr_f_isunsync(file->o.flags)); diff --git a/lfs.h b/lfs.h index 06c565cc..687383f1 100644 --- a/lfs.h +++ b/lfs.h @@ -139,9 +139,9 @@ enum lfs_open_flags { #endif // internally used flags - LFS_F_UNFLUSH = 0x1000, // File's data does not match storage - LFS_F_UNSYNC = 0x2000, // File's metadata does not match storage - LFS_F_ORPHAN = 0x4000, // File does not exist yet + LFS_F_UNFLUSH = 0x1000, // File's data does not match disk + LFS_F_UNSYNC = 0x2000, // File's metadata does not match disk + LFS_F_ORPHAN = 0x4000, // File does not exist LFS_F_ZOMBIE = 0x8000, // File has been removed };