Lines Matching refs:d
12 static loff_t get_pos(struct dnode *d, struct hpfs_dirent *fde) in get_pos() argument
15 struct hpfs_dirent *de_end = dnode_end_de(d); in get_pos()
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()
22 return ((loff_t)le32_to_cpu(d->self) << 4) | (loff_t)1; in get_pos()
96 static void hpfs_pos_ins(loff_t *p, loff_t d, loff_t c) in hpfs_pos_ins() argument
98 if ((*p & ~0x3f) == (d & ~0x3f) && (*p & 0x3f) >= (d & 0x3f)) { in hpfs_pos_ins()
108 static void hpfs_pos_del(loff_t *p, loff_t d, loff_t c) in hpfs_pos_del() argument
110 if ((*p & ~0x3f) == (d & ~0x3f) && (*p & 0x3f) >= (d & 0x3f)) { in hpfs_pos_del()
120 static struct hpfs_dirent *dnode_pre_last_de(struct dnode *d) in dnode_pre_last_de() argument
123 de_end = dnode_end_de(d); in dnode_pre_last_de()
124 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) { in dnode_pre_last_de()
130 static struct hpfs_dirent *dnode_last_de(struct dnode *d) in dnode_last_de() argument
133 de_end = dnode_end_de(d); in dnode_last_de()
134 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) { in dnode_last_de()
140 static void set_last_pointer(struct super_block *s, struct dnode *d, dnode_secno ptr) in set_last_pointer() argument
143 if (!(de = dnode_last_de(d))) { in set_last_pointer()
144 hpfs_error(s, "set_last_pointer: empty dnode %08x", le32_to_cpu(d->self)); in set_last_pointer()
150 le32_to_cpu(d->self), de_down_pointer(de)); in set_last_pointer()
154 hpfs_error(s, "set_last_pointer: bad last dirent in dnode %08x", le32_to_cpu(d->self)); in set_last_pointer()
159 le32_add_cpu(&d->first_free, 4); in set_last_pointer()
160 if (le32_to_cpu(d->first_free) > 2048) { in set_last_pointer()
161 hpfs_error(s, "set_last_pointer: too long dnode %08x", le32_to_cpu(d->self)); in set_last_pointer()
162 le32_add_cpu(&d->first_free, -4); in set_last_pointer()
173 struct hpfs_dirent *hpfs_add_de(struct super_block *s, struct dnode *d, in hpfs_add_de() argument
178 struct hpfs_dirent *de_end = dnode_end_de(d); in hpfs_add_de()
180 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) { in hpfs_add_de()
183 hpfs_error(s, "name (%c,%d) already exists in dnode %08x", *name, namelen, le32_to_cpu(d->self)); in hpfs_add_de()
198 le32_add_cpu(&d->first_free, d_size); in hpfs_add_de()
204 static void hpfs_delete_de(struct super_block *s, struct dnode *d, in hpfs_delete_de() argument
208 hpfs_error(s, "attempt to delete last dirent in dnode %08x", le32_to_cpu(d->self)); 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()
215 static void fix_up_ptrs(struct super_block *s, struct dnode *d) in fix_up_ptrs() argument
218 struct hpfs_dirent *de_end = dnode_end_de(d); in fix_up_ptrs()
219 dnode_secno dno = le32_to_cpu(d->self); in fix_up_ptrs()
220 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) in fix_up_ptrs()
242 struct dnode *d, *ad, *rd, *nd = NULL; in hpfs_add_to_dnode() local
263 if (!(d = hpfs_map_dnode(i->i_sb, dno, &qbh))) { in hpfs_add_to_dnode()
276 if (le32_to_cpu(d->first_free) + de_size(namelen, down_ptr) <= 2048) { in hpfs_add_to_dnode()
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()
300 memcpy(nd, d, le32_to_cpu(d->first_free)); in hpfs_add_to_dnode()
304 if (!(ad = hpfs_alloc_dnode(i->i_sb, le32_to_cpu(d->up), &adno, &qbh1))) { in hpfs_add_to_dnode()
329 memcpy(d, nd, le32_to_cpu(nd->first_free)); in hpfs_add_to_dnode()
332 if (!d->root_dnode) { in hpfs_add_to_dnode()
333 ad->up = d->up; in hpfs_add_to_dnode()
341 if (!(rd = hpfs_alloc_dnode(i->i_sb, le32_to_cpu(d->up), &rdno, &qbh2))) { in hpfs_add_to_dnode()
352 rd->up = d->up; in hpfs_add_to_dnode()
353 if (!(fnode = hpfs_map_fnode(i->i_sb, le32_to_cpu(d->up), &bh))) { in hpfs_add_to_dnode()
366 d->up = ad->up = cpu_to_le32(rdno); in hpfs_add_to_dnode()
367 d->root_dnode = ad->root_dnode = 0; in hpfs_add_to_dnode()
375 d = rd; in hpfs_add_to_dnode()
392 struct dnode *d; in hpfs_add_dirent() local
402 if (!(d = hpfs_map_dnode(i->i_sb, dno, &qbh))) return 1; in hpfs_add_dirent()
403 de_end = dnode_end_de(d); in hpfs_add_dirent()
404 for (de = dnode_first_de(d); de < de_end; de = de_next_de(de)) { in hpfs_add_dirent()
821 dnode_secno d = dno; in hpfs_de_as_down_as_possible() local
828 if (hpfs_stop_cycles(s, d, &c1, &c2, "hpfs_de_as_down_as_possible")) in hpfs_de_as_down_as_possible()
829 return d; 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()
833 …own_as_possible: bad up pointer; dnode %08x, down %08x points to %08x", up, d, le32_to_cpu(((struc… in hpfs_de_as_down_as_possible()
836 return d; in hpfs_de_as_down_as_possible()
838 up = d; 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
864 if ((d = de_next_de(de)) < dnode_end_de(dnode)) { in map_pos_dirent()
872 if (d->down) { in map_pos_dirent()
873 *posp = ((loff_t) hpfs_de_as_down_as_possible(inode->i_sb, de_down_pointer(d)) << 4) + 1; in map_pos_dirent()
1004 struct dnode *d; in map_fnode_dirent() local
1040 if (!(d = hpfs_map_dnode(s, dno, qbh))) { in map_fnode_dirent()
1044 de_end = dnode_end_de(d); in map_fnode_dirent()
1045 de = dnode_first_de(d); in map_fnode_dirent()
1080 if (d->root_dnode) goto not_found; in map_fnode_dirent()
1082 dno = le32_to_cpu(d->up); in map_fnode_dirent()