diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2015-10-16 16:40:40 +0200 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2015-10-16 16:40:40 +0200 |
| commit | 0d951d61e5ae9c64091daf6f469dc71af6175daf (patch) | |
| tree | e571e75970c528a0b2172ef127f3f0d82ea32335 | |
| parent | 5819cc9f59fa39a85405b704d04540a31fa4b83f (diff) | |
Add CONFIG_EXTENT_FULL compilation flag
This switch decides which extent implementation will
be chosen to compile.
| -rw-r--r-- | lwext4/ext4_config.h | 5 | ||||
| -rw-r--r-- | lwext4/ext4_extent.c | 3 | ||||
| -rw-r--r-- | lwext4/ext4_extent.h | 10 | ||||
| -rw-r--r-- | lwext4/ext4_extent_full.c | 6 | ||||
| -rw-r--r-- | lwext4/ext4_extent_full.h | 2 |
5 files changed, 22 insertions, 4 deletions
diff --git a/lwext4/ext4_config.h b/lwext4/ext4_config.h index 62382f5..5f9f94f 100644 --- a/lwext4/ext4_config.h +++ b/lwext4/ext4_config.h @@ -142,6 +142,11 @@ #define CONFIG_HAVE_OWN_OFLAGS 0 #endif +/**@brief Use full extent implemrntation*/ +#ifndef CONFIG_EXTENT_FULL +#define CONFIG_EXTENT_FULL 1 +#endif + #ifdef __GNUC__ #ifndef __unused #define __unused __attribute__ ((__unused__)) diff --git a/lwext4/ext4_extent.c b/lwext4/ext4_extent.c index df9f834..eb3d816 100644 --- a/lwext4/ext4_extent.c +++ b/lwext4/ext4_extent.c @@ -49,6 +49,8 @@ #include <string.h> #include <stdlib.h> +#if !CONFIG_EXTENT_FULL + uint32_t ext4_extent_get_first_block(struct ext4_extent *extent) { return to_le32(extent->first_block); @@ -988,6 +990,7 @@ finish: return rc; } +#endif /** * @} */ diff --git a/lwext4/ext4_extent.h b/lwext4/ext4_extent.h index 5808e8d..a121af9 100644 --- a/lwext4/ext4_extent.h +++ b/lwext4/ext4_extent.h @@ -44,6 +44,8 @@ #include "ext4_config.h" #include "ext4_types.h" +#if !CONFIG_EXTENT_FULL + /**@brief Get logical number of the block covered by extent. * @param extent Extent to load number from * @return Logical number of the first block covered by extent */ @@ -183,7 +185,9 @@ int ext4_extent_release_blocks_from(struct ext4_inode_ref *inode_ref, int ext4_extent_append_block(struct ext4_inode_ref *inode_ref, uint32_t *iblock, uint32_t *fblock, bool update_size); +#endif + #endif /* EXT4_EXTENT_H_ */ - /** - * @} - */ +/** +* @} +*/ diff --git a/lwext4/ext4_extent_full.c b/lwext4/ext4_extent_full.c index ddcea28..5231c94 100644 --- a/lwext4/ext4_extent_full.c +++ b/lwext4/ext4_extent_full.c @@ -26,6 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "ext4_config.h" #include "ext4_blockdev.h" #include "ext4_super.h" #include "ext4_balloc.h" @@ -36,7 +37,9 @@ #include <inttypes.h> #include <stddef.h> -#include "ext4_extent.h" +#include "ext4_extent_full.h" + +#if CONFIG_EXTENT_FULL /* * used by extent splitting. @@ -1762,3 +1765,4 @@ out2: return err; } +#endif diff --git a/lwext4/ext4_extent_full.h b/lwext4/ext4_extent_full.h index 076b5b8..61ff6d9 100644 --- a/lwext4/ext4_extent_full.h +++ b/lwext4/ext4_extent_full.h @@ -32,6 +32,7 @@ #include "ext4_config.h" #include "ext4_types.h" +#if CONFIG_EXTENT_FULL int ext4_ext_get_blocks(struct ext4_inode_ref *inode_ref, ext4_fsblk_t iblock, uint32_t max_blocks, ext4_fsblk_t *result, bool create, uint32_t *blocks_count); @@ -40,5 +41,6 @@ int ext4_ext_tree_init(struct ext4_inode_ref *inode_ref); int ext4_ext_remove_space(struct ext4_inode_ref *inode_ref, ext4_lblk_t from, ext4_lblk_t to); +#endif #endif /* EXT4_EXTENT_H_ */ |
