ext4_extent: some comments cleanup in ext4_ext_correct_indexes.
[lwext4.git] / lwext4 / ext4_super.h
index a9eec0721339da17c59aeb4d7710c8ebed938ce6..2172698e5981a1ab59465e72554f3b5f86275afe 100644 (file)
 #ifndef EXT4_SUPER_H_
 #define EXT4_SUPER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 
@@ -54,6 +58,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*/
@@ -213,6 +226,10 @@ uint32_t ext4_bg_num_gdb(struct ext4_sblock *s, uint32_t group);
 uint32_t ext4_num_base_meta_clusters(struct ext4_sblock *s,
                                     uint32_t block_group);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_SUPER_H_ */
 
 /**