Reworked file flushing to allow cached data to remain in buffer
This is intended to enable lfsr_file_read to use the buffer as well. This adds LFS_F_UNFLUSHED and internal lfsr_file_flush to manage buffer flushing. This also results in a nice reorganization of lfsr_file_sync. Of course, small file caching proves to be a big pain again, with several subtle corner cases in truncate/fruncate that need to set the LFS_F_UNFLUSHED flag so we fix small files in lfsr_file_sync.
This commit is contained in:
@@ -165,8 +165,9 @@ enum lfs_open_flags {
|
||||
#endif
|
||||
|
||||
// internally used flags
|
||||
LFS_F_UNSYNCED = 0x010000, // File's metadata does not match storage
|
||||
LFS_F_ERRORED = 0x020000, // An error occurred during write
|
||||
LFS_F_UNFLUSHED = 0x010000, // File's data does not match storage
|
||||
LFS_F_UNSYNCED = 0x020000, // File's metadata does not match storage
|
||||
LFS_F_ERRORED = 0x040000, // An error occurred during write
|
||||
};
|
||||
|
||||
// File seek flags
|
||||
|
||||
Reference in New Issue
Block a user