Lines Matching defs:idp
334 iso_uiodir(struct isoreaddir *idp, struct dirent *dp, off_t off)
341 if (uio_resid(idp->uio) < dp->d_reclen) {
342 idp->eofflag = 0;
347 if (idp->cookies) {
348 if (*idp->ncookies <= 0) {
349 idp->eofflag = 0;
353 **idp->cookies++ = off;
354 --*idp->ncookies;
358 if ( (error = uiomove( (caddr_t)dp, dp->d_reclen, idp->uio )) )
360 idp->uio_off = off;
365 iso_shipdir(struct isoreaddir *idp)
372 cl = idp->current.d_namlen;
373 cname = idp->current.d_name;
375 dp = &idp->saveent;
381 if (idp->saveent.d_namlen) {
382 if ( (error = iso_uiodir(idp,&idp->saveent,idp->saveoff)) )
384 idp->saveent.d_namlen = 0;
388 idp->current.d_reclen = DIRSIZ(&idp->current);
389 idp->saveoff = idp->curroff;
390 bcopy(&idp->current,&idp->saveent,idp->current.d_reclen);
409 struct isoreaddir *idp;
429 MALLOC(idp, struct isoreaddir *, sizeof(*idp), M_TEMP, M_WAITOK);
430 idp->saveent.d_namlen = 0;
435 idp->saveent.d_type = idp->current.d_type = DT_UNKNOWN;
436 idp->uio = uio;
437 idp->eofflag = 1;
438 idp->curroff = uio->uio_offset;
440 if ((entryoffsetinblock = idp->curroff & bmask) &&
441 (error = cd9660_blkatoff(vdp, SECTOFF(imp, idp->curroff), NULL, &bp))) {
442 FREE(idp, M_TEMP);
447 while (idp->curroff < endsearch) {
453 if ((idp->curroff & bmask) == 0) {
456 if ((error = cd9660_blkatoff(vdp, SECTOFF(imp, idp->curroff), NULL, &bp)))
469 idp->curroff =
470 (idp->curroff & ~bmask) + imp->im_sector_size;
486 idp->current.d_namlen = isonum_711(ep->name_len);
488 if (reclen < ISO_DIRECTORY_RECORD_SIZE + idp->current.d_namlen) {
504 idp->current.d_fileno = isodirino(ep, imp);
506 idp->current.d_fileno = ((daddr_t)buf_blkno(bp) << imp->im_bshift) +
510 idp->curroff += reclen;
514 cd9660_rrip_getname(ep,idp->current.d_name, &namelen,
515 &idp->current.d_fileno,imp);
516 idp->current.d_namlen = (u_char)namelen;
517 if (idp->current.d_namlen)
518 error = iso_uiodir(idp,&idp->current,idp->curroff);
522 ucsfntrans((u_int16_t *)ep->name, idp->current.d_namlen,
523 idp->current.d_name, &namelen,
526 idp->current.d_namlen = (u_char)namelen;
527 if (idp->current.d_namlen)
528 error = iso_uiodir(idp,&idp->current,idp->curroff);
532 strlcpy(idp->current.d_name, "..",
536 idp->current.d_namlen = 1;
537 error = iso_uiodir(idp,&idp->current,idp->curroff);
540 idp->current.d_namlen = 2;
541 error = iso_uiodir(idp,&idp->current,idp->curroff);
544 isofntrans(ep->name,idp->current.d_namlen,
545 idp->current.d_name, &namelen,
548 idp->current.d_namlen = (u_char)namelen;
550 error = iso_shipdir(idp);
552 error = iso_uiodir(idp,&idp->current,idp->curroff);
563 idp->current.d_namlen = 0;
564 error = iso_shipdir(idp);
624 uio->uio_offset = idp->uio_off;
625 *ap->a_eofflag = idp->eofflag;
627 FREE(idp, M_TEMP);