Changed fsinfo.minor_version -> fsinfo.disk_version

Version are now returned with major/minor packed into 32-bits,
so 0x00020001 is the current disk version, for example.

1. This needed to change to use a disk_* prefix for consistency with the
   defines that already exist for LFS_VERSION/LFS_DISK_VERSION.

2. Encoding the version this way has the nice side effect of making 0 an
   invalid value. This is useful for adding a similar config option
   that needs to have reasonable default behavior for backwards
   compatibility.

In theory this uses more space, but in practice most other config/status
is 32-bits in littlefs. We would be wasting this space for alignment
anyways.
This commit is contained in:
Christopher Haster
2023-06-06 21:52:04 -05:00
parent 8610f7c36b
commit c5fb3f181b
4 changed files with 20 additions and 20 deletions

4
lfs.h
View File

@@ -282,8 +282,8 @@ struct lfs_info {
// Filesystem info structure
struct lfs_fsinfo {
// On-disk minor version.
uint16_t minor_version;
// On-disk version.
uint32_t disk_version;
// Number of blocks in use, this is the same as lfs_fs_size.
//