Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lfs.h
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2017-11-22 05:53:15 +0300
committerChristopher Haster <chaster@utexas.edu>2017-11-22 23:49:43 +0300
commitbf78b09d370d4ae2eb1b59671053b065e9f9c550 (patch)
treeb9b16cf06447f5449cc5cd6d72a3a76996d5bc94 /lfs.h
parente169d06c574d9c3aefd8b7cd1c407c4726c008f3 (diff)
Added directory list for synchronizing in flight directories
As it was, if a user operated on a directory while at the same time iterating over the directory, the directory objects could fall out of sync. In the best case, files may be skipped while removing everything in a file, in the worst case, a very poorly timed directory relocate could be missed. Simple fix is to add the same directory tracking that is currently in use for files, at a small code+complexity cost.
Diffstat (limited to 'lfs.h')
-rw-r--r--lfs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lfs.h b/lfs.h
index 641521c..51d0a86 100644
--- a/lfs.h
+++ b/lfs.h
@@ -207,6 +207,7 @@ typedef struct lfs_file {
} lfs_file_t;
typedef struct lfs_dir {
+ struct lfs_dir *next;
lfs_block_t pair[2];
lfs_off_t off;
@@ -249,6 +250,7 @@ typedef struct lfs {
lfs_block_t root[2];
lfs_file_t *files;
+ lfs_dir_t *dirs;
lfs_cache_t rcache;
lfs_cache_t pcache;