Lines Matching refs:de
14 struct hpfs_dirent *de; in get_pos() local
17 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) { in get_pos()
18 if (de == fde) return ((loff_t) le32_to_cpu(d->self) << 4) | (loff_t)i; in get_pos()
122 struct hpfs_dirent *de, *de_end, *dee = NULL, *deee = NULL; in dnode_pre_last_de() local
124 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) { in dnode_pre_last_de()
125 deee = dee; dee = de; in dnode_pre_last_de()
132 struct hpfs_dirent *de, *de_end, *dee = NULL; in dnode_last_de() local
134 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) { in dnode_last_de()
135 dee = de; in dnode_last_de()
142 struct hpfs_dirent *de; in set_last_pointer() local
143 if (!(de = dnode_last_de(d))) { in set_last_pointer()
148 if (de->down) { in set_last_pointer()
150 le32_to_cpu(d->self), de_down_pointer(de)); in set_last_pointer()
153 if (le16_to_cpu(de->length) != 32) { in set_last_pointer()
165 de->length = cpu_to_le16(36); in set_last_pointer()
166 de->down = 1; in set_last_pointer()
167 *(__le32 *)((char *)de + 32) = cpu_to_le32(ptr); in set_last_pointer()
177 struct hpfs_dirent *de; in hpfs_add_de() local
180 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) { in hpfs_add_de()
181 int c = hpfs_compare_names(s, name, namelen, de->name, de->namelen, de->last); in hpfs_add_de()
188 memmove((char *)de + d_size, de, (char *)de_end - (char *)de); in hpfs_add_de()
189 memset(de, 0, d_size); in hpfs_add_de()
191 *(__le32 *)((char *)de + d_size - 4) = cpu_to_le32(down_ptr); in hpfs_add_de()
192 de->down = 1; in hpfs_add_de()
194 de->length = cpu_to_le16(d_size); in hpfs_add_de()
195 de->not_8x3 = hpfs_is_name_long(name, namelen); in hpfs_add_de()
196 de->namelen = namelen; in hpfs_add_de()
197 memcpy(de->name, name, namelen); in hpfs_add_de()
199 return de; in hpfs_add_de()
205 struct hpfs_dirent *de) in hpfs_delete_de() argument
207 if (de->last) { in hpfs_delete_de()
211 d->first_free = cpu_to_le32(le32_to_cpu(d->first_free) - le16_to_cpu(de->length)); in hpfs_delete_de()
212 memmove(de, de_next_de(de), le32_to_cpu(d->first_free) + (char *)d - (char *)de); in hpfs_delete_de()
217 struct hpfs_dirent *de; in fix_up_ptrs() local
220 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) in fix_up_ptrs()
221 if (de->down) { in fix_up_ptrs()
224 if ((dd = hpfs_map_dnode(s, de_down_pointer(de), &qbh))) { in fix_up_ptrs()
244 struct hpfs_dirent *de; in hpfs_add_to_dnode() local
278 copy_de(de=hpfs_add_de(i->i_sb, d, name, namelen, down_ptr), new_de); in hpfs_add_to_dnode()
279 t = get_pos(d, de); in hpfs_add_to_dnode()
301 copy_de(de = hpfs_add_de(i->i_sb, nd, name, namelen, down_ptr), new_de); in hpfs_add_to_dnode()
302 for_all_poss(i, hpfs_pos_ins, get_pos(nd, de), 1); in hpfs_add_to_dnode()
314 for (de = dnode_first_de(nd); (char *)de_next_de(de) - (char *)nd < h; de = de_next_de(de)) { in hpfs_add_to_dnode()
315 copy_de(hpfs_add_de(i->i_sb, ad, de->name, de->namelen, de->down ? de_down_pointer(de) : 0), de); in hpfs_add_to_dnode()
319 copy_de(new_de = &nde, de); in hpfs_add_to_dnode()
320 memcpy(nname, de->name, de->namelen); in hpfs_add_to_dnode()
322 namelen = de->namelen; in hpfs_add_to_dnode()
325 set_last_pointer(i->i_sb, ad, de->down ? de_down_pointer(de) : 0); in hpfs_add_to_dnode()
326 de = de_next_de(de); in hpfs_add_to_dnode()
327 memmove((char *)nd + 20, de, le32_to_cpu(nd->first_free) + (char *)nd - (char *)de); in hpfs_add_to_dnode()
328 le32_add_cpu(&nd->first_free, -((char *)de - (char *)nd - 20)); in hpfs_add_to_dnode()
393 struct hpfs_dirent *de, *de_end; in hpfs_add_dirent() local
404 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) { in hpfs_add_dirent()
405 if (!(c = hpfs_compare_names(i->i_sb, name, namelen, de->name, de->namelen, de->last))) { in hpfs_add_dirent()
410 if (de->down) { in hpfs_add_dirent()
411 dno = de_down_pointer(de); in hpfs_add_dirent()
439 struct hpfs_dirent *de, *nde; in move_to_top() local
458 if (!(de = dnode_last_de(dnode))) { in move_to_top()
463 if (!de->down) break; in move_to_top()
464 dno = de_down_pointer(de); in move_to_top()
467 while (!(de = dnode_pre_last_de(dnode))) { in move_to_top()
481 de = dnode_last_de(dnode); in move_to_top()
482 if (!de || !de->down) { in move_to_top()
488 le16_add_cpu(&de->length, -4); in move_to_top()
489 de->down = 0; in move_to_top()
493 t = get_pos(dnode, de); in move_to_top()
496 if (!(nde = kmalloc(le16_to_cpu(de->length), GFP_NOFS))) { in move_to_top()
501 memcpy(nde, de, le16_to_cpu(de->length)); in move_to_top()
502 ddno = de->down ? de_down_pointer(de) : 0; in move_to_top()
503 hpfs_delete_de(i->i_sb, dnode, de); in move_to_top()
525 struct hpfs_dirent *de; in delete_empty_dnode() local
535 de = dnode_first_de(dnode); in delete_empty_dnode()
536 down = de->down ? de_down_pointer(de) : 0; in delete_empty_dnode()
576 for (de = dnode_first_de(dnode); de < de_end; de = de_next_de(de), p++) in delete_empty_dnode()
577 if (de->down) if (de_down_pointer(de) == dno) goto fnd; in delete_empty_dnode()
583 de->down = 0; in delete_empty_dnode()
584 le16_add_cpu(&de->length, -4); in delete_empty_dnode()
586 memmove(de_next_de(de), (char *)de_next_de(de) + 4, in delete_empty_dnode()
587 (char *)dnode + le32_to_cpu(dnode->first_free) - (char *)de_next_de(de)); in delete_empty_dnode()
591 *(dnode_secno *) ((void *) de + le16_to_cpu(de->length) - 4) = down; in delete_empty_dnode()
603 if (!de->last) { in delete_empty_dnode()
604 struct hpfs_dirent *de_next = de_next_de(de); in delete_empty_dnode()
610 if (!(de_cp = kmalloc(le16_to_cpu(de->length), GFP_NOFS))) { in delete_empty_dnode()
614 memcpy(de_cp, de, le16_to_cpu(de->length)); in delete_empty_dnode()
615 hpfs_delete_de(i->i_sb, dnode, de); in delete_empty_dnode()
692 if (down) if ((d1 = hpfs_map_dnode(i->i_sb, de_down_pointer(de), &qbh1))) { in delete_empty_dnode()
711 int hpfs_remove_dirent(struct inode *i, dnode_secno dno, struct hpfs_dirent *de, in hpfs_remove_dirent() argument
717 if (de->first || de->last) { in hpfs_remove_dirent()
722 if (de->down) down = de_down_pointer(de); in hpfs_remove_dirent()
723 if (depth && (de->down || (de == dnode_first_de(dnode) && de_next_de(de)->last))) { in hpfs_remove_dirent()
729 for_all_poss(i, hpfs_pos_del, (t = get_pos(dnode, de)) + 1, 1); in hpfs_remove_dirent()
730 hpfs_delete_de(i->i_sb, dnode, de); in hpfs_remove_dirent()
748 struct hpfs_dirent *de; in hpfs_count_dnodes() local
761 de = dnode_first_de(dnode); in hpfs_count_dnodes()
763 if (de->down) if (de_down_pointer(de) == ptr) goto process_de; in hpfs_count_dnodes()
764 if (de->last) { in hpfs_count_dnodes()
770 de = de_next_de(de); in hpfs_count_dnodes()
773 if (de->down) { in hpfs_count_dnodes()
775 dno = de_down_pointer(de); in hpfs_count_dnodes()
780 if (!de->first && !de->last && de->directory && n_subdirs) (*n_subdirs)++; in hpfs_count_dnodes()
781 if (!de->first && !de->last && n_items) (*n_items)++; in hpfs_count_dnodes()
782 if ((de = de_next_de(de)) < dnode_end_de(dnode)) goto next_de; in hpfs_count_dnodes()
800 struct hpfs_dirent *de, *de_end; in map_nth_dirent() local
805 de = dnode_first_de(dnode); in map_nth_dirent()
807 for (i = 1; de < de_end; i++, de = de_next_de(de)) { in map_nth_dirent()
809 return de; in map_nth_dirent()
811 if (de->last) break; in map_nth_dirent()
823 struct hpfs_dirent *de; in hpfs_de_as_down_as_possible() local
830 if (!(de = map_nth_dirent(s, d, 1, &qbh, NULL))) return dno; in hpfs_de_as_down_as_possible()
834 if (!de->down) { in hpfs_de_as_down_as_possible()
839 d = de_down_pointer(de); in hpfs_de_as_down_as_possible()
850 struct hpfs_dirent *de, *d; in map_pos_dirent() local
860 if (!(de = map_nth_dirent(inode->i_sb, dno, pos, qbh, &dnode))) in map_pos_dirent()
864 if ((d = de_next_de(de)) < dnode_end_de(dnode)) { in map_pos_dirent()
876 return de; in map_pos_dirent()
894 return de; in map_pos_dirent()
904 return de; in map_pos_dirent()
914 struct hpfs_dirent *de; in map_dirent() local
925 for (de = dnode_first_de(dnode); de < de_end; de = de_next_de(de)) { in map_dirent()
926 int t = hpfs_compare_names(inode->i_sb, name, len, de->name, de->namelen, de->last); in map_dirent()
929 return de; in map_dirent()
932 if (de->down) { in map_dirent()
933 dno = de_down_pointer(de); in map_dirent()
954 struct hpfs_dirent *de; in hpfs_remove_dtree() local
958 de = dnode_first_de(dnode); in hpfs_remove_dtree()
959 if (de->last) { in hpfs_remove_dtree()
960 if (de->down) d1 = de_down_pointer(de); in hpfs_remove_dtree()
967 if (!de->first) goto error; in hpfs_remove_dtree()
968 d1 = de->down ? de_down_pointer(de) : 0; in hpfs_remove_dtree()
969 de = de_next_de(de); in hpfs_remove_dtree()
970 if (!de->last) goto error; in hpfs_remove_dtree()
971 d2 = de->down ? de_down_pointer(de) : 0; in hpfs_remove_dtree()
977 de = dnode_first_de(dnode); in hpfs_remove_dtree()
978 if (!de->last) goto error; in hpfs_remove_dtree()
979 d1 = de->down ? de_down_pointer(de) : 0; in hpfs_remove_dtree()
1008 struct hpfs_dirent *de, *de_end; in map_fnode_dirent() local
1045 de = dnode_first_de(d); in map_fnode_dirent()
1047 while (de < de_end) { in map_fnode_dirent()
1048 if (de->down) if (de_down_pointer(de) == downd) goto f; in map_fnode_dirent()
1049 de = de_next_de(de); in map_fnode_dirent()
1057 if (le32_to_cpu(de->fnode) == fno) { in map_fnode_dirent()
1059 return de; in map_fnode_dirent()
1061 c = hpfs_compare_names(s, name1, name1len, de->name, de->namelen, de->last); in map_fnode_dirent()
1062 if (c < 0 && de->down) { in map_fnode_dirent()
1063 dno = de_down_pointer(de); in map_fnode_dirent()
1073 if (le32_to_cpu(de->fnode) == fno) { in map_fnode_dirent()
1075 return de; in map_fnode_dirent()
1077 c = hpfs_compare_names(s, name2, name2len, de->name, de->namelen, de->last); in map_fnode_dirent()
1078 if (c < 0 && !de->last) goto not_found; in map_fnode_dirent()
1079 if ((de = de_next_de(de)) < de_end) goto next_de; in map_fnode_dirent()