aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-01-10 12:13:03 -0500
committerTheodore Ts'o <tytso@mit.edu>2011-01-10 12:13:03 -0500
commit01f49d0b9d0209dc1194255b11601e4b94447b36 (patch)
treec3ec53c7725bf7a9188e844d8c8c09432d2be6ae
parentf232109773ff5b0c840a6761d74940b9cf0d66ec (diff)
ext4: use ext4_lblk_t instead of sector_t for logical blocks
This fixes a number of places where we used sector_t instead of ext4_lblk_t for logical blocks, which for ext4 are still 32-bit data types. No point wasting space in the ext4_inode_info structure, and requiring 64-bit arithmetic on 32-bit systems, when it isn't necessary. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--fs/ext4/ext4.h2
-rw-r--r--fs/ext4/ext4_extents.h2
-rw-r--r--fs/ext4/extents.c2
-rw-r--r--fs/ext4/inode.c4
4 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index b7ee66ff9962..746a59853a07 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -828,7 +828,7 @@ struct ext4_inode_info {
828 unsigned int i_reserved_data_blocks; 828 unsigned int i_reserved_data_blocks;
829 unsigned int i_reserved_meta_blocks; 829 unsigned int i_reserved_meta_blocks;
830 unsigned int i_allocated_meta_blocks; 830 unsigned int i_allocated_meta_blocks;
831 sector_t i_da_metadata_calc_last_lblock; 831 ext4_lblk_t i_da_metadata_calc_last_lblock;
832 int i_da_metadata_calc_len; 832 int i_da_metadata_calc_len;
833 833
834 /* on-disk additional length */ 834 /* on-disk additional length */
diff --git a/fs/ext4/ext4_extents.h b/fs/ext4/ext4_extents.h
index 28ce70fd9cd0..dfdda1766927 100644
--- a/fs/ext4/ext4_extents.h
+++ b/fs/ext4/ext4_extents.h
@@ -278,7 +278,7 @@ static inline void ext4_idx_store_pblock(struct ext4_extent_idx *ix,
278} 278}
279 279
280extern int ext4_ext_calc_metadata_amount(struct inode *inode, 280extern int ext4_ext_calc_metadata_amount(struct inode *inode,
281 sector_t lblocks); 281 ext4_lblk_t lblocks);
282extern int ext4_extent_tree_init(handle_t *, struct inode *); 282extern int ext4_extent_tree_init(handle_t *, struct inode *);
283extern int ext4_ext_calc_credits_for_single_extent(struct inode *inode, 283extern int ext4_ext_calc_credits_for_single_extent(struct inode *inode,
284 int num, 284 int num,
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index d53e20f53103..f1a4354ea3cf 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -266,7 +266,7 @@ static inline int ext4_ext_space_root_idx(struct inode *inode, int check)
266 * to allocate @blocks 266 * to allocate @blocks
267 * Worse case is one block per extent 267 * Worse case is one block per extent
268 */ 268 */
269int ext4_ext_calc_metadata_amount(struct inode *inode, sector_t lblock) 269int ext4_ext_calc_metadata_amount(struct inode *inode, ext4_lblk_t lblock)
270{ 270{
271 struct ext4_inode_info *ei = EXT4_I(inode); 271 struct ext4_inode_info *ei = EXT4_I(inode);
272 int idxs, num = 0; 272 int idxs, num = 0;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index ac08460921aa..3ae83137cf34 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1091,7 +1091,7 @@ static int ext4_indirect_calc_metadata_amount(struct inode *inode,
1091 * Calculate the number of metadata blocks need to reserve 1091 * Calculate the number of metadata blocks need to reserve
1092 * to allocate a block located at @lblock 1092 * to allocate a block located at @lblock
1093 */ 1093 */
1094static int ext4_calc_metadata_amount(struct inode *inode, sector_t lblock) 1094static int ext4_calc_metadata_amount(struct inode *inode, ext4_lblk_t lblock)
1095{ 1095{
1096 if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) 1096 if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
1097 return ext4_ext_calc_metadata_amount(inode, lblock); 1097 return ext4_ext_calc_metadata_amount(inode, lblock);
@@ -1888,7 +1888,7 @@ static int ext4_journalled_write_end(struct file *file,
1888/* 1888/*
1889 * Reserve a single block located at lblock 1889 * Reserve a single block located at lblock
1890 */ 1890 */
1891static int ext4_da_reserve_space(struct inode *inode, sector_t lblock) 1891static int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock)
1892{ 1892{
1893 int retries = 0; 1893 int retries = 0;
1894 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); 1894 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);