• Home
  • Raw
  • Download

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 = btree->u.external[n].disk_secno + btree->u.external[n].length))… 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()
198 if ((new_anode = hpfs_alloc_anode(s, a, &na, &bh))) { in hpfs_add_sector_to_btree()
209 if ((anode = hpfs_map_anode(s, a, &bh))) { in hpfs_add_sector_to_btree()
216 if ((anode = hpfs_map_anode(s, na, &bh))) { in hpfs_add_sector_to_btree()
223 if (!(anode = hpfs_map_anode(s, node, &bh))) { in hpfs_add_sector_to_btree()
229 if (!(fnode = hpfs_map_fnode(s, node, &bh))) { in hpfs_add_sector_to_btree()
241 if ((unode = hpfs_map_anode(s, ranode->u.internal[n].down, &bh1))) { in hpfs_add_sector_to_btree()
268 void hpfs_remove_btree(struct super_block *s, struct bplus_header *btree) in hpfs_remove_btree() argument
284 if (hpfs_sb(s)->sb_chk) in hpfs_remove_btree()
285 if (hpfs_stop_cycles(s, ano, &d1, &d2, "hpfs_remove_btree #1")) in hpfs_remove_btree()
287 if (!(anode = hpfs_map_anode(s, ano, &bh))) return; in hpfs_remove_btree()
293 hpfs_free_sectors(s, btree1->u.external[i].disk_secno, btree1->u.external[i].length); in hpfs_remove_btree()
297 if (hpfs_sb(s)->sb_chk) in hpfs_remove_btree()
298 if (hpfs_stop_cycles(s, ano, &c1, &c2, "hpfs_remove_btree #2")) return; in hpfs_remove_btree()
299 hpfs_free_sectors(s, ano, 1); in hpfs_remove_btree()
303 if (!(anode = hpfs_map_anode(s, ano, &bh))) return; in hpfs_remove_btree()
314 hpfs_error(s, in hpfs_remove_btree()
324 static secno anode_lookup(struct super_block *s, anode_secno a, unsigned sec) in anode_lookup() argument
328 if (!(anode = hpfs_map_anode(s, a, &bh))) return -1; in anode_lookup()
329 return hpfs_bplus_lookup(s, NULL, &anode->btree, sec, bh); in anode_lookup()
332 int hpfs_ea_read(struct super_block *s, secno a, int ano, unsigned pos, in hpfs_ea_read() argument
341 if ((sec = anode_lookup(s, a, pos >> 9)) == -1) in hpfs_ea_read()
344 if (hpfs_sb(s)->sb_chk) if (hpfs_chk_sectors(s, sec, 1, "ea #1")) return -1; in hpfs_ea_read()
345 if (!(data = hpfs_map_sector(s, sec, &bh, (len - 1) >> 9))) in hpfs_ea_read()
355 int hpfs_ea_write(struct super_block *s, secno a, int ano, unsigned pos, in hpfs_ea_write() argument
364 if ((sec = anode_lookup(s, a, pos >> 9)) == -1) in hpfs_ea_write()
367 if (hpfs_sb(s)->sb_chk) if (hpfs_chk_sectors(s, sec, 1, "ea #2")) return -1; in hpfs_ea_write()
368 if (!(data = hpfs_map_sector(s, sec, &bh, (len - 1) >> 9))) in hpfs_ea_write()
379 void hpfs_ea_remove(struct super_block *s, secno a, int ano, unsigned len) in hpfs_ea_remove() argument
384 if (!(anode = hpfs_map_anode(s, a, &bh))) return; in hpfs_ea_remove()
385 hpfs_remove_btree(s, &anode->btree); in hpfs_ea_remove()
387 hpfs_free_sectors(s, a, 1); in hpfs_ea_remove()
388 } else hpfs_free_sectors(s, a, (len + 511) >> 9); in hpfs_ea_remove()
393 void hpfs_truncate_btree(struct super_block *s, secno f, int fno, unsigned secs) in hpfs_truncate_btree() argument
403 if (!(fnode = hpfs_map_fnode(s, f, &bh))) return; in hpfs_truncate_btree()
406 if (!(anode = hpfs_map_anode(s, f, &bh))) return; in hpfs_truncate_btree()
410 hpfs_remove_btree(s, btree); in hpfs_truncate_btree()
417 } else hpfs_free_sectors(s, f, 1); in hpfs_truncate_btree()
426 hpfs_error(s, "internal btree %08x doesn't end with -1", node); in hpfs_truncate_btree()
430 hpfs_ea_remove(s, btree->u.internal[j].down, 1, 0); in hpfs_truncate_btree()
441 if (hpfs_sb(s)->sb_chk) in hpfs_truncate_btree()
442 if (hpfs_stop_cycles(s, node, &c1, &c2, "hpfs_truncate_btree")) in hpfs_truncate_btree()
444 if (!(anode = hpfs_map_anode(s, node, &bh))) return; in hpfs_truncate_btree()
454 hpfs_error(s, "there is an allocation error in file %08x, sector %08x", f, secs); in hpfs_truncate_btree()
458 hpfs_free_sectors(s, btree->u.external[i].disk_secno + secs - in hpfs_truncate_btree()
464 hpfs_free_sectors(s, btree->u.external[j].disk_secno, btree->u.external[j].length); in hpfs_truncate_btree()
475 void hpfs_remove_fnode(struct super_block *s, fnode_secno fno) in hpfs_remove_fnode() argument
481 if (!(fnode = hpfs_map_fnode(s, fno, &bh))) return; in hpfs_remove_fnode()
482 if (!fnode->dirflag) hpfs_remove_btree(s, &fnode->btree); in hpfs_remove_fnode()
483 else hpfs_remove_dtree(s, fnode->u.external[0].disk_secno); in hpfs_remove_fnode()
487 hpfs_ea_remove(s, ea_sec(ea), ea->anode, ea_len(ea)); in hpfs_remove_fnode()
488 hpfs_ea_ext_remove(s, fnode->ea_secno, fnode->ea_anode, fnode->ea_size_l); in hpfs_remove_fnode()
490 hpfs_free_sectors(s, fno, 1); in hpfs_remove_fnode()