Lines Matching full:lp
193 report_histogram(const struct lump *lp)
218 now = lp->start / bucket;
240 report(const struct lump *lp, size_t sz)
245 assert(lp != NULL);
255 (intmax_t)lp->start,
257 (intmax_t)lp->len,
258 lp->state,
267 report_histogram(lp);
287 struct lump *lp;
289 lp = malloc(sizeof *lp);
290 if (lp == NULL)
292 lp->start = start;
293 lp->len = len;
294 lp->state = state;
295 TAILQ_INSERT_TAIL(&lumps, lp, list);
434 static struct lump *lp;
540 lp = TAILQ_FIRST(&lumps);
541 if (lp == NULL)
543 while (lp->len > 0) {
545 if (lp->state == 0)
546 sz = MIN(lp->len, (off_t)bigsize);
547 else if (lp->state == 1)
548 sz = MIN(lp->len, (off_t)medsize);
550 sz = MIN(lp->len, (off_t)minsize);
554 if (t1 != t2 || lp->len < (off_t)bigsize) {
560 report(lp, sz);
563 j = pread(fdr, buf, sz, lp->start);
573 write_buf(fdw, buf, sz, lp->start);
574 lp->start += sz;
575 lp->len -= sz;
576 if (verbose && lp->state > 2)
583 lp->start, sz, lp->state, strerror(error));
585 report(lp, sz);
588 write_buf(fdw, buf, sz, lp->start);
590 new_lump(lp->start, sz, lp->state + 1);
591 lp->start += sz;
592 lp->len -= sz;
606 if (aborting || !TAILQ_NEXT(lp, list))
607 report(lp, sz);
610 assert(lp->len == 0);
611 TAILQ_REMOVE(&lumps, lp, list);
612 free(lp);