Lines Matching refs:dno
219 dnode_secno dno = le32_to_cpu(d->self); in fix_up_ptrs() local
225 if (le32_to_cpu(dd->up) != dno || dd->root_dnode) { in fix_up_ptrs()
226 dd->up = cpu_to_le32(dno); in fix_up_ptrs()
237 static int hpfs_add_to_dnode(struct inode *i, dnode_secno dno, in hpfs_add_to_dnode() argument
263 if (!(d = hpfs_map_dnode(i->i_sb, dno, &qbh))) { in hpfs_add_to_dnode()
270 if (hpfs_stop_cycles(i->i_sb, dno, &c1, &c2, "hpfs_add_to_dnode")) { in hpfs_add_to_dnode()
316 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | pos, ((loff_t)adno << 4) | pos); in hpfs_add_to_dnode()
323 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | pos, 4); in hpfs_add_to_dnode()
330 for_all_poss(i, hpfs_pos_del, (loff_t)dno << 4, pos); in hpfs_add_to_dnode()
334 dno = le32_to_cpu(ad->up); in hpfs_add_to_dnode()
373 set_last_pointer(i->i_sb, rd, dno); in hpfs_add_to_dnode()
374 dno = rdno; in hpfs_add_to_dnode()
395 dnode_secno dno; in hpfs_add_dirent() local
398 dno = hpfs_inode->i_dno; in hpfs_add_dirent()
401 if (hpfs_stop_cycles(i->i_sb, dno, &c1, &c2, "hpfs_add_dirent")) return 1; in hpfs_add_dirent()
402 if (!(d = hpfs_map_dnode(i->i_sb, dno, &qbh))) return 1; in hpfs_add_dirent()
411 dno = de_down_pointer(de); in hpfs_add_dirent()
423 c = hpfs_add_to_dnode(i, dno, name, namelen, new_de, 0); in hpfs_add_dirent()
435 dnode_secno dno, ddno; in move_to_top() local
443 dno = from; in move_to_top()
446 if (hpfs_stop_cycles(i->i_sb, dno, &c1, &c2, "move_to_top")) in move_to_top()
448 if (!(dnode = hpfs_map_dnode(i->i_sb, dno, &qbh))) return 0; in move_to_top()
452 dno, chk_up, le32_to_cpu(dnode->up)); in move_to_top()
456 chk_up = dno; in move_to_top()
459 hpfs_error(i->i_sb, "move_to_top: dnode %08x has no last de", dno); in move_to_top()
464 dno = de_down_pointer(de); in move_to_top()
470 hpfs_free_dnode(i->i_sb, dno); in move_to_top()
473 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | 1, 5); in move_to_top()
483 hpfs_error(i->i_sb, "move_to_top: dnode %08x doesn't point down to %08x", up, dno); in move_to_top()
491 dno = up; in move_to_top()
510 return dno; in move_to_top()
518 static void delete_empty_dnode(struct inode *i, dnode_secno dno) in delete_empty_dnode() argument
528 if (hpfs_stop_cycles(i->i_sb, dno, &c1, &c2, "delete_empty_dnode")) return; in delete_empty_dnode()
529 if (!(dnode = hpfs_map_dnode(i->i_sb, dno, &qbh))) return; in delete_empty_dnode()
538 hpfs_error(i->i_sb, "delete_empty_dnode: root dnode %08x is empty", dno); in delete_empty_dnode()
542 hpfs_free_dnode(i->i_sb, dno); in delete_empty_dnode()
554 dno, up, in delete_empty_dnode()
570 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | 1, (loff_t) 12); in delete_empty_dnode()
577 if (de->down) if (de_down_pointer(de) == dno) goto fnd; in delete_empty_dnode()
578 hpfs_error(i->i_sb, "delete_empty_dnode: pointer to dnode %08x not found in dnode %08x", dno, up); in delete_empty_dnode()
581 for_all_poss(i, hpfs_pos_subst, ((loff_t)dno << 4) | 1, ((loff_t)up << 4) | p); in delete_empty_dnode()
599 …hpfs_error(i->i_sb, "delete_empty_dnode: dnode %08x, first_free == %03x", dno, le32_to_cpu(dnode->… in delete_empty_dnode()
628 dno = up; in delete_empty_dnode()
641 dno = up; in delete_empty_dnode()
698 dno = up; in delete_empty_dnode()
711 int hpfs_remove_dirent(struct inode *i, dnode_secno dno, struct hpfs_dirent *de, in hpfs_remove_dirent() argument
718 …fs_error(i->i_sb, "hpfs_remove_dirent: attempt to delete first or last dirent in dnode %08x", dno); in hpfs_remove_dirent()
734 dnode_secno a = move_to_top(i, down, dno); in hpfs_remove_dirent()
739 delete_empty_dnode(i, dno); in hpfs_remove_dirent()
743 void hpfs_count_dnodes(struct super_block *s, dnode_secno dno, int *n_dnodes, in hpfs_count_dnodes() argument
755 if (hpfs_stop_cycles(s, dno, &c1, &c2, "hpfs_count_dnodes #1")) return; in hpfs_count_dnodes()
758 if (!(dnode = hpfs_map_dnode(s, dno, &qbh))) return; in hpfs_count_dnodes()
760 …count_dnodes: bad up pointer; dnode %08x, down %08x points to %08x", odno, dno, le32_to_cpu(dnode-… in hpfs_count_dnodes()
767 ptr, dno, odno); in hpfs_count_dnodes()
774 odno = dno; in hpfs_count_dnodes()
775 dno = de_down_pointer(de); in hpfs_count_dnodes()
783 ptr = dno; in hpfs_count_dnodes()
784 dno = le32_to_cpu(dnode->up); in hpfs_count_dnodes()
796 static struct hpfs_dirent *map_nth_dirent(struct super_block *s, dnode_secno dno, int n, in map_nth_dirent() argument
802 dnode = hpfs_map_dnode(s, dno, qbh); in map_nth_dirent()
814 hpfs_error(s, "map_nth_dirent: n too high; dnode = %08x, requested %08x", dno, n); in map_nth_dirent()
818 dnode_secno hpfs_de_as_down_as_possible(struct super_block *s, dnode_secno dno) in hpfs_de_as_down_as_possible() argument
821 dnode_secno d = dno; in hpfs_de_as_down_as_possible()
830 if (!(de = map_nth_dirent(s, d, 1, &qbh, NULL))) return dno; in hpfs_de_as_down_as_possible()
849 dnode_secno dno; in map_pos_dirent() local
858 dno = pos >> 6 << 2; in map_pos_dirent()
860 if (!(de = map_nth_dirent(inode->i_sb, dno, pos, qbh, &dnode))) in map_pos_dirent()
891 if (up_de->down && de_down_pointer(up_de) == dno) { in map_pos_dirent()
899 dno, le32_to_cpu(dnode->up)); in map_pos_dirent()
909 struct hpfs_dirent *map_dirent(struct inode *inode, dnode_secno dno, in map_dirent() argument
921 if (hpfs_stop_cycles(inode->i_sb, dno, &c1, &c2, "map_dirent")) return NULL; in map_dirent()
922 if (!(dnode = hpfs_map_dnode(inode->i_sb, dno, qbh))) return NULL; in map_dirent()
928 if (dd) *dd = dno; in map_dirent()
933 dno = de_down_pointer(de); in map_dirent()
950 void hpfs_remove_dtree(struct super_block *s, dnode_secno dno) in hpfs_remove_dtree() argument
955 dnode_secno d1, d2, rdno = dno; in hpfs_remove_dtree()
957 if (!(dnode = hpfs_map_dnode(s, dno, &qbh))) return; in hpfs_remove_dtree()
963 hpfs_free_dnode(s, dno); in hpfs_remove_dtree()
964 dno = d1; in hpfs_remove_dtree()
973 hpfs_free_dnode(s, dno); in hpfs_remove_dtree()
976 if (!(dnode = hpfs_map_dnode(s, dno = d1, &qbh))) return; in hpfs_remove_dtree()
981 hpfs_free_dnode(s, dno); in hpfs_remove_dtree()
989 hpfs_free_dnode(s, dno); in hpfs_remove_dtree()
1005 dnode_secno dno, downd; in map_fnode_dirent() local
1035 dno = le32_to_cpu(upf->u.external[0].disk_secno); in map_fnode_dirent()
1040 if (!(d = hpfs_map_dnode(s, dno, qbh))) { in map_fnode_dirent()
1051 hpfs_error(s, "pointer to dnode %08x not found in dnode %08x", downd, dno); in map_fnode_dirent()
1063 dno = de_down_pointer(de); in map_fnode_dirent()
1066 if (hpfs_stop_cycles(s, dno, &c1, &c2, "map_fnode_dirent #1")) { in map_fnode_dirent()
1081 downd = dno; in map_fnode_dirent()
1082 dno = le32_to_cpu(d->up); in map_fnode_dirent()