mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 16:14:13 +01:00
WIP better structure for dir/file lists
This commit is contained in:
22
lfs.h
22
lfs.h
@@ -263,7 +263,7 @@ struct lfs_attr {
|
|||||||
|
|
||||||
/// littlefs data structures ///
|
/// littlefs data structures ///
|
||||||
typedef uint32_t lfs_tag_t;
|
typedef uint32_t lfs_tag_t;
|
||||||
typedef struct lfs_entry {
|
typedef struct lfs_mattr {
|
||||||
lfs_tag_t tag;
|
lfs_tag_t tag;
|
||||||
union {
|
union {
|
||||||
void *buffer;
|
void *buffer;
|
||||||
@@ -278,12 +278,12 @@ typedef struct lfs_entry {
|
|||||||
} d;
|
} d;
|
||||||
struct lfs_dir *dir;
|
struct lfs_dir *dir;
|
||||||
} u;
|
} u;
|
||||||
} lfs_entry_t;
|
} lfs_mattr_t;
|
||||||
|
|
||||||
typedef struct lfs_entrylist {
|
typedef struct lfs_mattrlist {
|
||||||
lfs_entry_t e;
|
lfs_mattr_t e;
|
||||||
struct lfs_entrylist *next;
|
struct lfs_mattrlist *next;
|
||||||
} lfs_entrylist_t;
|
} lfs_mattrlist_t;
|
||||||
|
|
||||||
typedef struct lfs_cache {
|
typedef struct lfs_cache {
|
||||||
lfs_block_t block;
|
lfs_block_t block;
|
||||||
@@ -295,7 +295,6 @@ typedef struct lfs_file {
|
|||||||
struct lfs_file *next;
|
struct lfs_file *next;
|
||||||
lfs_block_t pair[2];
|
lfs_block_t pair[2];
|
||||||
uint16_t id;
|
uint16_t id;
|
||||||
|
|
||||||
lfs_block_t head;
|
lfs_block_t head;
|
||||||
lfs_size_t size;
|
lfs_size_t size;
|
||||||
|
|
||||||
@@ -305,12 +304,15 @@ typedef struct lfs_file {
|
|||||||
lfs_off_t off;
|
lfs_off_t off;
|
||||||
lfs_cache_t cache;
|
lfs_cache_t cache;
|
||||||
|
|
||||||
lfs_entrylist_t *attrs;
|
lfs_mattrlist_t *attrs;
|
||||||
} lfs_file_t;
|
} lfs_file_t;
|
||||||
|
|
||||||
typedef struct lfs_dir {
|
typedef struct lfs_dir {
|
||||||
struct lfs_dir *next;
|
struct lfs_dir *next;
|
||||||
lfs_block_t pair[2];
|
lfs_block_t pair[2];
|
||||||
|
uint16_t id;
|
||||||
|
uint16_t pos;
|
||||||
|
lfs_block_t head[2];
|
||||||
|
|
||||||
lfs_block_t tail[2];
|
lfs_block_t tail[2];
|
||||||
uint32_t rev;
|
uint32_t rev;
|
||||||
@@ -321,10 +323,6 @@ typedef struct lfs_dir {
|
|||||||
bool split;
|
bool split;
|
||||||
bool stop_at_commit; // TODO hmmm
|
bool stop_at_commit; // TODO hmmm
|
||||||
int16_t moveid;
|
int16_t moveid;
|
||||||
|
|
||||||
uint16_t id;
|
|
||||||
lfs_block_t head[2];
|
|
||||||
lfs_off_t pos;
|
|
||||||
} lfs_dir_t;
|
} lfs_dir_t;
|
||||||
|
|
||||||
typedef struct lfs_superblock {
|
typedef struct lfs_superblock {
|
||||||
|
|||||||
Reference in New Issue
Block a user