Lines Matching refs:lp
238 const struct lump *lp = TAILQ_FIRST(&lumps); in report() local
244 if (lp != NULL) { in report()
245 pass = lp->pass; in report()
246 start = lp->start; in report()
247 length = lp->len; in report()
295 struct lump *lp; in new_lump() local
298 lp = malloc(sizeof *lp); in new_lump()
299 if (lp == NULL) in new_lump()
301 lp->start = start; in new_lump()
302 lp->len = len; in new_lump()
303 lp->pass = pass; in new_lump()
304 TAILQ_INSERT_TAIL(&lumps, lp, list); in new_lump()
440 struct lump *lp; in attempt_one_lump() local
445 lp = TAILQ_FIRST(&lumps); in attempt_one_lump()
446 if (lp == NULL) in attempt_one_lump()
449 if (lp->pass == 0) { in attempt_one_lump()
450 sz = MIN(lp->len, big_read); in attempt_one_lump()
451 } else if (lp->pass == 1) { in attempt_one_lump()
452 sz = MIN(lp->len, medium_read); in attempt_one_lump()
454 sz = MIN(lp->len, small_read); in attempt_one_lump()
460 retval = pread(read_fd, work_buf, sz, lp->start); in attempt_one_lump()
478 write_buf(write_fd, work_buf, sz, lp->start); in attempt_one_lump()
483 (uintmax_t)lp->start, in attempt_one_lump()
490 (uintmax_t)lp->start, in attempt_one_lump()
498 write_buf(write_fd, pattern_buf, sz, lp->start); in attempt_one_lump()
500 new_lump(lp->start, sz, lp->pass + 1); in attempt_one_lump()
503 lp->start += sz; in attempt_one_lump()
504 lp->len -= sz; in attempt_one_lump()
505 if (lp->len == 0) { in attempt_one_lump()
506 TAILQ_REMOVE(&lumps, lp, list); in attempt_one_lump()
508 free(lp); in attempt_one_lump()