Lines Matching full:ep
79 struct entry *ep; in lookupino() local
83 for (ep = entry[inum % entrytblsize]; ep != NULL; ep = ep->e_next) in lookupino()
84 if (ep->e_ino == inum) in lookupino()
85 return (ep); in lookupino()
138 struct entry *ep; in lookupname() local
143 for (ep = lookupino(UFS_ROOTINO); ep != NULL; ep = ep->e_entries) { in lookupname()
150 for ( ; ep != NULL; ep = ep->e_sibling) in lookupname()
151 if (strcmp(ep->e_name, buf) == 0) in lookupname()
153 if (ep == NULL) in lookupname()
156 return (ep); in lookupname()
167 struct entry *ep; in lookupparent() local
174 ep = lookupname(name); in lookupparent()
176 if (ep == NULL) in lookupparent()
178 if (ep->e_type != NODE) in lookupparent()
180 return (ep); in lookupparent()
187 myname(struct entry *ep) in myname() argument
192 for (cp = &namebuf[MAXPATHLEN - 2]; cp > &namebuf[ep->e_namlen]; ) { in myname()
193 cp -= ep->e_namlen; in myname()
194 memmove(cp, ep->e_name, (long)ep->e_namlen); in myname()
195 if (ep == lookupino(UFS_ROOTINO)) in myname()
198 ep = ep->e_parent; in myname()
216 struct entry *np, *ep; in addentry() local
228 ep = lookupparent(name); in addentry()
229 if (ep == NULL) { in addentry()
240 np->e_parent = ep; in addentry()
241 np->e_sibling = ep->e_entries; in addentry()
242 ep->e_entries = np; in addentry()
244 ep = lookupino(inum); in addentry()
245 if (ep == NULL) in addentry()
248 np->e_links = ep->e_links; in addentry()
249 ep->e_links = np; in addentry()
262 freeentry(struct entry *ep) in freeentry() argument
267 if (ep->e_flags != REMOVED) in freeentry()
268 badentry(ep, "not marked REMOVED"); in freeentry()
269 if (ep->e_type == NODE) { in freeentry()
270 if (ep->e_links != NULL) in freeentry()
271 badentry(ep, "freeing referenced directory"); in freeentry()
272 if (ep->e_entries != NULL) in freeentry()
273 badentry(ep, "freeing non-empty directory"); in freeentry()
275 if (ep->e_ino != 0) { in freeentry()
276 np = lookupino(ep->e_ino); in freeentry()
278 badentry(ep, "lookupino failed"); in freeentry()
279 if (np == ep) { in freeentry()
280 inum = ep->e_ino; in freeentry()
282 if (ep->e_links != NULL) in freeentry()
283 addino(inum, ep->e_links); in freeentry()
286 if (np->e_links == ep) { in freeentry()
287 np->e_links = ep->e_links; in freeentry()
292 badentry(ep, "link not found"); in freeentry()
295 removeentry(ep); in freeentry()
296 freename(ep->e_name); in freeentry()
297 ep->e_next = freelist; in freeentry()
298 freelist = ep; in freeentry()
305 moveentry(struct entry *ep, char *newname) in moveentry() argument
312 badentry(ep, "cannot move ROOT"); in moveentry()
313 if (np != ep->e_parent) { in moveentry()
314 removeentry(ep); in moveentry()
315 ep->e_parent = np; in moveentry()
316 ep->e_sibling = np->e_entries; in moveentry()
317 np->e_entries = ep; in moveentry()
320 freename(ep->e_name); in moveentry()
321 ep->e_name = savename(cp); in moveentry()
322 ep->e_namlen = strlen(cp); in moveentry()
323 if (strcmp(gentempname(ep), ep->e_name) == 0) in moveentry()
324 ep->e_flags |= TMPNAME; in moveentry()
326 ep->e_flags &= ~TMPNAME; in moveentry()
333 removeentry(struct entry *ep) in removeentry() argument
337 np = ep->e_parent; in removeentry()
338 if (np->e_entries == ep) { in removeentry()
339 np->e_entries = ep->e_sibling; in removeentry()
342 if (np->e_sibling == ep) { in removeentry()
343 np->e_sibling = ep->e_sibling; in removeentry()
348 badentry(ep, "cannot find entry in parent list"); in removeentry()
434 struct entry *ep, *tep; in dumpsymtable() local
456 for (ep = lookupino(i); ep != NULL; ep = ep->e_links) { in dumpsymtable()
457 ep->e_index = mynum++; in dumpsymtable()
458 (void) fwrite(ep->e_name, sizeof(char), in dumpsymtable()
459 (int)allocsize(ep->e_namlen), fd); in dumpsymtable()
468 for (ep = lookupino(i); ep != NULL; ep = ep->e_links) { in dumpsymtable()
469 memmove(tep, ep, (long)sizeof(struct entry)); in dumpsymtable()
471 stroff += allocsize(ep->e_namlen); in dumpsymtable()
472 tep->e_parent = (struct entry *)ep->e_parent->e_index; in dumpsymtable()
473 if (ep->e_links != NULL) in dumpsymtable()
475 (struct entry *)ep->e_links->e_index; in dumpsymtable()
476 if (ep->e_sibling != NULL) in dumpsymtable()
478 (struct entry *)ep->e_sibling->e_index; in dumpsymtable()
479 if (ep->e_entries != NULL) in dumpsymtable()
481 (struct entry *)ep->e_entries->e_index; in dumpsymtable()
482 if (ep->e_next != NULL) in dumpsymtable()
484 (struct entry *)ep->e_next->e_index; in dumpsymtable()
522 struct entry *ep; in initsymtable() local
535 ep = addentry(".", UFS_ROOTINO, NODE); in initsymtable()
536 ep->e_flags |= NEW; in initsymtable()
597 for (ep = &baseep[1]; ep < lep; ep++) { in initsymtable()
598 ep->e_name = base + (long)ep->e_name; in initsymtable()
599 ep->e_parent = &baseep[(long)ep->e_parent]; in initsymtable()
600 if (ep->e_sibling != NULL) in initsymtable()
601 ep->e_sibling = &baseep[(long)ep->e_sibling]; in initsymtable()
602 if (ep->e_links != NULL) in initsymtable()
603 ep->e_links = &baseep[(long)ep->e_links]; in initsymtable()
604 if (ep->e_entries != NULL) in initsymtable()
605 ep->e_entries = &baseep[(long)ep->e_entries]; in initsymtable()
606 if (ep->e_next != NULL) in initsymtable()
607 ep->e_next = &baseep[(long)ep->e_next]; in initsymtable()