diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-09-09 18:44:51 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-09-09 18:44:51 -0400 |
commit | d5b8f31007a93777cfb0603b665858fb7aebebfc (patch) | |
tree | 19d9dfed9314132302b8e3036a2ada26f9809036 /fs/ext4/ext4.h | |
parent | fd034a84e1ea5c8c8d159cd2089c32e792c269b0 (diff) |
ext4: bigalloc changes to block bitmap initialization functions
Add bigalloc support to ext4_init_block_bitmap() and
ext4_free_blocks_after_init().
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index b0b7b67e439d..803cfa42e1e8 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -261,6 +261,14 @@ struct ext4_io_submit { | |||
261 | #endif | 261 | #endif |
262 | #define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits))) | 262 | #define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits))) |
263 | 263 | ||
264 | /* Translate a block number to a cluster number */ | ||
265 | #define EXT4_B2C(sbi, blk) ((blk) >> (sbi)->s_cluster_bits) | ||
266 | /* Translate a cluster number to a block number */ | ||
267 | #define EXT4_C2B(sbi, cluster) ((cluster) << (sbi)->s_cluster_bits) | ||
268 | /* Translate # of blks to # of clusters */ | ||
269 | #define EXT4_NUM_B2C(sbi, blks) (((blks) + (sbi)->s_cluster_ratio - 1) >> \ | ||
270 | (sbi)->s_cluster_bits) | ||
271 | |||
264 | /* | 272 | /* |
265 | * Structure of a blocks group descriptor | 273 | * Structure of a blocks group descriptor |
266 | */ | 274 | */ |
@@ -1770,6 +1778,11 @@ extern void ext4_init_block_bitmap(struct super_block *sb, | |||
1770 | extern unsigned ext4_free_blocks_after_init(struct super_block *sb, | 1778 | extern unsigned ext4_free_blocks_after_init(struct super_block *sb, |
1771 | ext4_group_t block_group, | 1779 | ext4_group_t block_group, |
1772 | struct ext4_group_desc *gdp); | 1780 | struct ext4_group_desc *gdp); |
1781 | extern unsigned ext4_num_base_meta_clusters(struct super_block *sb, | ||
1782 | ext4_group_t block_group); | ||
1783 | extern unsigned ext4_num_overhead_clusters(struct super_block *sb, | ||
1784 | ext4_group_t block_group, | ||
1785 | struct ext4_group_desc *gdp); | ||
1773 | ext4_fsblk_t ext4_inode_to_goal_block(struct inode *); | 1786 | ext4_fsblk_t ext4_inode_to_goal_block(struct inode *); |
1774 | 1787 | ||
1775 | /* dir.c */ | 1788 | /* dir.c */ |