From: gkostka Date: Sat, 27 Jun 2015 21:37:09 +0000 (+0200) Subject: Improve include policy X-Git-Tag: lwext4-0.8.0~11 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=eddcd695d0c06c5e2dbef7c23c4998405857df59;p=lwext4.git Improve include policy --- diff --git a/lwext4/ext4.c b/lwext4/ext4.c index dea3dfe..3bb6869 100644 --- a/lwext4/ext4.c +++ b/lwext4/ext4.c @@ -34,21 +34,22 @@ * @brief Ext4 high level operations (file, directory, mountpoints...) */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_blockdev.h" +#include "ext4_types.h" +#include "ext4_debug.h" +#include "ext4_errno.h" +#include "ext4_fs.h" +#include "ext4_dir.h" +#include "ext4_inode.h" +#include "ext4_super.h" +#include "ext4_dir_idx.h" +#include "ext4.h" #include #include -#include + /**@brief Mount point OS dependent lock*/ #define EXT4_MP_LOCK(_m) \ diff --git a/lwext4/ext4.h b/lwext4/ext4.h index 873698d..3a69d28 100644 --- a/lwext4/ext4.h +++ b/lwext4/ext4.h @@ -38,8 +38,9 @@ #ifndef EXT4_H_ #define EXT4_H_ -#include -#include +#include "ext4_config.h" +#include "ext4_blockdev.h" + #include /********************************FILE OPEN FLAGS*****************************/ diff --git a/lwext4/ext4_balloc.c b/lwext4/ext4_balloc.c index 6f56f24..2297c2f 100644 --- a/lwext4/ext4_balloc.c +++ b/lwext4/ext4_balloc.c @@ -39,13 +39,13 @@ * @brief Physical block allocator. */ -#include -#include -#include -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_balloc.h" +#include "ext4_super.h" +#include "ext4_block_group.h" +#include "ext4_fs.h" +#include "ext4_bitmap.h" +#include "ext4_inode.h" /**@brief Compute number of block group from block address. * @param sb Superblock pointer. diff --git a/lwext4/ext4_balloc.h b/lwext4/ext4_balloc.h index dc60a07..24cf470 100644 --- a/lwext4/ext4_balloc.h +++ b/lwext4/ext4_balloc.h @@ -42,8 +42,8 @@ #ifndef EXT4_BALLOC_H_ #define EXT4_BALLOC_H_ -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" #include #include diff --git a/lwext4/ext4_bcache.c b/lwext4/ext4_bcache.c index 80e6034..f9fd3b4 100644 --- a/lwext4/ext4_bcache.c +++ b/lwext4/ext4_bcache.c @@ -34,10 +34,10 @@ * @brief Block cache allocator. */ -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_bcache.h" +#include "ext4_debug.h" +#include "ext4_errno.h" #include #include diff --git a/lwext4/ext4_bcache.h b/lwext4/ext4_bcache.h index 692bd86..7454e20 100644 --- a/lwext4/ext4_bcache.h +++ b/lwext4/ext4_bcache.h @@ -37,7 +37,7 @@ #ifndef EXT4_BCACHE_H_ #define EXT4_BCACHE_H_ -#include +#include "ext4_config.h" #include #include diff --git a/lwext4/ext4_bitmap.c b/lwext4/ext4_bitmap.c index efb6d0c..7817967 100644 --- a/lwext4/ext4_bitmap.c +++ b/lwext4/ext4_bitmap.c @@ -34,10 +34,10 @@ * @brief Block/inode bitmap allocator. */ -#include -#include +#include "ext4_config.h" +#include "ext4_bitmap.h" -#include +#include "ext4_errno.h" void ext4_bmap_bits_free(uint8_t *bmap, uint32_t sbit, uint32_t bcnt) { diff --git a/lwext4/ext4_bitmap.h b/lwext4/ext4_bitmap.h index 48d710a..63df14d 100644 --- a/lwext4/ext4_bitmap.h +++ b/lwext4/ext4_bitmap.h @@ -37,7 +37,8 @@ #ifndef EXT4_BITMAP_H_ #define EXT4_BITMAP_H_ -#include +#include "ext4_config.h" + #include #include diff --git a/lwext4/ext4_block_group.c b/lwext4/ext4_block_group.c index 7426087..37fcb59 100644 --- a/lwext4/ext4_block_group.c +++ b/lwext4/ext4_block_group.c @@ -39,8 +39,8 @@ * @brief Block group function set. */ -#include -#include +#include "ext4_config.h" +#include "ext4_block_group.h" /**@brief CRC-16 look up table*/ static uint16_t const crc16_tab[256] = { diff --git a/lwext4/ext4_block_group.h b/lwext4/ext4_block_group.h index e76d1ca..9233333 100644 --- a/lwext4/ext4_block_group.h +++ b/lwext4/ext4_block_group.h @@ -42,9 +42,9 @@ #ifndef EXT4_BLOCK_GROUP_H_ #define EXT4_BLOCK_GROUP_H_ -#include -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" +#include "ext4_super.h" #include #include diff --git a/lwext4/ext4_blockdev.c b/lwext4/ext4_blockdev.c index c9fc396..82296d5 100644 --- a/lwext4/ext4_blockdev.c +++ b/lwext4/ext4_blockdev.c @@ -34,10 +34,10 @@ * @brief Block device module. */ -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_blockdev.h" +#include "ext4_errno.h" +#include "ext4_debug.h" #include #include diff --git a/lwext4/ext4_blockdev.h b/lwext4/ext4_blockdev.h index 884df96..558a382 100644 --- a/lwext4/ext4_blockdev.h +++ b/lwext4/ext4_blockdev.h @@ -36,9 +36,9 @@ * @brief Block device module. */ -#include -#include -#include +#include "ext4_config.h" +#include "ext4_bcache.h" +#include "ext4_debug.h" #include #include diff --git a/lwext4/ext4_crc32c.c b/lwext4/ext4_crc32c.c index e6e6a68..d333701 100644 --- a/lwext4/ext4_crc32c.c +++ b/lwext4/ext4_crc32c.c @@ -36,8 +36,8 @@ * @brief Crc32c routine. Taken from FreeBSD kernel. */ -#include -#include +#include "ext4_config.h" +#include "ext4_crc32c.h" /* */ /* CRC LOOKUP TABLE */ diff --git a/lwext4/ext4_crc32c.h b/lwext4/ext4_crc32c.h index 3e3a3a7..659699e 100644 --- a/lwext4/ext4_crc32c.h +++ b/lwext4/ext4_crc32c.h @@ -39,7 +39,8 @@ #ifndef LWEXT4_EXT4_CRC32C_H_ #define LWEXT4_EXT4_CRC32C_H_ -#include +#include "ext4_config.h" + #include /**@brief CRC32C algorithm. diff --git a/lwext4/ext4_debug.c b/lwext4/ext4_debug.c index 2aa36db..df2cbd9 100644 --- a/lwext4/ext4_debug.c +++ b/lwext4/ext4_debug.c @@ -34,8 +34,8 @@ * @brief Debug printf and assert macros. */ -#include -#include +#include "ext4_config.h" +#include "ext4_debug.h" #include #include diff --git a/lwext4/ext4_debug.h b/lwext4/ext4_debug.h index d5f61a3..61b4653 100644 --- a/lwext4/ext4_debug.h +++ b/lwext4/ext4_debug.h @@ -37,8 +37,9 @@ #ifndef EXT4_DEBUG_H_ #define EXT4_DEBUG_H_ -#include -#include +#include "ext4_config.h" +#include "ext4_errno.h" + #include #include diff --git a/lwext4/ext4_dir.c b/lwext4/ext4_dir.c index cb15299..fd043b5 100644 --- a/lwext4/ext4_dir.c +++ b/lwext4/ext4_dir.c @@ -39,11 +39,11 @@ * @brief Directory handle procedures. */ -#include -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_dir.h" +#include "ext4_dir_idx.h" +#include "ext4_inode.h" +#include "ext4_fs.h" #include diff --git a/lwext4/ext4_dir.h b/lwext4/ext4_dir.h index e3f469b..15ca85e 100644 --- a/lwext4/ext4_dir.h +++ b/lwext4/ext4_dir.h @@ -42,10 +42,10 @@ #ifndef EXT4_DIR_H_ #define EXT4_DIR_H_ -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" +#include "ext4_blockdev.h" +#include "ext4_super.h" #include diff --git a/lwext4/ext4_dir_idx.c b/lwext4/ext4_dir_idx.c index a65d7ce..1c174fa 100644 --- a/lwext4/ext4_dir_idx.c +++ b/lwext4/ext4_dir_idx.c @@ -34,13 +34,13 @@ * @brief Directory indexing procedures. */ -#include -#include -#include -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_dir_idx.h" +#include "ext4_dir.h" +#include "ext4_blockdev.h" +#include "ext4_fs.h" +#include "ext4_super.h" +#include "ext4_hash.h" #include #include diff --git a/lwext4/ext4_dir_idx.h b/lwext4/ext4_dir_idx.h index d8ad4c2..bb901db 100644 --- a/lwext4/ext4_dir_idx.h +++ b/lwext4/ext4_dir_idx.h @@ -42,8 +42,8 @@ #ifndef EXT4_DIR_IDX_H_ #define EXT4_DIR_IDX_H_ -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" #include #include diff --git a/lwext4/ext4_errno.h b/lwext4/ext4_errno.h index 512525e..a03e997 100644 --- a/lwext4/ext4_errno.h +++ b/lwext4/ext4_errno.h @@ -36,7 +36,7 @@ #ifndef EXT4_ERRNO_H_ #define EXT4_ERRNO_H_ -#include +#include "ext4_config.h" #if !CONFIG_HAVE_OWN_ERRNO #include diff --git a/lwext4/ext4_extent.c b/lwext4/ext4_extent.c index cb97d96..2869c85 100644 --- a/lwext4/ext4_extent.c +++ b/lwext4/ext4_extent.c @@ -39,12 +39,12 @@ * @brief More complex filesystem functions. */ -#include -#include -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_extent.h" +#include "ext4_inode.h" +#include "ext4_super.h" +#include "ext4_blockdev.h" +#include "ext4_balloc.h" #include #include diff --git a/lwext4/ext4_extent.h b/lwext4/ext4_extent.h index bc38cb7..127e14b 100644 --- a/lwext4/ext4_extent.h +++ b/lwext4/ext4_extent.h @@ -41,8 +41,8 @@ #ifndef EXT4_EXTENT_H_ #define EXT4_EXTENT_H_ -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" /**@brief Get logical number of the block covered by extent. * @param extent Extent to load number from diff --git a/lwext4/ext4_fs.c b/lwext4/ext4_fs.c index 26f4529..555343f 100644 --- a/lwext4/ext4_fs.c +++ b/lwext4/ext4_fs.c @@ -38,19 +38,20 @@ * @brief More complex filesystem functions. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" +#include "ext4_fs.h" +#include "ext4_errno.h" +#include "ext4_blockdev.h" +#include "ext4_super.h" +#include "ext4_debug.h" +#include "ext4_block_group.h" +#include "ext4_balloc.h" +#include "ext4_bitmap.h" +#include "ext4_inode.h" +#include "ext4_ialloc.h" +#include "ext4_extent.h" + #include int ext4_fs_init(struct ext4_fs *fs, struct ext4_blockdev *bdev) diff --git a/lwext4/ext4_fs.h b/lwext4/ext4_fs.h index ab319b5..34ee183 100644 --- a/lwext4/ext4_fs.h +++ b/lwext4/ext4_fs.h @@ -42,8 +42,8 @@ #ifndef EXT4_FS_H_ #define EXT4_FS_H_ -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" #include #include diff --git a/lwext4/ext4_hash.c b/lwext4/ext4_hash.c index 2f5a7d7..a881703 100644 --- a/lwext4/ext4_hash.c +++ b/lwext4/ext4_hash.c @@ -61,10 +61,12 @@ * @brief Directory indexing hash functions. */ -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" +#include "ext4_errno.h" + #include -#include + /* F, G, and H are MD4 functions */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) diff --git a/lwext4/ext4_hash.h b/lwext4/ext4_hash.h index bc739ba..1a02a12 100644 --- a/lwext4/ext4_hash.h +++ b/lwext4/ext4_hash.h @@ -37,7 +37,7 @@ #ifndef EXT4_HASH_H_ #define EXT4_HASH_H_ -#include +#include "ext4_config.h" #include diff --git a/lwext4/ext4_ialloc.c b/lwext4/ext4_ialloc.c index 8a0680a..c4ecb2a 100644 --- a/lwext4/ext4_ialloc.c +++ b/lwext4/ext4_ialloc.c @@ -39,14 +39,14 @@ * @brief Inode allocation procedures. */ -#include -#include -#include -#include -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" +#include "ext4_ialloc.h" +#include "ext4_super.h" +#include "ext4_fs.h" +#include "ext4_blockdev.h" +#include "ext4_block_group.h" +#include "ext4_bitmap.h" /**@brief Convert i-node number to relative index in block group. * @param sb Superblock diff --git a/lwext4/ext4_ialloc.h b/lwext4/ext4_ialloc.h index ccecad7..d66d6cb 100644 --- a/lwext4/ext4_ialloc.h +++ b/lwext4/ext4_ialloc.h @@ -46,8 +46,8 @@ extern "C" { #endif -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" /**@brief Free i-node number and modify filesystem data structers. * @param fs Filesystem, where the i-node is located diff --git a/lwext4/ext4_inode.c b/lwext4/ext4_inode.c index ffe4596..e8c9760 100644 --- a/lwext4/ext4_inode.c +++ b/lwext4/ext4_inode.c @@ -39,10 +39,10 @@ * @brief Inode handle functions */ -#include -#include -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" +#include "ext4_inode.h" +#include "ext4_super.h" /**@brief Compute number of bits for block count. * @param block_size Filesystem block_size diff --git a/lwext4/ext4_inode.h b/lwext4/ext4_inode.h index cadd987..88af086 100644 --- a/lwext4/ext4_inode.h +++ b/lwext4/ext4_inode.h @@ -42,7 +42,8 @@ #ifndef EXT4_INODE_H_ #define EXT4_INODE_H_ -#include +#include "ext4_config.h" + #include /**@brief Get mode of the i-node. diff --git a/lwext4/ext4_super.c b/lwext4/ext4_super.c index e86529b..6f57c71 100644 --- a/lwext4/ext4_super.c +++ b/lwext4/ext4_super.c @@ -39,8 +39,8 @@ * @brief Superblock operations. */ -#include -#include +#include "ext4_config.h" +#include "ext4_super.h" uint32_t ext4_block_group_cnt(struct ext4_sblock *s) { diff --git a/lwext4/ext4_super.h b/lwext4/ext4_super.h index 45eaa14..14b14a0 100644 --- a/lwext4/ext4_super.h +++ b/lwext4/ext4_super.h @@ -42,8 +42,8 @@ #ifndef EXT4_SUPER_H_ #define EXT4_SUPER_H_ -#include -#include +#include "ext4_config.h" +#include "ext4_types.h" /**@brief Blocks count get stored in superblock. * @param s superblock descriptor diff --git a/lwext4/ext4_types.h b/lwext4/ext4_types.h index 22d19d2..387948c 100644 --- a/lwext4/ext4_types.h +++ b/lwext4/ext4_types.h @@ -42,8 +42,8 @@ #ifndef EXT4_TYPES_H_ #define EXT4_TYPES_H_ -#include -#include +#include "ext4_config.h" +#include "ext4_blockdev.h" #include