diff options
author | Mingming Cao <cmm@us.ibm.com> | 2006-10-11 04:21:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-11 14:14:16 -0400 |
commit | 3a5b2ecdd1fa63a8f25bd769223bc1c2564ce45d (patch) | |
tree | dc80fdde9ed01e77ef0ed6fdef7573d303bd07db /include/linux/ext4_fs.h | |
parent | a86c61812637c7dd0c57e29880cffd477b62f2e7 (diff) |
[PATCH] ext4: switch fsblk to sector_t
Redefine ext3 in-kernel filesystem block type (ext3_fsblk_t) from unsigned
long to sector_t, to allow kernel to handle >32 bit ext3 blocks.
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/ext4_fs.h')
-rw-r--r-- | include/linux/ext4_fs.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h index b61181aadcbb..e952c6db9690 100644 --- a/include/linux/ext4_fs.h +++ b/include/linux/ext4_fs.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #define _LINUX_EXT4_FS_H | 17 | #define _LINUX_EXT4_FS_H |
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/blkdev.h> | ||
20 | #include <linux/magic.h> | 21 | #include <linux/magic.h> |
21 | 22 | ||
22 | /* | 23 | /* |
@@ -750,6 +751,27 @@ ext4_group_first_block_no(struct super_block *sb, unsigned long group_no) | |||
750 | #define ERR_BAD_DX_DIR -75000 | 751 | #define ERR_BAD_DX_DIR -75000 |
751 | 752 | ||
752 | /* | 753 | /* |
754 | * This function calculate the block group number and offset, | ||
755 | * given a block number | ||
756 | */ | ||
757 | |||
758 | static inline void ext4_get_group_no_and_offset(struct super_block * sb, | ||
759 | ext4_fsblk_t blocknr, unsigned long* blockgrpp, | ||
760 | ext4_grpblk_t *offsetp) | ||
761 | { | ||
762 | struct ext4_super_block *es = EXT4_SB(sb)->s_es; | ||
763 | ext4_grpblk_t offset; | ||
764 | |||
765 | blocknr = blocknr - le32_to_cpu(es->s_first_data_block); | ||
766 | offset = sector_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)); | ||
767 | if (offsetp) | ||
768 | *offsetp = offset; | ||
769 | if (blockgrpp) | ||
770 | *blockgrpp = blocknr; | ||
771 | |||
772 | } | ||
773 | |||
774 | /* | ||
753 | * Function prototypes | 775 | * Function prototypes |
754 | */ | 776 | */ |
755 | 777 | ||
@@ -762,6 +784,10 @@ ext4_group_first_block_no(struct super_block *sb, unsigned long group_no) | |||
762 | # define NORET_AND noreturn, | 784 | # define NORET_AND noreturn, |
763 | 785 | ||
764 | /* balloc.c */ | 786 | /* balloc.c */ |
787 | extern unsigned int ext4_block_group(struct super_block *sb, | ||
788 | ext4_fsblk_t blocknr); | ||
789 | extern ext4_grpblk_t ext4_block_group_offset(struct super_block *sb, | ||
790 | ext4_fsblk_t blocknr); | ||
765 | extern int ext4_bg_has_super(struct super_block *sb, int group); | 791 | extern int ext4_bg_has_super(struct super_block *sb, int group); |
766 | extern unsigned long ext4_bg_num_gdb(struct super_block *sb, int group); | 792 | extern unsigned long ext4_bg_num_gdb(struct super_block *sb, int group); |
767 | extern ext4_fsblk_t ext4_new_block (handle_t *handle, struct inode *inode, | 793 | extern ext4_fsblk_t ext4_new_block (handle_t *handle, struct inode *inode, |