Lines Matching defs:idp

72 static int iso_uiodir(struct isoreaddir *idp, struct dirent *dp, off_t off);
73 static int iso_shipdir(struct isoreaddir *idp);
375 iso_uiodir(idp,dp,off)
376 struct isoreaddir *idp;
385 if (idp->uio->uio_resid < dp->d_reclen) {
386 idp->eofflag = 0;
390 if (idp->cookies) {
391 if (idp->ncookies <= 0) {
392 idp->eofflag = 0;
396 *idp->cookies++ = off;
397 --idp->ncookies;
400 if ((error = uiomove(dp, dp->d_reclen, idp->uio)) != 0)
402 idp->uio_off = off;
407 iso_shipdir(idp)
408 struct isoreaddir *idp;
415 cl = idp->current.d_namlen;
416 cname = idp->current.d_name;
423 dp = &idp->saveent;
426 dp = &idp->assocent;
433 if (idp->assocent.d_namlen) {
434 if ((error = iso_uiodir(idp,&idp->assocent,idp->assocoff)) != 0)
436 idp->assocent.d_namlen = 0;
438 if (idp->saveent.d_namlen) {
439 if ((error = iso_uiodir(idp,&idp->saveent,idp->saveoff)) != 0)
441 idp->saveent.d_namlen = 0;
445 idp->current.d_reclen = GENERIC_DIRSIZ(&idp->current);
447 idp->assocoff = idp->curroff;
448 bcopy(&idp->current,&idp->assocent,idp->current.d_reclen);
450 idp->saveoff = idp->curroff;
451 bcopy(&idp->current,&idp->saveent,idp->current.d_reclen);
471 struct isoreaddir *idp;
490 idp = malloc(sizeof(*idp), M_TEMP, M_WAITOK);
491 idp->saveent.d_namlen = idp->assocent.d_namlen = 0;
496 idp->saveent.d_type = idp->assocent.d_type = idp->current.d_type =
498 idp->uio = uio;
500 idp->cookies = NULL;
508 idp->cookies = cookies;
509 idp->ncookies = ncookies;
511 idp->eofflag = 1;
512 idp->curroff = uio->uio_offset;
513 idp->uio_off = uio->uio_offset;
515 if ((entryoffsetinblock = idp->curroff & bmask) &&
516 (error = cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))) {
517 free(idp, M_TEMP);
522 while (idp->curroff < endsearch) {
528 if ((idp->curroff & bmask) == 0) {
532 cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp)) != 0)
545 idp->curroff =
546 (idp->curroff & ~bmask) + imp->logical_block_size;
562 idp->current.d_namlen = isonum_711(ep->name_len);
564 if (reclen < ISO_DIRECTORY_RECORD_SIZE + idp->current.d_namlen) {
571 idp->current.d_fileno = isodirino(ep, imp);
573 idp->current.d_fileno = dbtob(bp->b_blkno) +
576 idp->curroff += reclen;
580 cd9660_rrip_getname(ep,idp->current.d_name, &namelen,
581 &idp->current.d_fileno,imp);
582 idp->current.d_namlen = (u_char)namelen;
583 if (idp->current.d_namlen)
584 error = iso_uiodir(idp,&idp->current,idp->curroff);
587 strcpy(idp->current.d_name,"..");
588 if (idp->current.d_namlen == 1 && ep->name[0] == 0) {
589 idp->current.d_namlen = 1;
590 error = iso_uiodir(idp,&idp->current,idp->curroff);
591 } else if (idp->current.d_namlen == 1 && ep->name[0] == 1) {
592 idp->current.d_namlen = 2;
593 error = iso_uiodir(idp,&idp->current,idp->curroff);
595 isofntrans(ep->name,idp->current.d_namlen,
596 idp->current.d_name, &namelen,
602 idp->current.d_namlen = (u_char)namelen;
604 error = iso_shipdir(idp);
606 error = iso_uiodir(idp,&idp->current,idp->curroff);
616 idp->current.d_namlen = 0;
617 error = iso_shipdir(idp);
629 *ap->a_ncookies = ncookies - idp->ncookies;
637 uio->uio_offset = idp->uio_off;
638 *ap->a_eofflag = idp->eofflag;
640 free(idp, M_TEMP);