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
diff options
context:
space:
mode:
authorBrian Pugh <bnp117@gmail.com>2023-08-20 21:53:18 +0300
committerBrian Pugh <bnp117@gmail.com>2023-08-20 21:53:18 +0300
commitd6098bd3cef6ba0f3b24aac6643fc97959e3d418 (patch)
tree79eb35ed67e543ad66eababd5741ef29b2454cc4
parentd6c0c6a786fad487581f82f2f2adacdb19113979 (diff)
Add block_count and block_size to fsinfo
-rw-r--r--lfs.c3
-rw-r--r--lfs.h7
2 files changed, 10 insertions, 0 deletions
diff --git a/lfs.c b/lfs.c
index 52ce614..5455485 100644
--- a/lfs.c
+++ b/lfs.c
@@ -4575,6 +4575,9 @@ static int lfs_fs_rawstat(lfs_t *lfs, struct lfs_fsinfo *fsinfo) {
fsinfo->file_max = lfs->file_max;
fsinfo->attr_max = lfs->attr_max;
+ fsinfo->block_count = lfs->block_count;
+ fsinfo->block_size = lfs->cfg->block_size;
+
return 0;
}
diff --git a/lfs.h b/lfs.h
index be5c95c..c777f30 100644
--- a/lfs.h
+++ b/lfs.h
@@ -301,6 +301,13 @@ struct lfs_fsinfo {
// Upper limit on the size of custom attributes in bytes.
lfs_size_t attr_max;
+
+ // Number of blocks in filesystem.
+ // May differ from cfg->block_count if autodetected from filesystem.
+ lfs_size_t block_count;
+
+ // Size of block in bytes.
+ lfs_size_t block_size;
};
// Custom attribute structure, used to describe custom attributes