diff options
author | Mingming Cao <cmm@us.ibm.com> | 2006-10-11 04:21:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-11 14:14:18 -0400 |
commit | 9b8f1f0106ab39ad58765d4e7c57189835f51127 (patch) | |
tree | 7f853ec30e4edc57f8b0c82db52b20a5beb75c38 /fs/ext4/extents.c | |
parent | 2ae0210760aed9d626eaede5b63db95e198f7c8e (diff) |
[PATCH] ext4: removesector_t bits check
Previously when in-kernel ext4 block type is sector_t, it's only 4 bits long
under some 32bit arch (when CONFIG_LBD is not on). So we need to check the
size of sector_t before we read 48bit long on-disk blocks to in-kernel blocks.
These checks are unnecessary now as we changed the in-kernel blocks to
unsigned longlong.
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 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index f72b7567bfa2..926186a787a8 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -53,8 +53,7 @@ static inline ext4_fsblk_t ext_pblock(struct ext4_extent *ex) | |||
53 | ext4_fsblk_t block; | 53 | ext4_fsblk_t block; |
54 | 54 | ||
55 | block = le32_to_cpu(ex->ee_start); | 55 | block = le32_to_cpu(ex->ee_start); |
56 | if (sizeof(ext4_fsblk_t) > 4) | 56 | block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1; |
57 | block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1; | ||
58 | return block; | 57 | return block; |
59 | } | 58 | } |
60 | 59 | ||
@@ -67,8 +66,7 @@ static inline ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix) | |||
67 | ext4_fsblk_t block; | 66 | ext4_fsblk_t block; |
68 | 67 | ||
69 | block = le32_to_cpu(ix->ei_leaf); | 68 | block = le32_to_cpu(ix->ei_leaf); |
70 | if (sizeof(ext4_fsblk_t) > 4) | 69 | block |= ((ext4_fsblk_t) le16_to_cpu(ix->ei_leaf_hi) << 31) << 1; |
71 | block |= ((ext4_fsblk_t) le16_to_cpu(ix->ei_leaf_hi) << 31) << 1; | ||
72 | return block; | 70 | return block; |
73 | } | 71 | } |
74 | 72 | ||
@@ -80,8 +78,7 @@ static inline ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix) | |||
80 | static inline void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb) | 78 | static inline void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb) |
81 | { | 79 | { |
82 | ex->ee_start = cpu_to_le32((unsigned long) (pb & 0xffffffff)); | 80 | ex->ee_start = cpu_to_le32((unsigned long) (pb & 0xffffffff)); |
83 | if (sizeof(ext4_fsblk_t) > 4) | 81 | ex->ee_start_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff); |
84 | ex->ee_start_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff); | ||
85 | } | 82 | } |
86 | 83 | ||
87 | /* | 84 | /* |
@@ -92,8 +89,7 @@ static inline void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb | |||
92 | static inline void ext4_idx_store_pblock(struct ext4_extent_idx *ix, ext4_fsblk_t pb) | 89 | static inline void ext4_idx_store_pblock(struct ext4_extent_idx *ix, ext4_fsblk_t pb) |
93 | { | 90 | { |
94 | ix->ei_leaf = cpu_to_le32((unsigned long) (pb & 0xffffffff)); | 91 | ix->ei_leaf = cpu_to_le32((unsigned long) (pb & 0xffffffff)); |
95 | if (sizeof(ext4_fsblk_t) > 4) | 92 | ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff); |
96 | ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff); | ||
97 | } | 93 | } |
98 | 94 | ||
99 | static int ext4_ext_check_header(const char *function, struct inode *inode, | 95 | static int ext4_ext_check_header(const char *function, struct inode *inode, |