Lines Matching refs:bp

34 disk_err(struct bio *bp, const char *what, int blkdone, int nl)
38 if (bp->bio_dev != NULL)
39 printf("%s: %s ", devtoname(bp->bio_dev), what);
40 else if (bp->bio_disk != NULL)
42 bp->bio_disk->d_name, bp->bio_disk->d_unit, what);
45 switch(bp->bio_cmd) {
51 default: printf("cmd=%x ", bp->bio_cmd); break;
53 sn = bp->bio_pblkno;
54 if (bp->bio_bcount <= DEV_BSIZE) {
62 printf("%jd-%jd", (intmax_t)bp->bio_pblkno,
63 (intmax_t)(bp->bio_pblkno + (bp->bio_bcount - 1) / DEV_BSIZE));
156 bioq_remove(struct bio_queue_head *head, struct bio *bp)
160 if (bp == TAILQ_FIRST(&head->queue))
161 head->last_offset = bp->bio_offset + bp->bio_length;
162 } else if (bp == head->insert_point)
165 TAILQ_REMOVE(&head->queue, bp, bio_queue);
171 struct bio *bp;
173 while ((bp = bioq_takefirst(head)) != NULL)
174 biofinish(bp, stp, error);
178 bioq_insert_head(struct bio_queue_head *head, struct bio *bp)
182 head->last_offset = bp->bio_offset;
183 TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue);
187 bioq_insert_tail(struct bio_queue_head *head, struct bio *bp)
190 TAILQ_INSERT_TAIL(&head->queue, bp, bio_queue);
191 head->insert_point = bp;
192 head->last_offset = bp->bio_offset;
205 struct bio *bp;
207 bp = TAILQ_FIRST(&head->queue);
208 if (bp != NULL)
209 bioq_remove(head, bp);
210 return (bp);
219 bioq_bio_key(struct bio_queue_head *head, struct bio *bp)
222 return ((uoff_t)(bp->bio_offset - head->last_offset));
233 bioq_disksort(struct bio_queue_head *head, struct bio *bp)
238 if ((bp->bio_flags & BIO_ORDERED) != 0) {
245 bioq_insert_tail(head, bp);
250 key = bioq_bio_key(head, bp);
264 TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue);
266 TAILQ_INSERT_AFTER(&head->queue, prev, bp, bio_queue);