Tweaked lfs_fsinfo block_size/block_count fields

Mainly to match superblock ordering and emphasize these are logical
blocks.
This commit is contained in:
Christopher Haster
2023-09-11 23:23:07 -05:00
parent 127d84b681
commit 2c222af17d
2 changed files with 13 additions and 13 deletions
+6 -4
View File
@@ -46,7 +46,8 @@ static int lfs_bd_read(lfs_t *lfs,
lfs_block_t block, lfs_off_t off,
void *buffer, lfs_size_t size) {
uint8_t *data = buffer;
if (off+size > lfs->cfg->block_size || (lfs->block_count && block >= lfs->block_count)) {
if (off+size > lfs->cfg->block_size
|| (lfs->block_count && block >= lfs->block_count)) {
return LFS_ERR_CORRUPT;
}
@@ -4509,14 +4510,15 @@ static int lfs_fs_rawstat(lfs_t *lfs, struct lfs_fsinfo *fsinfo) {
fsinfo->disk_version = superblock.version;
}
// filesystem geometry
fsinfo->block_size = lfs->cfg->block_size;
fsinfo->block_count = lfs->block_count;
// other on-disk configuration, we cache all of these for internal use
fsinfo->name_max = lfs->name_max;
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;
}