summaryrefslogtreecommitdiff
path: root/fs/ext4/ext4_common.h
diff options
context:
space:
mode:
authorStefan Brüns <stefan.bruens@rwth-aachen.de>2016-09-20 01:12:42 +0200
committerTom Rini <trini@konsulko.com>2016-09-23 09:18:56 -0400
commit9f5dd8b6e2ff0f1553cc71aaf6cb53adb9c7f5e6 (patch)
tree35aa054496b2fda74a53911faca169714f60efc6 /fs/ext4/ext4_common.h
parentfc214ef90910159f33fbe92a6cb77839a27fa8a6 (diff)
ext4: Add helper functions for block group descriptor field access
The helper functions encapsulate access of the block group descriptors, independent of group descriptor size. The helpers also deal with the endianess of the fields, and with split fields like free_blocks/ free_blocks_high. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Diffstat (limited to 'fs/ext4/ext4_common.h')
-rw-r--r--fs/ext4/ext4_common.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/ext4/ext4_common.h b/fs/ext4/ext4_common.h
index cc9d0c5a5f..99d49e6e55 100644
--- a/fs/ext4/ext4_common.h
+++ b/fs/ext4/ext4_common.h
@@ -74,5 +74,17 @@ void ext4fs_allocate_blocks(struct ext2_inode *file_inode,
unsigned int total_remaining_blocks,
unsigned int *total_no_of_block);
void put_ext4(uint64_t off, void *buf, uint32_t size);
+struct ext2_block_group *ext4fs_get_group_descriptor
+ (const struct ext_filesystem *fs, uint32_t bg_idx);
+uint64_t ext4fs_bg_get_block_id(const struct ext2_block_group *bg,
+ const struct ext_filesystem *fs);
+uint64_t ext4fs_bg_get_inode_id(const struct ext2_block_group *bg,
+ const struct ext_filesystem *fs);
+uint64_t ext4fs_bg_get_inode_table_id(const struct ext2_block_group *bg,
+ const struct ext_filesystem *fs);
+uint64_t ext4fs_sb_get_free_blocks(const struct ext2_sblock *sb);
+void ext4fs_sb_set_free_blocks(struct ext2_sblock *sb, uint64_t free_blocks);
+uint32_t ext4fs_bg_get_free_blocks(const struct ext2_block_group *bg,
+ const struct ext_filesystem *fs);
#endif
#endif