ref: 18d6406372a4bced5fdce0d9e6dcbe3a3b617848
parent: 0be3cc00469822f2cb3ef03cf4901a2083a22edc
author: gkostka <kostka.grzegorz@gmail.com>
date: Tue Oct 21 14:54:19 EDT 2014
Add flex bg superblock helpers
--- a/lwext4/ext4_super.h
+++ b/lwext4/ext4_super.h
@@ -138,6 +138,25 @@
return to_le32(s->features_read_only) & v;
}
+/**@brief Block group to flex group.
+ * @param s superblock descriptor
+ * @param block_group block group
+ * @return flex group id*/
+static inline uint32_t ext4_sb_bg_to_flex(struct ext4_sblock *s,
+ uint32_t block_group)
+{
+ return block_group >> to_le32(s->log_groups_per_flex);
+}
+
+/**@brief Flex block group size.
+ * @param s superblock descriptor
+ * @return flex bg size*/
+static inline uint32_t ext4_sb_flex_bg_size(struct ext4_sblock *s)
+{
+ return 1 << to_le32(s->log_groups_per_flex);
+}
+
+
/**************************More complex functions****************************/
/**@brief Returns a block group count.