diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2015-11-16 20:28:02 +0100 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2015-11-16 20:28:02 +0100 |
| commit | c1737799ff0b5cbe14c34bec3c3f806437fdc20e (patch) | |
| tree | e74a0491b1ed558abb27a70452a83e995f79fc24 | |
| parent | b46f6b5e87ceed7487c6816f1c16d1e607dca489 (diff) | |
Add ext4_sb_set_blocks_cnt
| -rw-r--r-- | lwext4/ext4_super.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lwext4/ext4_super.h b/lwext4/ext4_super.h index a9eec07..5b7b5a0 100644 --- a/lwext4/ext4_super.h +++ b/lwext4/ext4_super.h @@ -54,6 +54,15 @@ static inline uint64_t ext4_sb_get_blocks_cnt(struct ext4_sblock *s) to_le32(s->blocks_count_lo); } +/**@brief Blocks count set in superblock. + * @param s superblock descriptor + * @return count of blocks*/ +static inline void ext4_sb_set_blocks_cnt(struct ext4_sblock *s, uint64_t cnt) +{ + s->blocks_count_lo = to_le32((cnt << 32) >> 32); + s->blocks_count_hi = to_le32(cnt >> 32); +} + /**@brief Free blocks count get stored in superblock. * @param s superblock descriptor * @return free blocks*/ |
