Skip to content

Commit 1bc1493

Browse files
committed
Tweaked on-disk config comments for consistency
- Prefer "defaults to blablabla when zero" to hint that this is the default state when both explicitly set to zero and implicitly set to zero thanks to C's initializers. - Prefer "disk" when referencing something stored "on disk". Other terms can quickly get ambiguous. Except maybe "block device"...
1 parent 01b6a47 commit 1bc1493

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lfs.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ typedef uint32_t lfs_block_t;
5959
#endif
6060

6161
// Maximum size of custom attributes in bytes, may be redefined, but there is
62-
// no real benefit to using a smaller LFS_ATTR_MAX. Limited to <= 1022.
62+
// no real benefit to using a smaller LFS_ATTR_MAX. Limited to <= 1022. Stored
63+
// in superblock and must be respected by other littlefs drivers.
6364
#ifndef LFS_ATTR_MAX
6465
#define LFS_ATTR_MAX 1022
6566
#endif
@@ -203,8 +204,8 @@ struct lfs_config {
203204
// program sizes.
204205
lfs_size_t block_size;
205206

206-
// Number of erasable blocks on the device.
207-
// If 0, will attempt to infer block_count from existing filesystem.
207+
// Number of erasable blocks on the device. Defaults to block_count stored
208+
// on disk when zero.
208209
lfs_size_t block_count;
209210

210211
// Number of erase cycles before littlefs evicts metadata logs and moves
@@ -253,18 +254,18 @@ struct lfs_config {
253254

254255
// Optional upper limit on length of file names in bytes. No downside for
255256
// larger names except the size of the info struct which is controlled by
256-
// the LFS_NAME_MAX define. Defaults to LFS_NAME_MAX when zero. Stored in
257-
// superblock and must be respected by other littlefs drivers.
257+
// the LFS_NAME_MAX define. Defaults to LFS_NAME_MAX or name_max stored on
258+
// disk when zero.
258259
lfs_size_t name_max;
259260

260261
// Optional upper limit on files in bytes. No downside for larger files
261-
// but must be <= LFS_FILE_MAX. Defaults to LFS_FILE_MAX when zero. Stored
262-
// in superblock and must be respected by other littlefs drivers.
262+
// but must be <= LFS_FILE_MAX. Defaults to LFS_FILE_MAX or file_max stored
263+
// on disk when zero.
263264
lfs_size_t file_max;
264265

265266
// Optional upper limit on custom attributes in bytes. No downside for
266267
// larger attributes size but must be <= LFS_ATTR_MAX. Defaults to
267-
// LFS_ATTR_MAX when zero.
268+
// LFS_ATTR_MAX or attr_max stored on disk when zero.
268269
lfs_size_t attr_max;
269270

270271
// Optional upper limit on total space given to metadata pairs in bytes. On

0 commit comments

Comments
 (0)