mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 00:38:29 +01:00
Fixed issue where inlined files were not cleaned up
A relatively late change in v2 was to switch from implicit replacement of inline files to explicit replacement, which requires explicitly deleting the inline struct tag before creating a CTZ skip-list tag. Unfortunately I never added the actual logic to delete the tag. This went unnoticed as the later CTZ skip-list tag always overrides the search for the struct tag during a directory fetch. To fix we need to add an explicit delete. Also there was some clean up necessary for actually removing delete tags during compaction as well as some refactoring around outlining. Found by Johnxjj
This commit is contained in:
15
lfs.h
15
lfs.h
@@ -122,13 +122,13 @@ enum lfs_type {
|
||||
// File open flags
|
||||
enum lfs_open_flags {
|
||||
// open flags
|
||||
LFS_O_RDONLY = 1, // Open a file as read only
|
||||
LFS_O_WRONLY = 2, // Open a file as write only
|
||||
LFS_O_RDWR = 3, // Open a file as read and write
|
||||
LFS_O_CREAT = 0x0100, // Create a file if it does not exist
|
||||
LFS_O_EXCL = 0x0200, // Fail if a file already exists
|
||||
LFS_O_TRUNC = 0x0400, // Truncate the existing file to zero size
|
||||
LFS_O_APPEND = 0x0800, // Move to end of file on every write
|
||||
LFS_O_RDONLY = 1, // Open a file as read only
|
||||
LFS_O_WRONLY = 2, // Open a file as write only
|
||||
LFS_O_RDWR = 3, // Open a file as read and write
|
||||
LFS_O_CREAT = 0x0100, // Create a file if it does not exist
|
||||
LFS_O_EXCL = 0x0200, // Fail if a file already exists
|
||||
LFS_O_TRUNC = 0x0400, // Truncate the existing file to zero size
|
||||
LFS_O_APPEND = 0x0800, // Move to end of file on every write
|
||||
|
||||
// internally used flags
|
||||
LFS_F_DIRTY = 0x010000, // File does not match storage
|
||||
@@ -136,6 +136,7 @@ enum lfs_open_flags {
|
||||
LFS_F_READING = 0x040000, // File has been read since last flush
|
||||
LFS_F_ERRED = 0x080000, // An error occured during write
|
||||
LFS_F_INLINE = 0x100000, // Currently inlined in directory entry
|
||||
LFS_F_OUTLINE = 0x200000, // Need to delete inlined directory entry
|
||||
};
|
||||
|
||||
// File seek flags
|
||||
|
||||
Reference in New Issue
Block a user