shithub: lwext4

Download patch

ref: 193a315b1cb77111ce76592c3bf6fe9ef875df63
parent: 23d805b5fafc38eb3a60e6663129e5abfe592f7b
author: gkostka <[email protected]>
date: Sun Oct 11 10:11:20 EDT 2015

Make ext4_sb_sparse public

--- a/lwext4/ext4_super.c
+++ b/lwext4/ext4_super.c
@@ -123,7 +123,7 @@
 	return true;
 }
 
-static inline int is_multiple(uint32_t a, uint32_t b)
+static inline int is_power_of(uint32_t a, uint32_t b)
 {
 	while (1) {
 		if (a < b)
@@ -136,7 +136,7 @@
 	}
 }
 
-static int ext4_sb_sparse(uint32_t group)
+bool ext4_sb_sparse(uint32_t group)
 {
 	if (group <= 1)
 		return 1;
@@ -144,8 +144,8 @@
 	if (!(group & 1))
 		return 0;
 
-	return (is_multiple(group, 7) || is_multiple(group, 5) ||
-		is_multiple(group, 3));
+	return (is_power_of(group, 7) || is_power_of(group, 5) ||
+		is_power_of(group, 3));
 }
 
 bool ext4_sb_is_super_in_bg(struct ext4_sblock *s, uint32_t group)
--- a/lwext4/ext4_super.h
+++ b/lwext4/ext4_super.h
@@ -206,6 +206,8 @@
  * @return  true if block group has superblock*/
 bool ext4_sb_is_super_in_bg(struct ext4_sblock *s, uint32_t block_group);
 
+bool ext4_sb_sparse(uint32_t group);
+
 /**@brief   TODO:*/
 uint32_t ext4_bg_num_gdb(struct ext4_sblock *s, uint32_t group);