diff options
Diffstat (limited to 'fs/hpfs/map.c')
-rw-r--r-- | fs/hpfs/map.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/hpfs/map.c b/fs/hpfs/map.c index a790821366a7..4acb19d78359 100644 --- a/fs/hpfs/map.c +++ b/fs/hpfs/map.c | |||
@@ -8,12 +8,12 @@ | |||
8 | 8 | ||
9 | #include "hpfs_fn.h" | 9 | #include "hpfs_fn.h" |
10 | 10 | ||
11 | unsigned *hpfs_map_dnode_bitmap(struct super_block *s, struct quad_buffer_head *qbh) | 11 | __le32 *hpfs_map_dnode_bitmap(struct super_block *s, struct quad_buffer_head *qbh) |
12 | { | 12 | { |
13 | return hpfs_map_4sectors(s, hpfs_sb(s)->sb_dmap, qbh, 0); | 13 | return hpfs_map_4sectors(s, hpfs_sb(s)->sb_dmap, qbh, 0); |
14 | } | 14 | } |
15 | 15 | ||
16 | unsigned int *hpfs_map_bitmap(struct super_block *s, unsigned bmp_block, | 16 | __le32 *hpfs_map_bitmap(struct super_block *s, unsigned bmp_block, |
17 | struct quad_buffer_head *qbh, char *id) | 17 | struct quad_buffer_head *qbh, char *id) |
18 | { | 18 | { |
19 | secno sec; | 19 | secno sec; |
@@ -89,18 +89,18 @@ unsigned char *hpfs_load_code_page(struct super_block *s, secno cps) | |||
89 | return cp_table; | 89 | return cp_table; |
90 | } | 90 | } |
91 | 91 | ||
92 | secno *hpfs_load_bitmap_directory(struct super_block *s, secno bmp) | 92 | __le32 *hpfs_load_bitmap_directory(struct super_block *s, secno bmp) |
93 | { | 93 | { |
94 | struct buffer_head *bh; | 94 | struct buffer_head *bh; |
95 | int n = (hpfs_sb(s)->sb_fs_size + 0x200000 - 1) >> 21; | 95 | int n = (hpfs_sb(s)->sb_fs_size + 0x200000 - 1) >> 21; |
96 | int i; | 96 | int i; |
97 | secno *b; | 97 | __le32 *b; |
98 | if (!(b = kmalloc(n * 512, GFP_KERNEL))) { | 98 | if (!(b = kmalloc(n * 512, GFP_KERNEL))) { |
99 | printk("HPFS: can't allocate memory for bitmap directory\n"); | 99 | printk("HPFS: can't allocate memory for bitmap directory\n"); |
100 | return NULL; | 100 | return NULL; |
101 | } | 101 | } |
102 | for (i=0;i<n;i++) { | 102 | for (i=0;i<n;i++) { |
103 | secno *d = hpfs_map_sector(s, bmp+i, &bh, n - i - 1); | 103 | __le32 *d = hpfs_map_sector(s, bmp+i, &bh, n - i - 1); |
104 | if (!d) { | 104 | if (!d) { |
105 | kfree(b); | 105 | kfree(b); |
106 | return NULL; | 106 | return NULL; |
@@ -130,16 +130,16 @@ struct fnode *hpfs_map_fnode(struct super_block *s, ino_t ino, struct buffer_hea | |||
130 | (unsigned long)ino); | 130 | (unsigned long)ino); |
131 | goto bail; | 131 | goto bail; |
132 | } | 132 | } |
133 | if (!fnode->dirflag) { | 133 | if (!fnode_is_dir(fnode)) { |
134 | if ((unsigned)fnode->btree.n_used_nodes + (unsigned)fnode->btree.n_free_nodes != | 134 | if ((unsigned)fnode->btree.n_used_nodes + (unsigned)fnode->btree.n_free_nodes != |
135 | (fnode->btree.internal ? 12 : 8)) { | 135 | (bp_internal(&fnode->btree) ? 12 : 8)) { |
136 | hpfs_error(s, | 136 | hpfs_error(s, |
137 | "bad number of nodes in fnode %08lx", | 137 | "bad number of nodes in fnode %08lx", |
138 | (unsigned long)ino); | 138 | (unsigned long)ino); |
139 | goto bail; | 139 | goto bail; |
140 | } | 140 | } |
141 | if (le16_to_cpu(fnode->btree.first_free) != | 141 | if (le16_to_cpu(fnode->btree.first_free) != |
142 | 8 + fnode->btree.n_used_nodes * (fnode->btree.internal ? 8 : 12)) { | 142 | 8 + fnode->btree.n_used_nodes * (bp_internal(&fnode->btree) ? 8 : 12)) { |
143 | hpfs_error(s, | 143 | hpfs_error(s, |
144 | "bad first_free pointer in fnode %08lx", | 144 | "bad first_free pointer in fnode %08lx", |
145 | (unsigned long)ino); | 145 | (unsigned long)ino); |
@@ -187,12 +187,12 @@ struct anode *hpfs_map_anode(struct super_block *s, anode_secno ano, struct buff | |||
187 | goto bail; | 187 | goto bail; |
188 | } | 188 | } |
189 | if ((unsigned)anode->btree.n_used_nodes + (unsigned)anode->btree.n_free_nodes != | 189 | if ((unsigned)anode->btree.n_used_nodes + (unsigned)anode->btree.n_free_nodes != |
190 | (anode->btree.internal ? 60 : 40)) { | 190 | (bp_internal(&anode->btree) ? 60 : 40)) { |
191 | hpfs_error(s, "bad number of nodes in anode %08x", ano); | 191 | hpfs_error(s, "bad number of nodes in anode %08x", ano); |
192 | goto bail; | 192 | goto bail; |
193 | } | 193 | } |
194 | if (le16_to_cpu(anode->btree.first_free) != | 194 | if (le16_to_cpu(anode->btree.first_free) != |
195 | 8 + anode->btree.n_used_nodes * (anode->btree.internal ? 8 : 12)) { | 195 | 8 + anode->btree.n_used_nodes * (bp_internal(&anode->btree) ? 8 : 12)) { |
196 | hpfs_error(s, "bad first_free pointer in anode %08x", ano); | 196 | hpfs_error(s, "bad first_free pointer in anode %08x", ano); |
197 | goto bail; | 197 | goto bail; |
198 | } | 198 | } |