@@ -27,7 +27,7 @@ secno hpfs_bplus_lookup(struct super_block *s, struct inode *inode,
2727 a = le32_to_cpu (btree -> u .internal [i ].down );
2828 brelse (bh );
2929 if (!(anode = hpfs_map_anode (s , a , & bh ))) return -1 ;
30- btree = & anode -> btree ;
30+ btree = GET_BTREE_PTR ( & anode -> btree ) ;
3131 goto go_down ;
3232 }
3333 hpfs_error (s , "sector %08x not found in internal anode %08x" , sec , a );
@@ -69,12 +69,13 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi
6969 int n ;
7070 unsigned fs ;
7171 int c1 , c2 = 0 ;
72+
7273 if (fnod ) {
7374 if (!(fnode = hpfs_map_fnode (s , node , & bh ))) return -1 ;
74- btree = & fnode -> btree ;
75+ btree = GET_BTREE_PTR ( & fnode -> btree ) ;
7576 } else {
7677 if (!(anode = hpfs_map_anode (s , node , & bh ))) return -1 ;
77- btree = & anode -> btree ;
78+ btree = GET_BTREE_PTR ( & anode -> btree ) ;
7879 }
7980 a = node ;
8081 go_down :
@@ -91,7 +92,7 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi
9192 if (hpfs_sb (s )-> sb_chk )
9293 if (hpfs_stop_cycles (s , a , & c1 , & c2 , "hpfs_add_sector_to_btree #1" )) return -1 ;
9394 if (!(anode = hpfs_map_anode (s , a , & bh ))) return -1 ;
94- btree = & anode -> btree ;
95+ btree = GET_BTREE_PTR ( & anode -> btree ) ;
9596 goto go_down ;
9697 }
9798 if (n >= 0 ) {
@@ -151,7 +152,7 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi
151152 }
152153 brelse (bh );
153154 bh = bh1 ;
154- btree = & anode -> btree ;
155+ btree = GET_BTREE_PTR ( & anode -> btree ) ;
155156 }
156157 btree -> n_free_nodes -- ; n = btree -> n_used_nodes ++ ;
157158 le16_add_cpu (& btree -> first_free , 12 );
@@ -168,10 +169,10 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi
168169 if (hpfs_stop_cycles (s , up , & c1 , & c2 , "hpfs_add_sector_to_btree #2" )) return -1 ;
169170 if (up != node || !fnod ) {
170171 if (!(anode = hpfs_map_anode (s , up , & bh ))) return -1 ;
171- btree = & anode -> btree ;
172+ btree = GET_BTREE_PTR ( & anode -> btree ) ;
172173 } else {
173174 if (!(fnode = hpfs_map_fnode (s , up , & bh ))) return -1 ;
174- btree = & fnode -> btree ;
175+ btree = GET_BTREE_PTR ( & fnode -> btree ) ;
175176 }
176177 if (btree -> n_free_nodes ) {
177178 btree -> n_free_nodes -- ; n = btree -> n_used_nodes ++ ;
@@ -206,8 +207,8 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi
206207 anode -> btree .n_used_nodes = 1 ;
207208 anode -> btree .n_free_nodes = 59 ;
208209 anode -> btree .first_free = cpu_to_le16 (16 );
209- anode -> btree . u .internal [0 ].down = cpu_to_le32 (a );
210- anode -> btree . u .internal [0 ].file_secno = cpu_to_le32 (-1 );
210+ GET_BTREE_PTR ( & anode -> btree ) -> u .internal [0 ].down = cpu_to_le32 (a );
211+ GET_BTREE_PTR ( & anode -> btree ) -> u .internal [0 ].file_secno = cpu_to_le32 (-1 );
211212 mark_buffer_dirty (bh );
212213 brelse (bh );
213214 if ((anode = hpfs_map_anode (s , a , & bh ))) {
@@ -229,20 +230,20 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi
229230 brelse (bh2 );
230231 return -1 ;
231232 }
232- btree = & anode -> btree ;
233+ btree = GET_BTREE_PTR ( & anode -> btree ) ;
233234 } else {
234235 if (!(fnode = hpfs_map_fnode (s , node , & bh ))) {
235236 brelse (bh2 );
236237 return -1 ;
237238 }
238- btree = & fnode -> btree ;
239+ btree = GET_BTREE_PTR ( & fnode -> btree ) ;
239240 }
240241 ranode -> up = cpu_to_le32 (node );
241242 memcpy (& ranode -> btree , btree , le16_to_cpu (btree -> first_free ));
242243 if (fnod )
243244 ranode -> btree .flags |= BP_fnode_parent ;
244- ranode -> btree . n_free_nodes = (bp_internal (& ranode -> btree ) ? 60 : 40 ) - ranode -> btree . n_used_nodes ;
245- if (bp_internal (& ranode -> btree )) for (n = 0 ; n < ranode -> btree . n_used_nodes ; n ++ ) {
245+ GET_BTREE_PTR ( & ranode -> btree ) -> n_free_nodes = (bp_internal (GET_BTREE_PTR ( & ranode -> btree )) ? 60 : 40 ) - GET_BTREE_PTR ( & ranode -> btree ) -> n_used_nodes ;
246+ if (bp_internal (GET_BTREE_PTR ( & ranode -> btree ))) for (n = 0 ; n < GET_BTREE_PTR ( & ranode -> btree ) -> n_used_nodes ; n ++ ) {
246247 struct anode * unode ;
247248 if ((unode = hpfs_map_anode (s , le32_to_cpu (ranode -> u .internal [n ].down ), & bh1 ))) {
248249 unode -> up = cpu_to_le32 (ra );
@@ -291,7 +292,7 @@ void hpfs_remove_btree(struct super_block *s, struct bplus_header *btree)
291292 if (hpfs_stop_cycles (s , ano , & d1 , & d2 , "hpfs_remove_btree #1" ))
292293 return ;
293294 if (!(anode = hpfs_map_anode (s , ano , & bh ))) return ;
294- btree1 = & anode -> btree ;
295+ btree1 = GET_BTREE_PTR ( & anode -> btree ) ;
295296 level ++ ;
296297 pos = 0 ;
297298 }
@@ -307,7 +308,7 @@ void hpfs_remove_btree(struct super_block *s, struct bplus_header *btree)
307308 ano = le32_to_cpu (anode -> up );
308309 if (-- level ) {
309310 if (!(anode = hpfs_map_anode (s , ano , & bh ))) return ;
310- btree1 = & anode -> btree ;
311+ btree1 = GET_BTREE_PTR ( & anode -> btree ) ;
311312 } else btree1 = btree ;
312313 for (i = 0 ; i < btree1 -> n_used_nodes ; i ++ ) {
313314 if (le32_to_cpu (btree1 -> u .internal [i ].down ) == oano ) {
@@ -332,7 +333,7 @@ static secno anode_lookup(struct super_block *s, anode_secno a, unsigned sec)
332333 struct anode * anode ;
333334 struct buffer_head * bh ;
334335 if (!(anode = hpfs_map_anode (s , a , & bh ))) return -1 ;
335- return hpfs_bplus_lookup (s , NULL , & anode -> btree , sec , bh );
336+ return hpfs_bplus_lookup (s , NULL , GET_BTREE_PTR ( & anode -> btree ) , sec , bh );
336337}
337338
338339int hpfs_ea_read (struct super_block * s , secno a , int ano , unsigned pos ,
@@ -388,7 +389,7 @@ void hpfs_ea_remove(struct super_block *s, secno a, int ano, unsigned len)
388389 struct buffer_head * bh ;
389390 if (ano ) {
390391 if (!(anode = hpfs_map_anode (s , a , & bh ))) return ;
391- hpfs_remove_btree (s , & anode -> btree );
392+ hpfs_remove_btree (s , GET_BTREE_PTR ( & anode -> btree ) );
392393 brelse (bh );
393394 hpfs_free_sectors (s , a , 1 );
394395 } else hpfs_free_sectors (s , a , (len + 511 ) >> 9 );
@@ -407,10 +408,10 @@ void hpfs_truncate_btree(struct super_block *s, secno f, int fno, unsigned secs)
407408 int c1 , c2 = 0 ;
408409 if (fno ) {
409410 if (!(fnode = hpfs_map_fnode (s , f , & bh ))) return ;
410- btree = & fnode -> btree ;
411+ btree = GET_BTREE_PTR ( & fnode -> btree ) ;
411412 } else {
412413 if (!(anode = hpfs_map_anode (s , f , & bh ))) return ;
413- btree = & anode -> btree ;
414+ btree = GET_BTREE_PTR ( & anode -> btree ) ;
414415 }
415416 if (!secs ) {
416417 hpfs_remove_btree (s , btree );
@@ -448,7 +449,7 @@ void hpfs_truncate_btree(struct super_block *s, secno f, int fno, unsigned secs)
448449 if (hpfs_stop_cycles (s , node , & c1 , & c2 , "hpfs_truncate_btree" ))
449450 return ;
450451 if (!(anode = hpfs_map_anode (s , node , & bh ))) return ;
451- btree = & anode -> btree ;
452+ btree = GET_BTREE_PTR ( & anode -> btree ) ;
452453 }
453454 nodes = btree -> n_used_nodes + btree -> n_free_nodes ;
454455 for (i = 0 ; i < btree -> n_used_nodes ; i ++ )
@@ -485,7 +486,7 @@ void hpfs_remove_fnode(struct super_block *s, fnode_secno fno)
485486 struct extended_attribute * ea ;
486487 struct extended_attribute * ea_end ;
487488 if (!(fnode = hpfs_map_fnode (s , fno , & bh ))) return ;
488- if (!fnode_is_dir (fnode )) hpfs_remove_btree (s , & fnode -> btree );
489+ if (!fnode_is_dir (fnode )) hpfs_remove_btree (s , GET_BTREE_PTR ( & fnode -> btree ) );
489490 else hpfs_remove_dtree (s , le32_to_cpu (fnode -> u .external [0 ].disk_secno ));
490491 ea_end = fnode_end_ea (fnode );
491492 for (ea = fnode_ea (fnode ); ea < ea_end ; ea = next_ea (ea ))
0 commit comments