Lines Matching refs:s
13 secno hpfs_bplus_lookup(struct super_block *s, struct inode *inode, in hpfs_bplus_lookup() argument
22 if (hpfs_sb(s)->sb_chk) if (hpfs_stop_cycles(s, a, &c1, &c2, "hpfs_bplus_lookup")) return -1; in hpfs_bplus_lookup()
28 if (!(anode = hpfs_map_anode(s, a, &bh))) return -1; in hpfs_bplus_lookup()
32 hpfs_error(s, "sector %08x not found in internal anode %08x", sec, a); in hpfs_bplus_lookup()
40 if (hpfs_sb(s)->sb_chk) if (hpfs_chk_sectors(s, a, 1, "data")) { in hpfs_bplus_lookup()
53 hpfs_error(s, "sector %08x not found in external anode %08x", sec, a); in hpfs_bplus_lookup()
60 secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsigned fsecno) in hpfs_add_sector_to_btree() argument
72 if (!(fnode = hpfs_map_fnode(s, node, &bh))) return -1; in hpfs_add_sector_to_btree()
75 if (!(anode = hpfs_map_anode(s, node, &bh))) return -1; in hpfs_add_sector_to_btree()
81 hpfs_error(s, "anode %08x has no entries", a); in hpfs_add_sector_to_btree()
90 if (hpfs_sb(s)->sb_chk) in hpfs_add_sector_to_btree()
91 if (hpfs_stop_cycles(s, a, &c1, &c2, "hpfs_add_sector_to_btree #1")) return -1; in hpfs_add_sector_to_btree()
92 if (!(anode = hpfs_map_anode(s, a, &bh))) return -1; in hpfs_add_sector_to_btree()
98 hpfs_error(s, "allocated size %08x, trying to add sector %08x, %cnode %08x", in hpfs_add_sector_to_btree()
104 …if (hpfs_alloc_if_possible(s, se = le32_to_cpu(btree->u.external[n].disk_secno) + le32_to_cpu(btre… in hpfs_add_sector_to_btree()
112 hpfs_error(s, "empty file %08x, trying to add sector %08x", node, fsecno); in hpfs_add_sector_to_btree()
118 …if (!(se = hpfs_alloc_sector(s, se, 1, fsecno*ALLOC_M>ALLOC_FWD_MAX ? ALLOC_FWD_MAX : fsecno*ALLOC… in hpfs_add_sector_to_btree()
125 if (!(anode = hpfs_alloc_anode(s, a, &na, &bh1))) { in hpfs_add_sector_to_btree()
127 hpfs_free_sectors(s, se, 1); in hpfs_add_sector_to_btree()
144 } else if (!(ranode = hpfs_alloc_anode(s, /*a*/0, &ra, &bh2))) { in hpfs_add_sector_to_btree()
147 hpfs_free_sectors(s, se, 1); in hpfs_add_sector_to_btree()
148 hpfs_free_sectors(s, na, 1); in hpfs_add_sector_to_btree()
166 if (hpfs_sb(s)->sb_chk) in hpfs_add_sector_to_btree()
167 if (hpfs_stop_cycles(s, up, &c1, &c2, "hpfs_add_sector_to_btree #2")) return -1; in hpfs_add_sector_to_btree()
169 if (!(anode = hpfs_map_anode(s, up, &bh))) return -1; in hpfs_add_sector_to_btree()
172 if (!(fnode = hpfs_map_fnode(s, up, &bh))) return -1; in hpfs_add_sector_to_btree()
184 hpfs_free_sectors(s, ra, 1); in hpfs_add_sector_to_btree()
185 if ((anode = hpfs_map_anode(s, na, &bh))) { in hpfs_add_sector_to_btree()
201 if ((new_anode = hpfs_alloc_anode(s, a, &na, &bh))) { in hpfs_add_sector_to_btree()
212 if ((anode = hpfs_map_anode(s, a, &bh))) { in hpfs_add_sector_to_btree()
219 if ((anode = hpfs_map_anode(s, na, &bh))) { in hpfs_add_sector_to_btree()
227 if (!(anode = hpfs_map_anode(s, node, &bh))) { in hpfs_add_sector_to_btree()
233 if (!(fnode = hpfs_map_fnode(s, node, &bh))) { in hpfs_add_sector_to_btree()
246 if ((unode = hpfs_map_anode(s, le32_to_cpu(ranode->u.internal[n].down), &bh1))) { in hpfs_add_sector_to_btree()
273 void hpfs_remove_btree(struct super_block *s, struct bplus_header *btree) in hpfs_remove_btree() argument
289 if (hpfs_sb(s)->sb_chk) in hpfs_remove_btree()
290 if (hpfs_stop_cycles(s, ano, &d1, &d2, "hpfs_remove_btree #1")) in hpfs_remove_btree()
292 if (!(anode = hpfs_map_anode(s, ano, &bh))) return; in hpfs_remove_btree()
298 …hpfs_free_sectors(s, le32_to_cpu(btree1->u.external[i].disk_secno), le32_to_cpu(btree1->u.external… in hpfs_remove_btree()
302 if (hpfs_sb(s)->sb_chk) in hpfs_remove_btree()
303 if (hpfs_stop_cycles(s, ano, &c1, &c2, "hpfs_remove_btree #2")) return; in hpfs_remove_btree()
304 hpfs_free_sectors(s, ano, 1); in hpfs_remove_btree()
308 if (!(anode = hpfs_map_anode(s, ano, &bh))) return; in hpfs_remove_btree()
319 hpfs_error(s, in hpfs_remove_btree()
329 static secno anode_lookup(struct super_block *s, anode_secno a, unsigned sec) in anode_lookup() argument
333 if (!(anode = hpfs_map_anode(s, a, &bh))) return -1; in anode_lookup()
334 return hpfs_bplus_lookup(s, NULL, &anode->btree, sec, bh); in anode_lookup()
337 int hpfs_ea_read(struct super_block *s, secno a, int ano, unsigned pos, in hpfs_ea_read() argument
346 if ((sec = anode_lookup(s, a, pos >> 9)) == -1) in hpfs_ea_read()
349 if (hpfs_sb(s)->sb_chk) if (hpfs_chk_sectors(s, sec, 1, "ea #1")) return -1; in hpfs_ea_read()
350 if (!(data = hpfs_map_sector(s, sec, &bh, (len - 1) >> 9))) in hpfs_ea_read()
360 int hpfs_ea_write(struct super_block *s, secno a, int ano, unsigned pos, in hpfs_ea_write() argument
369 if ((sec = anode_lookup(s, a, pos >> 9)) == -1) in hpfs_ea_write()
372 if (hpfs_sb(s)->sb_chk) if (hpfs_chk_sectors(s, sec, 1, "ea #2")) return -1; in hpfs_ea_write()
373 if (!(data = hpfs_map_sector(s, sec, &bh, (len - 1) >> 9))) in hpfs_ea_write()
384 void hpfs_ea_remove(struct super_block *s, secno a, int ano, unsigned len) in hpfs_ea_remove() argument
389 if (!(anode = hpfs_map_anode(s, a, &bh))) return; in hpfs_ea_remove()
390 hpfs_remove_btree(s, &anode->btree); in hpfs_ea_remove()
392 hpfs_free_sectors(s, a, 1); in hpfs_ea_remove()
393 } else hpfs_free_sectors(s, a, (len + 511) >> 9); in hpfs_ea_remove()
398 void hpfs_truncate_btree(struct super_block *s, secno f, int fno, unsigned secs) in hpfs_truncate_btree() argument
408 if (!(fnode = hpfs_map_fnode(s, f, &bh))) return; in hpfs_truncate_btree()
411 if (!(anode = hpfs_map_anode(s, f, &bh))) return; in hpfs_truncate_btree()
415 hpfs_remove_btree(s, btree); in hpfs_truncate_btree()
422 } else hpfs_free_sectors(s, f, 1); in hpfs_truncate_btree()
431 hpfs_error(s, "internal btree %08x doesn't end with -1", node); in hpfs_truncate_btree()
435 hpfs_ea_remove(s, le32_to_cpu(btree->u.internal[j].down), 1, 0); in hpfs_truncate_btree()
446 if (hpfs_sb(s)->sb_chk) in hpfs_truncate_btree()
447 if (hpfs_stop_cycles(s, node, &c1, &c2, "hpfs_truncate_btree")) in hpfs_truncate_btree()
449 if (!(anode = hpfs_map_anode(s, node, &bh))) return; in hpfs_truncate_btree()
459 hpfs_error(s, "there is an allocation error in file %08x, sector %08x", f, secs); in hpfs_truncate_btree()
463 hpfs_free_sectors(s, le32_to_cpu(btree->u.external[i].disk_secno) + secs - in hpfs_truncate_btree()
469 …hpfs_free_sectors(s, le32_to_cpu(btree->u.external[j].disk_secno), le32_to_cpu(btree->u.external[j… in hpfs_truncate_btree()
480 void hpfs_remove_fnode(struct super_block *s, fnode_secno fno) in hpfs_remove_fnode() argument
486 if (!(fnode = hpfs_map_fnode(s, fno, &bh))) return; in hpfs_remove_fnode()
487 if (!fnode_is_dir(fnode)) hpfs_remove_btree(s, &fnode->btree); in hpfs_remove_fnode()
488 else hpfs_remove_dtree(s, le32_to_cpu(fnode->u.external[0].disk_secno)); in hpfs_remove_fnode()
492 hpfs_ea_remove(s, ea_sec(ea), ea_in_anode(ea), ea_len(ea)); in hpfs_remove_fnode()
493 …hpfs_ea_ext_remove(s, le32_to_cpu(fnode->ea_secno), fnode_in_anode(fnode), le32_to_cpu(fnode->ea_s… in hpfs_remove_fnode()
495 hpfs_free_sectors(s, fno, 1); in hpfs_remove_fnode()