Lines Matching refs:dno
215 dnode_secno dno = le32_to_cpu(d->self); in fix_up_ptrs() local
221 if (le32_to_cpu(dd->up) != dno || dd->root_dnode) { in fix_up_ptrs()
222 dd->up = cpu_to_le32(dno); in fix_up_ptrs()
233 static int hpfs_add_to_dnode(struct inode *i, dnode_secno dno, in hpfs_add_to_dnode() argument
259 if (!(d = hpfs_map_dnode(i->i_sb, dno, &qbh))) { in hpfs_add_to_dnode()
266 if (hpfs_stop_cycles(i->i_sb, dno, &c1, &c2, "hpfs_add_to_dnode")) { in hpfs_add_to_dnode()
312 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | pos, ((loff_t)adno << 4) | pos); in hpfs_add_to_dnode()
319 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | pos, 4); in hpfs_add_to_dnode()
326 for_all_poss(i, hpfs_pos_del, (loff_t)dno << 4, pos); in hpfs_add_to_dnode()
330 dno = le32_to_cpu(ad->up); in hpfs_add_to_dnode()
369 set_last_pointer(i->i_sb, rd, dno); in hpfs_add_to_dnode()
370 dno = rdno; in hpfs_add_to_dnode()
391 dnode_secno dno; in hpfs_add_dirent() local
394 dno = hpfs_inode->i_dno; in hpfs_add_dirent()
397 if (hpfs_stop_cycles(i->i_sb, dno, &c1, &c2, "hpfs_add_dirent")) return 1; in hpfs_add_dirent()
398 if (!(d = hpfs_map_dnode(i->i_sb, dno, &qbh))) return 1; in hpfs_add_dirent()
407 dno = de_down_pointer(de); in hpfs_add_dirent()
420 c = hpfs_add_to_dnode(i, dno, name, namelen, new_de, 0); in hpfs_add_dirent()
432 dnode_secno dno, ddno; in move_to_top() local
440 dno = from; in move_to_top()
443 if (hpfs_stop_cycles(i->i_sb, dno, &c1, &c2, "move_to_top")) in move_to_top()
445 if (!(dnode = hpfs_map_dnode(i->i_sb, dno, &qbh))) return 0; in move_to_top()
449 dno, chk_up, le32_to_cpu(dnode->up)); in move_to_top()
453 chk_up = dno; in move_to_top()
456 hpfs_error(i->i_sb, "move_to_top: dnode %08x has no last de", dno); in move_to_top()
461 dno = de_down_pointer(de); in move_to_top()
467 hpfs_free_dnode(i->i_sb, dno); in move_to_top()
470 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | 1, 5); in move_to_top()
480 hpfs_error(i->i_sb, "move_to_top: dnode %08x doesn't point down to %08x", up, dno); in move_to_top()
488 dno = up; in move_to_top()
507 return dno; in move_to_top()
515 static void delete_empty_dnode(struct inode *i, dnode_secno dno) in delete_empty_dnode() argument
525 if (hpfs_stop_cycles(i->i_sb, dno, &c1, &c2, "delete_empty_dnode")) return; in delete_empty_dnode()
526 if (!(dnode = hpfs_map_dnode(i->i_sb, dno, &qbh))) return; in delete_empty_dnode()
535 hpfs_error(i->i_sb, "delete_empty_dnode: root dnode %08x is empty", dno); in delete_empty_dnode()
539 hpfs_free_dnode(i->i_sb, dno); in delete_empty_dnode()
551 dno, up, in delete_empty_dnode()
567 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | 1, (loff_t) 12); in delete_empty_dnode()
574 if (de->down) if (de_down_pointer(de) == dno) goto fnd; in delete_empty_dnode()
575 hpfs_error(i->i_sb, "delete_empty_dnode: pointer to dnode %08x not found in dnode %08x", dno, up); in delete_empty_dnode()
578 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | 1, ((loff_t)up << 4) | p); in delete_empty_dnode()
596 …hpfs_error(i->i_sb, "delete_empty_dnode: dnode %08x, first_free == %03x", dno, le32_to_cpu(dnode->… in delete_empty_dnode()
625 dno = up; in delete_empty_dnode()
638 dno = up; in delete_empty_dnode()
695 dno = up; in delete_empty_dnode()
708 int hpfs_remove_dirent(struct inode *i, dnode_secno dno, struct hpfs_dirent *de, in hpfs_remove_dirent() argument
715 …fs_error(i->i_sb, "hpfs_remove_dirent: attempt to delete first or last dirent in dnode %08x", dno); in hpfs_remove_dirent()
732 dnode_secno a = move_to_top(i, down, dno); in hpfs_remove_dirent()
737 delete_empty_dnode(i, dno); in hpfs_remove_dirent()
741 void hpfs_count_dnodes(struct super_block *s, dnode_secno dno, int *n_dnodes, in hpfs_count_dnodes() argument
753 if (hpfs_stop_cycles(s, dno, &c1, &c2, "hpfs_count_dnodes #1")) return; in hpfs_count_dnodes()
756 if (!(dnode = hpfs_map_dnode(s, dno, &qbh))) return; in hpfs_count_dnodes()
758 …count_dnodes: bad up pointer; dnode %08x, down %08x points to %08x", odno, dno, le32_to_cpu(dnode-… in hpfs_count_dnodes()
765 ptr, dno, odno); in hpfs_count_dnodes()
772 odno = dno; in hpfs_count_dnodes()
773 dno = de_down_pointer(de); in hpfs_count_dnodes()
781 ptr = dno; in hpfs_count_dnodes()
782 dno = le32_to_cpu(dnode->up); in hpfs_count_dnodes()
794 static struct hpfs_dirent *map_nth_dirent(struct super_block *s, dnode_secno dno, int n, in map_nth_dirent() argument
800 dnode = hpfs_map_dnode(s, dno, qbh); in map_nth_dirent()
812 hpfs_error(s, "map_nth_dirent: n too high; dnode = %08x, requested %08x", dno, n); in map_nth_dirent()
816 dnode_secno hpfs_de_as_down_as_possible(struct super_block *s, dnode_secno dno) in hpfs_de_as_down_as_possible() argument
819 dnode_secno d = dno; in hpfs_de_as_down_as_possible()
828 if (!(de = map_nth_dirent(s, d, 1, &qbh, NULL))) return dno; in hpfs_de_as_down_as_possible()
847 dnode_secno dno; in map_pos_dirent() local
856 dno = pos >> 6 << 2; in map_pos_dirent()
858 if (!(de = map_nth_dirent(inode->i_sb, dno, pos, qbh, &dnode))) in map_pos_dirent()
889 if (up_de->down && de_down_pointer(up_de) == dno) { in map_pos_dirent()
897 dno, le32_to_cpu(dnode->up)); in map_pos_dirent()
907 struct hpfs_dirent *map_dirent(struct inode *inode, dnode_secno dno, in map_dirent() argument
919 if (hpfs_stop_cycles(inode->i_sb, dno, &c1, &c2, "map_dirent")) return NULL; in map_dirent()
920 if (!(dnode = hpfs_map_dnode(inode->i_sb, dno, qbh))) return NULL; in map_dirent()
926 if (dd) *dd = dno; in map_dirent()
931 dno = de_down_pointer(de); in map_dirent()
948 void hpfs_remove_dtree(struct super_block *s, dnode_secno dno) in hpfs_remove_dtree() argument
953 dnode_secno d1, d2, rdno = dno; in hpfs_remove_dtree()
955 if (!(dnode = hpfs_map_dnode(s, dno, &qbh))) return; in hpfs_remove_dtree()
961 hpfs_free_dnode(s, dno); in hpfs_remove_dtree()
962 dno = d1; in hpfs_remove_dtree()
971 hpfs_free_dnode(s, dno); in hpfs_remove_dtree()
974 if (!(dnode = hpfs_map_dnode(s, dno = d1, &qbh))) return; in hpfs_remove_dtree()
979 hpfs_free_dnode(s, dno); in hpfs_remove_dtree()
987 hpfs_free_dnode(s, dno); in hpfs_remove_dtree()
1003 dnode_secno dno, downd; in map_fnode_dirent() local
1033 dno = le32_to_cpu(upf->u.external[0].disk_secno); in map_fnode_dirent()
1038 if (!(d = hpfs_map_dnode(s, dno, qbh))) { in map_fnode_dirent()
1049 hpfs_error(s, "pointer to dnode %08x not found in dnode %08x", downd, dno); in map_fnode_dirent()
1061 dno = de_down_pointer(de); in map_fnode_dirent()
1064 if (hpfs_stop_cycles(s, dno, &c1, &c2, "map_fnode_dirent #1")) { in map_fnode_dirent()
1079 downd = dno; in map_fnode_dirent()
1080 dno = le32_to_cpu(d->up); in map_fnode_dirent()