Skip to content

Commit

Permalink
Add block_count and block_size to fsinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPugh committed Aug 20, 2023
1 parent d6c0c6a commit d6098bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 7 additions & 0 deletions lfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d6098bd

Please sign in to comment.