mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	Edited tag structure to balance size vs id count
This is a minor tweak that resulted from looking at some other use cases for the littlefs data-structure on disk. Consider an implementation that does not need to buffer inline-files in RAM. In this case we should have as large a tag size field as possible. Unfortunately, we don't have much space to work with in the 32-bit tag struct, so we have to make some compromises. These limitations could be removed with a 64-bit tag struct, at the cost of code size. 32-bit tag structure: [--- 32 ---] [1|- 9 -|- 9 -|-- 13 --] ^ ^ ^ ^- entry length | | \-------- file id | \-------------- tag type \------------------ valid bit
This commit is contained in:
		
							
								
								
									
										4
									
								
								lfs.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								lfs.h
									
									
									
									
									
								
							| @@ -49,7 +49,7 @@ typedef uint32_t lfs_block_t; | ||||
| // to <= 0xfff. Stored in superblock and must be respected by other | ||||
| // littlefs drivers. | ||||
| #ifndef LFS_ATTR_MAX | ||||
| #define LFS_ATTR_MAX 0xffe | ||||
| #define LFS_ATTR_MAX 0x1ffe | ||||
| #endif | ||||
|  | ||||
| // Maximum name size in bytes, may be redefined to reduce the size of the | ||||
| @@ -64,7 +64,7 @@ typedef uint32_t lfs_block_t; | ||||
| // block. Limited to <= LFS_ATTR_MAX and <= cache_size. Stored in superblock | ||||
| // and must be respected by other littlefs drivers. | ||||
| #ifndef LFS_INLINE_MAX | ||||
| #define LFS_INLINE_MAX 0xffe | ||||
| #define LFS_INLINE_MAX 0x1ffe | ||||
| #endif | ||||
|  | ||||
| // Possible error codes, these are negative to allow | ||||
|   | ||||
		Reference in New Issue
	
	Block a user